Jump to content

line length sum ?


fuqua

Recommended Posts

is there a way in autocad 2009, to select all the lines on a certain layer and have autocad sum up the total lenght of those lines on that layer ?

Link to comment
Share on other sites

I have a lisp for that but I don't remember where I had got it.

(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)
)

 

Edit: someone has to change selectionset on code for selecting by layer.

  • Like 1
Link to comment
Share on other sites

ah thats great mate, now i need to step up a bit. what i now need is a way, for it to auto select all poly lines within a cluster and measure the total lenght in that selected cluster. (something like microstations "Fan" its called i believe.)

Link to comment
Share on other sites

I use Alexandr Rivilis GeomProps utility.

http://www.maestrogroup.com.ua/support/GeomProps.zip

Type ARX in command line, then Load and pick on GeomProps2006.arx if use Autocad 2006 or GeomProps2007.arx if use Autocad 2007-2009. Now adds arx for AutoCad 2010 x86&x64

Critical remarks:

This operation needs to be made once

After that simply choose objects and in a window of properties look the area, volume, length

Important!!!

 

By virtue of the certain reasons this utility to unload it is impossible: it will lead to crash Autocad.

Its autostart can be removed and manually from the register. It is a branch:

HKEY_CURRENT_USER \Software \Autodesk \AutoCAD \R1N.M \ACAD-XXXX:YYY \Applications \GeomProps

Where N, M, XXXX, YYY - depend on the version and localization AutoCAD

Original thread in Russian: http://www.caduser.ru/forum/index.php?PAGE_NAME=read&FID=44&TID=36136

geomprops.jpg

Link to comment
Share on other sites

I use Alexandr Rivilis GeomProps utility.

http://www.maestrogroup.com.ua/support/GeomProps.zip

Type ARX in command line, then Load and pick on GeomProps2006.arx if use Autocad 2006 or GeomProps2007.arx if use Autocad 2007-2009. Now adds arx for AutoCad 2010 x86&x64

Critical remarks:

 

Original thread in Russian: http://www.caduser.ru/forum/index.php?PAGE_NAME=read&FID=44&TID=36136

 

Very nice VVA ~ I've gotta learn some ARX or C++... :P

Link to comment
Share on other sites

I use Alexandr Rivilis GeomProps utility.

http://www.maestrogroup.com.ua/support/GeomProps.zip

Type ARX in command line, then Load and pick on GeomProps2006.arx if use Autocad 2006 or GeomProps2007.arx if use Autocad 2007-2009. Now adds arx for AutoCad 2010 x86&x64

Critical remarks:

 

Original thread in Russian: http://www.caduser.ru/forum/index.php?PAGE_NAME=read&FID=44&TID=36136

 

am i understanding you well ? does this program create a border and then calculates the lenght of all plines within those borders ? despite if a pline crosses the made border ? if so that be great !

Link to comment
Share on other sites

This program calculates length, the area and volume of the allocated objects and displays data on a bookmark of properties. It is necessary to allocate simply the necessary objects and to look on a bookmark of properties their length.

Arx it is necessary to load once and further it is loaded automatically. Any commands to cause it is not necessary, it is necessary only for those or with a different way to allocate interesting objects

Link to comment
Share on other sites

This program calculates length, the area and volume of the allocated objects and displays data on a bookmark of properties. It is necessary to allocate simply the necessary objects and to look on a bookmark of properties their length.

Arx it is necessary to load once and further it is loaded automatically. Any commands to cause it is not necessary, it is necessary only for those or with a different way to allocate interesting objects

 

 

hmm ok ill go give this a try then. thanx alot mate

Link to comment
Share on other sites

just gave this a run and its great, it actually gives a "extra" menu within the properties screen showing the total lenght of all lines selected.

 

1 thing i dont quite understand is what is being measured with "Area total" ?

if i select a line which is 10.60 long it also says area total = 6.0281 !?

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...