: Reports the cumulative length of selected items directly to the command line. How to Use a Total Length LISP
(defun C:TLEN (/ ss tl n ent itm obj l) (setq ss (ssget '((0 . "LINE,ARC,SPLINE,LWPOLYLINE,POLYLINE,CIRCLE,ELLIPSE")))) (setq tl 0) (setq n 0) (if ss (repeat (sslength ss) (setq ent (ssname ss n)) (setq itm (entget ent)) (setq obj (vlax-ename->vla-object ent)) (setq l (vlax-curve-getdistatparam obj (vlax-curve-getendparam obj))) (setq tl (+ tl l)) (setq n (1+ n)) ) ) (if (> tl 0) (alert (strcat "Total length = " (rtos tl 2 2) " drawing units.")) (alert "No valid objects selected.") ) (princ) ) total length lisp for autocad
: It iterates through a user's selection and identifies various entity types including lines, arcs, polylines, circles, and splines. Calculating Perimeters : Reports the cumulative length of selected items
Add this line right before the final princ : Calculating Perimeters Add this line right before the