Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Polyline Length LSP

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
gccdaemon
16043 Views, 19 Replies

Polyline Length LSP

I'm looking for a LSP routine that can add polyline and or line/arc lengths together. I'm trying to get quantities and this project is taking forever using the properties and calculator in autocad. If there is one out there that does this similar to autocad's AREA>OBJECT>ADD that would be FANTASTIC! Please help!

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
19 REPLIES 19
Message 2 of 20
Jeff_M
in reply to: gccdaemon

TLEN.lsp from http://www.turvill.com/t2/free_stuff/index.htm is one that's been around a while.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 20
Kundertk
in reply to: gccdaemon

Google up "TLEN.LSP".  I've used this for many years during the quantity takeoff process.

Message 4 of 20
gccdaemon
in reply to: gccdaemon

I found something a little better to use and made some modifications. Instead of using an alert I dropped it into prompts so I can CTRL+C from the command line.

 

 

(defun C:TL (/ 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
  (prompt "Total length: ")
  (prompt (rtos tl))
  (princ)
); end defun

 

 

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 5 of 20
gccdaemon
in reply to: gccdaemon

Now, is there a routine that is similar to to distance command but cumulatively adds the distance? lol.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 6 of 20
Anonymous
in reply to: gccdaemon

Draw Polyline

List

Erase Polyline

 

 

**** Edit to add, that that may come off as sarcastic but it's actually a better method.  It allows you to visualize your measured path, and grip edit it to adjust it without having to re-trace.

Message 7 of 20
gccdaemon
in reply to: gccdaemon

Here is my situation, so that you understand better what I'm looking for. We've got to get a linear foot total for striping. Our striping is created from solids not polylines, because it cleans up better at edge of pavement than a global width polyline, and it's easier to use in our complex dynamic blocks. My problem is that I have to do approximately 20 distance commands per road intersection and manually add those numbers together. Not a problem if I've got a few intersections, but with miles of downtown road consisting of over 100 intersections it becomes very time consuming and cumbersome. Instead of hitting DI 2,000 times and having to add the values manually, I need something that will add continuously. I'd Create something myself if I knew enuff to do it.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 8 of 20
Anonymous
in reply to: gccdaemon

When you say "Solids" you're not refering to actual 3D Solids, are you?  Just want to be clear.

 

Also, in this case, wouldn't what I suggested above be more practical then the distance command?  Just drawing a polyline and listing it?

 

If I'm still off base, do a PNGOUT and show us what you're dealing with.

Message 9 of 20
Jeff_M
in reply to: gccdaemon

Why not use the Add distance command in C3D?

 

In 2010 it's on the Inquiry panel of the Analyze ribbon tab. Command name is CGADIST. It doesn't do curves but it's quick enough to just do your own short tangents.

Jeff_M, also a frequent Swamper
EESignature
Message 10 of 20
gccdaemon
in reply to: Anonymous

Solids = 2D solids created from [^C^C._Solid] command.

 

I need to add the lengths in red. The crosswalk stripes are 8' long default, so they're not included because i can multiply.

 

I think Jeff's comment will do what i need in the short time. I was trying to do mapcgadist and it wasn't loading.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 11 of 20
Anonymous
in reply to: gccdaemon

Now that I see what you're after, mapquery would do it too.  If your red lines are on their own layer, query by layer and report the length to a CSV.  Then, just sum the length column.

Message 12 of 20
peterfunkautodesk
in reply to: Anonymous

You could also use QTO tools that are built into Civil 3D to find your linear totals.

 

Peter Funk

Autodesk, Inc.



Peter Funk
Autodesk, Inc.

Message 13 of 20
Anonymous
in reply to: Anonymous

Not to bring this up again, just a detailed description of what I was talking about with MapQuery is here:

http://forums.autodesk.com/t5/AutoCAD-Civil-3D/Extract-Text-to-csv-or-similar/m-p/2947208#M147743

 

In this case, rather than adding the .STRING parameter, you would simply add the .LENGTH parameter to the report.

Message 14 of 20
neilyj666
in reply to: Anonymous

....or could you use Data Extraction tools?????Smiley Wink

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 15 of 20
Anonymous
in reply to: gccdaemon

I'm late to game here but DATEXTRACTION is perfect for this. You can even build in formulas for conversions and or cost calculations.

 

I have not experimented with it yet but the new QTO tools should also tabulate for you

Message 16 of 20
Anonymous
in reply to: Anonymous

This seems appropriate here too. Smiley Wink

Message 17 of 20
gccdaemon
in reply to: Anonymous

I need something that work in Basic AutoCAD as well. It's mostly for Engineers/EIT's to pull quantities faster. This project is NOT a civil 3D project. I need a routine that is similar to AeccCgADist but works in layouts and uses current units, not a preset. Is there anyone out there who can do this?

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 18 of 20
Anonymous
in reply to: gccdaemon

DATAEXTRACTION wizard is native acad tool. the beauti of this is: if your standards are good you can set it up once and use it over and over

Message 19 of 20
Anonymous
in reply to: gccdaemon

Then I'd suggest you're in the wrong forum.  Autocad is here: http://forums.autodesk.com/t5/AutoCAD-2011/bd-p/407

 

Larger user base there.

Message 20 of 20
Anonymous
in reply to: Anonymous

Also, take a look here: http://www.dotsoft.com/freestuff.htm

 

Scroll down to: LINESUM.LSP

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report