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: 

Dimension along polyline

28 REPLIES 28
SOLVED
Reply
Message 1 of 29
BWYarger
31981 Views, 28 Replies

Dimension along polyline

I posted this topic before about 8 years ago and did not get a good answer.

 

I want to dimension along a curvy polyline.  I don't want to station it like a centerline.  It is for pavement marking dimensions in a curvy road and I want to show the total length of turn lane lines while they go through an s-surve.  I could draw the dimensions manually and have in the past, but I was wondering if anyone has come up with a better way.  For the contractor, I would simply station and offset it, but it makes it easier for the reviewer to see total turn lane, taper and lane shift lengths, rather than having to calculate them from station and offset callouts.

 

 

Brad
LT, C3D 2005 - 2024
Windows XP, Vista, 7, 10, 11
28 REPLIES 28
Message 2 of 29
Jeff_M
in reply to: BWYarger

Use MText with a Field which displays the polyline length.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 29
BWYarger
in reply to: Jeff_M

The mtext field works to give the length, but I was hoping for a dimension with leader lines, arrow heads, etc. to show what the text means.  Otherwise it is just a number floating in space.

 

Brad
LT, C3D 2005 - 2024
Windows XP, Vista, 7, 10, 11
Message 4 of 29
AllenJessup
in reply to: BWYarger

Expanding on Jeff's idea. You could create a Dimension then edit the Dimmtext and replace it with a field that contains the polylines length. That way you could utilize and lines or arrows drawn with the dimension.

 

Allen

Allen Jessup
CAD Manager - Designer
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

Message 5 of 29
AllenJessup
in reply to: AllenJessup

BTW. Since fields are linked to the object it will update if you edit the line or polyline.

 

Allen

Allen Jessup
CAD Manager - Designer
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

Message 6 of 29
Joe-Bouza
in reply to: BWYarger

put the field in the dimension text

 

dimfield.PNG

 

Joe Bouza
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

Message 7 of 29
BWYarger
in reply to: Joe-Bouza

This is getting close to what I wanted.  Is there a way to put the field in the aligned dimension, or do I just need to override the dimension text with a blank and then move the mtext field to the gap in the dimension line?   I tried help, but came up with nothing.

 

Brad
LT, C3D 2005 - 2024
Windows XP, Vista, 7, 10, 11
Message 8 of 29
AllenJessup
in reply to: BWYarger

Just create the dimension, start the ED (DDEDIT) command, select the dimension text, rt-click on the highlighted text and select Insert Field. Then you can link the field to the object.

 

Capture.PNG

 

Allen

Allen Jessup
CAD Manager - Designer
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

Message 9 of 29
BWYarger
in reply to: AllenJessup

Thanks to everyone. 

 

It was not quite what I wanted, but it works.  I had hoped for the dimension line to follow the s-curve to show that the dimension actually accounts for the arc lengths and tangents on a different angle from the dimension.  For shorter s-curves with larger radii it does not make much of a difference, less than a percent, so close enough for now.

 

Brad
LT, C3D 2005 - 2024
Windows XP, Vista, 7, 10, 11
Message 10 of 29
AllenJessup
in reply to: BWYarger

You can add text to the dimension to make it clear. I don't know of any way to add a curved dimension line.

 

Allen

Allen Jessup
CAD Manager - Designer
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

Message 11 of 29
Jeff_M
in reply to: BWYarger

The only CAD platform that I know which had curvilinear dimensions was CATIA. I've had cases where I've wished for this capability, but not enough to warrant attempting a custom solution.

 

However, if this method of using an aligned dimension with a field for the length works well enough, attached is a lisp to help automate the task. Just load the lisp, invoke the command "DIMPOLY", select the polyline, pick a point to place the dimension, the field gets added automatically. You could add to the text automatically placed to show that it is an overall length by editing this portion of the code:

                (strcat	"%<\\AcObjProp Object(%<\\_ObjId "
			(Get-ObjectID-x86-x64 obj)
			">%).Length \\f \"%lu6\">%"
		)

to this:

                (strcat	"%<\\AcObjProp Object(%<\\_ObjId "
			(Get-ObjectID-x86-x64 obj)
			">%).Length \\f \"%lu6\">%"
                        "My custom text"
		)

or whatever you desire that custom text to be.

 

