下面是CAD中自动计算多条线段长度的一个LSP插件的程序内容,我想将计算结果除以1000,怎么改? 10
(princ"\n程序:统计线段长度命令:test")(defunC:TEST(/CURVETLENSSNSUMLEN)(vl-load-com)(setqSUMLEN0...
(princ "\n程序:统计线段长度 命令:test")(defun C:TEST (/ CURVE TLEN SS N SUMLEN) (vl-load-com) (setq SUMLEN 0) (setq SS (ssget '((0 . "CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE,ARC")))) (setq N 0) (repeat (sslength SS) (setq CURVE (vlax-ename->vla-object (ssname SS N))) (setq TLEN (vlax-curve-getdistatparam CURVE (vlax-curve-getendparam CURVE))) (setq SUMLEN (+ SUMLEN TLEN)) (setq N (1+ N))) (princ (strcat "\n共选择 " (itoa (sslength SS)) " 条线段. 线段总长: "(rtos SUMLEN 2 3) "豪米."))(princ) )
展开
2个回答
展开全部
(princ "\n程序:统计线段长度 命令:test")(defun C:TEST (/ CURVE TLEN SS N SUMLEN) (vl-load-com) (setq SUMLEN 0) (setq SS (ssget '((0 . "CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE,ARC")))) (setq N 0) (repeat (sslength SS) (setq CURVE (vlax-ename->vla-object (ssname SS N))) (setq TLEN (vlax-curve-getdistatparam CURVE (vlax-curve-getendparam CURVE))) (setq SUMLEN (+ SUMLEN TLEN)) (setq N (1+ N))) (princ (strcat "\n共选择 " (itoa (sslength SS)) " 条线段. 线段总长: "(rtos SUMLEN 2 3)/1000 "米."))(princ) )
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询