How to renumber in consecutive order a Polyline with Line and Curve Tags

Greetings,
Civil 3D has not been able to label in consecutive order a polyline with Line and Curve Tags for over a decade now. There are workarounds, but a Dynamo script would probably be better then the best workaround. I do not know how to even start that script. Is the Civil 3D Toolkit needed to see the Line and Curve Tags? Any help would be much appreciated.

Issue described in the below two Civil 3D forms.

Sorry, it don’t know if the counter system has exposed API for dynamo to use, @hosneyalaa ? Just to see the issue i made a polyline and labeled then made a table from the styles used and separate line and curve counters worked fine for me

@mzjensen I attempted using Camber to make general line and segment labels for a new polyline but it only put one label, kinda weird, did I do it right?


Oh I think I’m figuring it out. Seems like the result though is skipping numbers like you said.
Create Line and Curve Labels v0.dyn (25.7 KB)
Create Line and Curve Labels v0.dwg (939.1 KB)

2 Likes

When labeling a polyline in Civil 3D the Curve Tag increments the Line Tag Number which causes the issue. If you explode the polyline to lines and arcs then the curve tag does not increment the line tag counter and it works. But exploding the polyline is not a good answer for us.
Can the DYN reduce the line tag number by one if a curve was in front of it. Or somehow make it think they are separate lines and arcs not a single polyline.

If it is an Alignment, the Curve Tag does not increment the Line Tag number, it only does it for Polylines.

Would it be easier to renumber the tags with the Dyn, and not create them?

The best workaround, which you may be able to do with a dyn, it to first use Non-Tag labels on all the lines and arcs, and then select them all and change properties to Tag labels. When doing that it seem to number them properly.

You can technically do this using the graph @KirkWM showed above by first creating the labels using non-tag styles and then change the style inputs (the dropdown nodes) after the labels are first created. That essentially does the same thing as updating the styles via the Properties window and will increment the line and curve tag numbers appropriately. However, that is still a bit of a workaround because you’d have to have Dynamo open to be able to run the graph twice and change the inputs between runs. So it wouldn’t work in Dynamo Player.

Assuming that the eventual goal is to have line/curve tables, then another non-Dynamo workaround could be to create the labels using non-tag styles, then add a line/curve table. It will force all of the styles to tag mode and will increment the numbers appropriately.

2 Likes

Thinking out loud…

Could you use Dynamo to create an alignment from the polyline geometry, set the alingment style to be invisible, then add the line/curve tags and tables to the invisible alignment?

However, if the polyline geometry changed, would re-running the graph wipe the original alignment from the drawing or just add another alignment? Maybe its one graph to create the invisble alignment and a second graaph to update the invisible alingment geometry from the selected polyline?

Or…

Would it be a big deal to have Dynamo convert your polyline to an alignment that looks like your polyline? Then you can just add the labels and tables in the same graph. Assume you’re labeling only one or two types of lines, it could be easy enough to create a couple new styles to mimic your polyline.

1 Like

Love learning something new. This seems to be the best work around. I added a label state (just XX) to the Tag labels we need, and when I make the table it automatically switches the state of the labels to the TAG and puts them in consecutive order. Do you want to post this workflow in the Civil 3D forum i put in at the start of this conversation or should I.

Our Survey department is very rigid. They want it to work with Polylines and the Alignment solution would not work for them.

Go for it! :slightly_smiling_face:

It may be a good workaround for some. But since our Line and Curve styles and Table Styles are in a reference template it does not work for us. When you open the dwg the reference template redefines the style which for some reason (BUG) sets the labels back to label instead of TAG, and empties the table. A dyn that found all the labels on the polyline and changed them to a specific TAG only style would still be helpful.

I have been walking down this path this week using Camber to add line/curve tags to objects on a selected layer. Selecting a line tag with lisp and using VLAX-DUMP-OBJECT I don’t see the tag number, so I think its being controlled behind the scenes.

There are two big problems with the current tag label methods. 1) Phantom tag numbers will get created so the numbering will go 1,2,3,4,6 unless you give it the option to create duplicates. 2) there isn’t anything to force adjacent #'s to be next to each other.

I may try a workflow to just add this as text and autocad table, because programming a solution for this would be a large timesaver for our users.

What is happening with the “Phantom Numbers” is that the Curve Tag label command is incrementing the Line Tag Label settings. The Code for the Curve Tag label command is messed up. That is why if you label the polyline with regular labels (just an X line and X curve label) and then change those labels to Tags they are sequential.