Jeff_M, also a frequent Swamper
EESignature
Message 12 of 29
AllenJessup
in reply to: Jeff_M

Jeff,

 

I wanted to try out your lisp but got this error:

 

Command: DIMPOLY

Select object to dimension: ; error: no function definition:

VLAX-ENAME->VLA-OBJECT

 

I was trying to dimension a LWPolyline containing 3 arcs.

 

Allen

Allen Jessup
CAD Manager - Designer
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

Message 13 of 29
Jeff_M
in reply to: AllenJessup

Add:

(vl-load-com)

as the first line in the file.

Sorry about that, I have this in my acaddoc.lsp file so I always forget to include it in lisps I share.

Jeff_M, also a frequent Swamper
EESignature
Message 14 of 29
AllenJessup
in reply to: Jeff_M

Thanks Jeff. Works fine now.

 

Allen

Allen Jessup
CAD Manager - Designer
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

Message 15 of 29
BWYarger
in reply to: AllenJessup

Jeff,

 

I got the original lisp to work, but the dimension lines are not associated to the polyline, so if I edit the polyline, I must move the dimension grips.  At first the field appears not to update, but a regen takes care of that.

 

I would like to change the precission.  I tried several things, but could not get my changes to work.  For pavement markings the nearest foot is fine, but there are other times I might need it to the nearest hundredth.

 

I also am having problems with the suggested change to add my note to the end of the dimension field. 

 

I don't know LISP well enough to figure out what is wrong.  Can you suggest corrections to get the dimension lines associated with the polyline, change the precission to either zero or two decimal places, and the add the comment as a suffix to the number.

 

Brad
LT, C3D 2005 - 2024
Windows XP, Vista, 7, 10, 11
Message 16 of 29
AllenJessup
in reply to: BWYarger

While you wait for Jeff to respond I'll add what little I know. If you have "Make new dimensions associative" checked on the User Preferences tab in Options, the new dimension should be associative. Works for me anyway.

 

This is how I edited the lisp to add my own text

 

 

      (setq txt         (strcat   "%<\\AcObjProp Object(%<\\_ObjId "

                                                (Get-ObjectID-x86-x64 obj)

                                                ">%).Length \\f \"%lu6\">%"

                                                " O.A."

 

Put a space in front of the text to separate it from the field.

 

The only way I know to change the precision is to edit the field. If you right click on it and select Edit Field, you can then change the format to Decimal and change the Precision in the drop down box below that pane.

 

Allen

Allen Jessup
CAD Manager - Designer
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

Message 17 of 29
Jeff_M
in reply to: BWYarger

Allen covered the other questions, for the precision: in it's current form it is using the drawing's current units setting for the precision. You can hard code this like so:

Edit this:
\"%lu6\"

to this for decimal units with 0 precision:
\"%lu2%pr0\"

 What text would you like to have added to it and where (start, end)?

Jeff_M, also a frequent Swamper
EESignature
Message 18 of 29
Jeff_M
in reply to: Jeff_M

I should add that this lisp was a quick n dirty "let's see if this will work" kind of lisp. There is no error checking (try selecting a closed pline, might get undesirable results)and it would actually be fairly simple to add prompts for the precision and prefix/suffix text strings.

Jeff_M, also a frequent Swamper
EESignature
Message 19 of 29
AllenJessup
in reply to: Jeff_M


@Jeff_M wrote:

I should add that this lisp was a quick n dirty "let's see if this will work" kind of lisp. There is no error checking (try selecting a closed pline, might get undesirable results)and it would actually be fairly simple to add prompts for the precision and prefix/suffix text strings.



Of course I had to try right of way. If you close a Pline that is already dimensioned the field shows the perimeter. The dim line stays in the same place. If you try it on an already closed one you get a 0 length dimension at the point of closure and the field shows the perimeter.

 

Easy for some. I haven't written any meaningful lisp in about 10 years.

 

Allen

Allen Jessup
CAD Manager - Designer
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

Message 20 of 29
Jeff_M
in reply to: AllenJessup

I didn't say easy, I said simple. 🙂 Attached is a revised version that will ask for the precision (it will use the drawing default if nothing entered and suffix (I've allowed spaces to be used, so to respond without any suffix the Enter key must be used).

 

I made sure to include the vl-load-com this time, too.

Jeff_M, also a frequent Swamper
EESignature

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report