CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 10493
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedMULTIPLE LINE LENGTHS SUMMATION

 Post Reply Post Reply Page  12>
Author
Ikenna View Drop Down
Newbie
Newbie


Joined: 13.May.2016
Location: Nigeria
Using: AutoCAD2013
Status: Offline
Points: 6
Direct Link To This Post Topic: MULTIPLE LINE LENGTHS SUMMATION
    Posted: 13.May.2016 at 15:36
Halo Forum Members, good afternoon.
 
Please I need to know if there is a single command I can use to get the total summation of the lengths of different, separate lines. For example, if I have five separate lines measuring 5,10, 10, 5 and 3 meters each. My question now is: Is there a way I can select the five lines at once and issue a command and the AutoCAD application will simply give me the total lengths as 33 metres!
Thanks.
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 13.May.2016 at 15:44
There are lisp routines that will give you the total length of a series of lines.  One of them is called TLEN.lsp and it is from Tee Square Graphics.  You can also look for Lee Mac's Total Length program; it's on his website.


Edited by John Connor - 13.May.2016 at 15:52
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 629
Direct Link To This Post Posted: 23.May.2016 at 22:20
Here's another one.  Some Searching will probably find several others.
Back to Top
Ikenna View Drop Down
Newbie
Newbie


Joined: 13.May.2016
Location: Nigeria
Using: AutoCAD2013
Status: Offline
Points: 6
Direct Link To This Post Posted: 27.May.2016 at 11:39
Thanks so much John. Let me check it out.
Back to Top
Ikenna View Drop Down
Newbie
Newbie


Joined: 13.May.2016
Location: Nigeria
Using: AutoCAD2013
Status: Offline
Points: 6
Direct Link To This Post Posted: 27.May.2016 at 11:58
Thanks very much Kent. I just tried this method and it worked! But the issue is that it gives the summations in feet and inches. Secondly, it doesn't select arcs for summation.
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 27.May.2016 at 12:14
You should have tried Lee Mac's program.

http://www.lee-mac.com/totallengthandarea.html
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
Ikenna View Drop Down
Newbie
Newbie


Joined: 13.May.2016
Location: Nigeria
Using: AutoCAD2013
Status: Offline
Points: 6
Direct Link To This Post Posted: 27.May.2016 at 14:35
John, thanks very much. I tried it and it worked perfectly. Everything was calculated - lines and arcs!, and the summation was given in metres!! Thanks again.Smile
Back to Top
Ikenna View Drop Down
Newbie
Newbie


Joined: 13.May.2016
Location: Nigeria
Using: AutoCAD2013
Status: Offline
Points: 6
Direct Link To This Post Posted: 27.May.2016 at 14:53
Sorry, I meant 'summation was given in metric units'. Yes, I got it in millimetres.
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 27.May.2016 at 15:09
You're welcomed.  Glad to hear you found something that suits your needs.
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
Kent Cooper View Drop Down
Senior Member
Senior Member


Joined: 12.Mar.2013
Location: United States
Using: AutoCAD2020, 2023
Status: Offline
Points: 629
Direct Link To This Post Posted: 27.May.2016 at 16:51
Originally posted by Ikenna Ikenna wrote:

... the issue is that it gives the summations in feet and inches. Secondly, it doesn't select arcs for summation.
It's odd that the description at the linked page mentions Arcs, but in fact the routine isn't written to accept them.  You can change that to include them, and far more entity types, by changing this line:
  (setq sset (ssget '((0 . "LINE,LWPOLYLINE")))
to this:
 
  (setq sset (ssget '((0 . "LINE,*POLYLINE,ARC,CIRCLE,ELLIPSE,SPLINE")))
 
BUT since not all of those entity types have the same "length" VLA property [some have one but under a different name], you would also have to change this line:
 
   (vla-get-length (vlax-ename->vla-object (ssname sset num)))
 
to this:
 
   (vlax-curve-getDistAtParam (setq ent (ssname sset num)) (vlax-curve-getEndParam ent))
 
which will find the length of any (vlax-curve-...)-compatible entity, open or closed.
 
And you can have it report in whatever Units you like.  Change this:
 
     llen (rtos llen 4)
which reports in Architectural units [the 4] to just:
 
     llen (rtos llen)
 
if you want it to report in whatever your current Units and Precision settings are, or use other values for units and precision in the (rtos) function, to suit your requirements.
[Also, I would change the (alert) to use a word like "object" instead of "line."]


Edited by Kent Cooper - 27.May.2016 at 16:52
Back to Top

Related CAD tips:


 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,404 seconds.