Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

nichkherbsman
en respuesta a: ramjan3N9ZA

Hi Ram,

 

The easy way to get the total length of multiple lines is to use lisp.

 

Here is the code:

(defun C:TLEN (/ ss tl ent)
  (setq
    ss (ssget '((0 . "LINE,ARC,CIRCLE,*POLYLINE,SPLINE,ELLIPSE")))
    tl 0
  ); end setq
  (repeat (sslength ss)
    (setq
      ent (ssname ss 0)
      tl
        (+
          tl 
          (vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent))
        ); end + & tl
    ); end setq
    (ssdel ent ss)
  ); end repeat
  (alert (strcat "Total length of selected objects is " (rtos tl)))
  (princ)
); end defun

If you don't know how to use lisp, here is a link:

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-AutoLISP/file...

 

See also screencasts below.

 

Thank you. Guiño

 

 

NiCHKCiD
BIM Modeler
Technical Officer
Technical Designer
Sr. Draftsman