How to calculate the total length of multiple lines

How to calculate the total length of multiple lines

veloster
Participant Participant
797,896 Views
77 Replies
Message 1 of 78

How to calculate the total length of multiple lines

veloster
Participant
Participant

Hi!
I would like to know if it's possible to have the total length of different lines by selecting them in a drawing?
Those lines are all separated and it will take forever to do it manually on a calculator 🙂
Thx!

Accepted solutions (2)
797,897 Views
77 Replies
Replies (77)
Message 21 of 78

wisedrawing
Collaborator
Collaborator

for accumulative lengths by picking points along the way:

 

Just searched this little gem out:

 

TLENGTH - PICK FIRST POINT - THEN SELECT MULTIPLE AND CLICK AWAY - RIGHT CLICK TO END = TOTAL LENGTH

 

this is brilliant - no lisp or other complex workarounds

 

well done Pat

 

Darren

0 Likes
Message 22 of 78

Anonymous
Not applicable

Great,


@nestly2 wrote:

Welcome to the Autodesk forums.

 

AutoCAD doesn't have anything like that built in, but it's easily done with TLEN.lsp (Total LENgth of selected objects)

http://www.turvill.com/t2/free_stuff/tlen.lsp

 

If you're not familiar with how to use lisp, simply copy/paste (CTRL+V) ALL the text and characters in the above link into your command line and press Enter, then type TLEN into the command line and follow the command prompt (select the objects)  Note using this method, the lisp is only loaded for the current session, if you want it to be a permanent feature, Add it to the Startup Suite or the acaddoc.lsp file.

 



 its working perfectly.

Message 23 of 78

Anonymous
Not applicable

i am unable to use in Autocad LT2018..

0 Likes
Message 24 of 78

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

i am unable to use in Autocad LT2018..


See Posts 14 & 15.

Kent Cooper, AIA
0 Likes
Message 25 of 78

Anonymous
Not applicable

wow great work .. thanks alot

 

0 Likes
Message 26 of 78

CADDVV
Enthusiast
Enthusiast

I could not find the suitcase.  Is there another folder to look for? Thanks!

0 Likes
Message 27 of 78

Kent1Cooper
Consultant
Consultant

@CADDVV wrote:

I could not find the suitcase.  Is there another folder to look for? Thanks!


"Briefcase" might be a better word.  The look varies somewhat between versions, but this is from 2018:

StartupSuite.png

 

It's near the lower right corner of the dialog box.

Kent Cooper, AIA
0 Likes
Message 28 of 78

CADDVV
Enthusiast
Enthusiast

ok, got it.  thanks!

0 Likes
Message 29 of 78

Anonymous
Not applicable

Just used this in AutoCAD 2018 and it worked perfectly......got me a gold star from the boss!!! LOL Thanks nestly2!!!!

0 Likes
Message 30 of 78

wisedrawing
Collaborator
Collaborator

The command TLENGTH then select first point, then press m for multiple lines, still works in 2018, I added the cut and paste and it all seems to work perfect. the only simple mistake that I can see someone might make is not clicking the first point and then clicking the m for multiple lines after the first point click. (ie going off early on the m)

 

Daz

0 Likes
Message 31 of 78

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

The command TLENGTH then select first point, then press m for multiple lines, still works in 2018, I added the cut and paste and it all seems to work perfect. the only simple mistake that I can see someone might make is not clicking the first point and then clicking the m for multiple lines after the first point click. (ie going off early on the m)

 

....

Note that TLENGTH is now a stand-in command name, and the actual command you get from it is DIST.  In recent versions that includes the Multiple-points option in it that the TLENGTH command was made to provide, back when DIST did not have that option.  So TLENGTH is expendable now -- you can just use DIST and skip the middle-man.

Kent Cooper, AIA
Message 32 of 78

wisedrawing
Collaborator
Collaborator

yep it checks out - thanks

soon I will be doing everything the correct way? no work arounds, that will be the day 🙂

0 Likes
Message 33 of 78

Anonymous
Not applicable

Thanks machaa 

 

i was searching this i got it...

 

 

Thanks Regards

Mukesh.P

 


@braudpatwrote:

 

Hello from France

 

Welcome to the Autodesk/AutoCAD Forums !

 

I am using since a long time ago this nice French routine : TLENGTH

which is running on : LINE , POLYLINE , LWPOLYLINE , ARC , CIRCLE , ELLIPSE , SPLINE , MLINE , REGION , MPOLYGON

You can remove easily some entities from the filter inside the routine ... 

 

Thks to Patrick_35 for this beautiful routine ...

 

 


 

0 Likes
Message 34 of 78

Anonymous
Not applicable

Good afternoon, 
There is another way to calculate the total length of multiple lines in AutoCAD without using lisp. You can accomplish this by using the command EATTEXT. 

 

Here are the steps:

1.) It will prompt you to save a data extraction file

2.) Select the files or objects you would like to run the command on

3.) Select only the objects you want to know the total length of (Lines or Plines). You can "uncheck" all and then only select lines or plines.

4.) This is the fun part... I normally select just Length and Layer as my options. This way I can filter out lines that are on different layers. 

5.) The wizard will display a table of all of the lines in the drawing, the layer they are on, and their length. 

6.) Output the table to excel

7.) Open in excel and sum all of the values to get the total. 

 

0 Likes
Message 35 of 78

Anonymous
Not applicable

Ok. So i've opened up and link and copied ALL of the text in that link. but when i paste it into my command line it just keeps prompting me to open up a new file... over and over and over. like 20 times.

 

what am i doing wrong? this LISP would save me about 8 hours of time so if i can get this figured out that would be great...

 

Thank you in advance!

0 Likes
Message 36 of 78

Anonymous
Not applicable

You should try using my EATTEXT method from the post right above yours. It's relatively easy to do and it doesn't require lisp. 

0 Likes
Message 37 of 78

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

Ok. So i've opened up and link and copied ALL of the text in that link. but when i paste it into my command line it just keeps prompting me to open up a new file... ....


 

I don't know -- maybe a version-related difference, or something.  But if you're talking about the link in Message 2, try either:
A)  Copy/paste from the (defun .... line near the top to the end, without the four "header" lines; or

B)  Copy/paste all of it into a file, save that with a .lsp filetype ending somewhere, and APPLOAD it.

Kent Cooper, AIA
0 Likes
Message 38 of 78

Anonymous
Not applicable

How to download this lisp for permanent use

 

0 Likes
Message 39 of 78

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

How to download this lisp for permanent use


 

If you're talking about the accepted Solution in Message 2, pick on the link, select and Ctrl+C copy the contents, open a plain-text editor such as Notepad, Ctrl+V paste the content into it, Save it to a file called TLEN.LSP in some location that is in the Support File Search Path list [OPTIONS command, Files tab], and use APPLOAD to load it into a drawing.  The command name to use is the part following the C:, that is, TLEN.  If you want it loaded into every drawing you open, make a file called acaddoc.lsp, also in a location in the Support File Search Path list, or open such a file if you already have one, and include a line like this:

 

(load "tlen")

Kent Cooper, AIA
0 Likes
Message 40 of 78

Anonymous
Not applicable

Excellent !   this is save time for me !

 

Thanks Neil 🙂

0 Likes