Sum of lengths

Is there any way to select several lines on a drawing and have autocad list the sum of their lengths?

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Paul has a good freebie on his site. Go here and download tlen.lsp:
http://www.turvill.com/t2/free_stuff /
It does circles, arcs, polylines as well as lines.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Here... have fun..
(defun c:develop (/ iter devel $a total data1 stpt endpt distl strad endrad distr ) (setvar "osmode" 0) (setq $a nil iter 0 devel 0.0 stpt nil endpt nil strad 0.0 endrad 0.0 rad 0.0 distl 0.0 distr 0.0 total 0.0 devel 0.0 ) (setq $a (ssget)) (setq total (sslength $a)) (while (< 0 total) (progn (setq data1 (cdr (entget (ssname $a iter)))) (cond ((= (cdr (assoc 0 data1)) "LINE") (Progn (setq stpt (cdr (assoc 10 data1)) endpt (cdr (assoc 11 data1)) ) (setq distl (abs (distance stpt endpt))) (setq devel (+ devel distl)) ) ;_END PROGN ) ;_END COND1 ((= (cdr (assoc 0 data1)) "ARC") (Progn (setq strad (cdr (assoc 50 data1)) endrad (cdr (assoc 51 data1)) rad (cdr (assoc 40 data1)) ) (cond ((> endrad strad) (setq distr (* rad (- endrad strad))) ) ((setq distr (* rad (+ endrad (- (* 2 pi) strad)))) ) (t nil) ) ;_end COND (setq devel (+ devel distr)) ) ;_END PROGN ) ;_END COND2 (T nil) ) ;_END COND (setq iter (+ 1 iter)) (setq total (- total 1)) ) ;_END PROGN ) ;_END WHILE (alert (strcat "Longueur totale : " (rtos devel) " units")) (setq $a nil) (setvar "osmode" 183) ) ;_end DEFUN DEVELOP

list
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.