- 积分
- 555
- 明经币
- 个
- 注册时间
- 2002-10-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
;;;-----------------------------------------------------
;;;计算线加总长度
;;;-----------------------------------------------------
(defun CENOF (/ 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))
)
(print (strcat "总长度: " (rtos SUMLEN 2 5)))
(princ)
)
在command:下键入(print sumlen)返回为nil,但在上程序加(setq j 2)在command:下键入(print j)返回为2 2。这是为什么? |
|