The topic today: Lisp AutoCAD – Total length Line, Polyline, Circle, Arc, Ellipse, Spline
To use this Lisp, step to step as following:
- Load Lisp to AutoCAD
- Type “TL” and press Enter
- Select objects need to calculate length
- Press Enter and Look result
Code Lisp:
(defun Length1(e) (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e)))
;;;——————————————————————–
(defun C:TL( / ss L e)
(setq
ss (ssget (list (cons 0 “LINE,ARC,CIRCLE,POLYLINE,LWPOLYLINE,ELLIPSE,SPLINE”)))
L 0.0
)
(vl-load-com)
(while (setq e (ssname ss 0))
(setq L (+ L (length1 e)))
(ssdel e ss)
)
(alert (strcat “Total length = ” (rtos L)))
)
;;;——————————————————————–
Download Lisp here: Link 1; Link 2
Thanks for visiting and reading AutoCADtip.com Blog!