Sum of lengths

Is there any way to select several lines on a drawing and have autocad list
the sum of their lengths?
Reply to
Mike Harrison
Loading thread data ...
Paul has a good freebie on his site. Go here and download tlen.lsp:
formatting link
It does circles, arcs, polylines as well as lines.
Reply to
Peter Ruehle
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) " unités")) (setq $a nil) (setvar "osmode" 183) ) ;_end DEFUN DEVELOP
"Mike Harrison" a écrit dans le message de news:ArFff.536469$tl2.340047@pd7tw3no...
Reply to
Dr Fleau

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.