(defun c:CalLong( / lay ss i ent len) (setq lay (getstring "输入层名:")) (setq ss (ssget "x" (list '(0 . "*line,arc") (cons 8 lay)))) (if ss (progn (setq i 0 Len 0) (repeat (sslength ss) (setq ent (ssname ss i)) (setq Len (+ Len (vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent)))) (setq i (1+ i)) ) ) ) Len ) (prompt "Enter CALLONG to launch the program!")