Activity Feed › Discussion Forums › Software, CAD & Mapping › Polyline lengths
Polyline lengths
Posted by POL on August 31, 2010 at 3:23 pmI am running Civil 3D land Desktop 2008. Is it possible to list the lenghts of multiple polylines without listing each one?
Thanks
POL replied 13 years, 8 months ago 3 Members · 3 Replies- 3 Replies
If you choose all of the polylines and type li at the command prompt, you will get all of the lengths in the text window. You can copy that and paste it into notepad if that will help.
tlen.lsp
(defun C:TLEN (/ ss tl n ent itm obj l)
(setq ss (ssget)
tl 0
n (1- (sslength ss)))
(while (>= n 0)
(setq ent (entget (setq itm (ssname ss n)))
obj (cdr (assoc 0 ent))
l (cond
((= obj “LINE”)
(distance (cdr (assoc 10 ent))(cdr (assoc 11 ent))))
((= obj “ARC”)
(* (cdr (assoc 40 ent))
(if (minusp (setq l (- (cdr (assoc 51 ent))
(cdr (assoc 50 ent)))))
(+ pi pi l) l)))
((or (= obj “CIRCLE”)(= obj “SPLINE”)(= obj “POLYLINE”)
(= obj “LWPOLYLINE”)(= obj “ELLIPSE”))
(command “_.area” “_o” itm)
(getvar “perimeter”))
(T 0))
tl (+ tl l)
n (1- n)))
(alert (strcat “Total length of selected objects is ” (rtos tl)))
(princ)
)tlen.lsp
Thanks. That works.
Log in to reply.