(defun c:tlen(/ curve tlen ss n f) (vl-load-com) (setq f (open (getfiled "" "" "" 1) "w")) (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 tlen (strcat (rtos tlen 2 5) "\n")) (princ tlen f) (setq n (1+ n)) ) (close f) (princ) ) 自己编出来了!哈哈 |