(defun c:Line_Total(/ sset *adco* total len)
;;Author:Ganesh Shetty, Copyright © 2013 -http://autolispgs.blogspot.in
(vl-load-com)
(if (setq sset (ssget "_:L" '((-4 . "<Or")
(0 . "POLYLINE")
(0 . "LINE")
(0 . "LWPOLYLINE")
(-4 . "or>"))
)
)
(progn
(setq *adoc*(vla-get-activedocument(vlax-get-acad-object)))
(setq total 0)
(vlax-for x (setq sset(vla-get-activeselectionset *adoc*))
(setq len(vlax-curve-getdistatparam x (vlax-curve-getendparam x)))
(setq total(+ total len))
)
(alert (strcat "\nTotal Line Total is : " (rtos total)))
(vla-delete sset)
)
)
(princ)
)
0 comments:
Post a Comment