Put surface elevation labels on an aliment

I’m trying to create a script to add surface elevation labels on an aliment’s geometry points. Now I have trouble to get those geometry points coordinates. Which nodes should I use? Any suggestion?

Hi @DavidFan74,

Here’s one way you could do it:

1 Like

Thanks, but how to get the curve quarter points?

If you have specific requirements for what is considered a “geometry point”, then you’ll probably need to compute the station values that you need and then use the Alignment.PointAtStationOffset node.

For example, the midpoint would be
AlignmentSubEntity.StartStation + AlignmentSubEntity.Length / 2

1 Like

Yes, this only works on Civil3d 2025. C3d2024 doesn’t have those nodes.
Anyway, how to repeat the nodes? I need to repeat 4 times to get all the quarter points.
I have the nodes developed as below, but not sure how to make a loop to get all the 4 points.

You could do it with the Sequence or Range nodes, but it will be a little more work to get the end station to come out right. As an alternative, there is a super simple way to handle this with one line in a code block. You can just do this:

start..end..#divisions;

That will ensure that the start and end are correct, and then you can divide it up into however many equal intervals that you want. By the way, there’s nothing special about the names start, end, and divisions. You could make them whatever you want, for example a..b..#c; would do the exact same thing.

You can find more documentation about this in the Dynamo Primer.

1 Like

Thanks a lot. This seems very efficient. I will give it a try.

1 Like

Yeah! It works! Is there any way to rotate the labels to perpendicular to the alignment?

Nice! Sure, you can use the Label.SetRotation node for that. The tricky part will be figuring out what the appropriate rotation angle is for each label. It goes like this:

  1. Figure out the direction of the alignment at each station
  2. Calculate the angle between that direction and the X axis
  3. Add 90 degrees

2 Likes