(defun c:Alength()
(setvar "cmdecho" 1)
(setq en (ssget (list '(0 . "spline,arc,line,ellipse,LWPOLYLINE"))))
(setq i 0 ;计数器
setq ll 0) ;总长初始化
(repeat (sslength en)
(setq ss (ssname en i))
(command "lengthen" ss "")
(setq dd (getvar "perimeter"))
(setq ll (+ dd ll))
(setq i (1+ i))
)
(princ "所选线条总长为:")
(princ ll)
(princ)
)
06-13
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-27
4121
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)