Annotative Spot elevation difference Dynamo

Annotative Spot elevation difference Dynamo

f.concepcionUE5JP
Advocate Advocate
2,311 Views
13 Replies
Message 1 of 14

Annotative Spot elevation difference Dynamo

f.concepcionUE5JP
Advocate
Advocate

Hi everyone,


I'm trying to create a Dynamo script to generate annotative spot elevation labels. I have two surfaces — EG and FG — and I want to subtract FG from EG to show the elevation difference. But I’m stuck; it doesn’t seem to work as expected. Has anyone run into this before or found a workaround? Any help would be greatly appreciated. Thanks in advance!

C3D.jpg

C3D.jpg

 

0 Likes
Accepted solutions (1)
2,312 Views
13 Replies
Replies (13)
Message 2 of 14

ecfernandez
Mentor
Mentor

Hi @f.concepcionUE5JP, I tried to replicate the error and in my case it is working fine (I'm using C3D 2026). 

Operation.png

 

I cannot see the warning of your graph, so I am not sure what it is about. However, I'd like to make some suggestions:

 

It would be good if you check your geometry scaling

ecfernandez_0-1747358707277.png

 

Check the integrity of the X and Y information with wich you are feeding the Surface.ElevationAtXY nodes. Enable the previews and see that you are not getting null coordinates.

ecfernandez_1-1747358848612.png

 

Would you mind sharing your graph?

 

Regards!

Camilo Fernández

P.Eng | Transportation

EESignature

LinkedIn
Message 3 of 14

f.concepcionUE5JP
Advocate
Advocate

Thank you so much, Ecfernandez, for the graph! I truly appreciate your help. What I'm trying to achieve is to create a Dynamo script that calculates and displays the elevation difference between two surfaces, just by selecting a spot elevation label. I'm still new to Dynamo, so I'm currently researching how to make this work. My original plan was to create a custom spot elevation label that would calculate the difference directly, but I couldn't get it to work as expected — that's why I'm now trying to build the logic in Dynamo instead.

 

Message 4 of 14

fcernst
Mentor
Mentor

This capability has long been present in Surface Labels using Reference Text and a label expression. 



Fred Ernst, PE
C3D 2027
Ernst Engineering
www.ernstengineering.com
Message 5 of 14

f.concepcionUE5JP
Advocate
Advocate

Thanks for pointing that out! I really appreciate the clarification. I did try searching through the thread earlier but may have missed it — would you mind sharing the link or pointing me to the specific post if you have it handy? That would be a big help as I’m still getting familiar with these tools.

0 Likes
Message 6 of 14

ecfernandez
Mentor
Mentor

Hi @f.concepcionUE5JP, I think you can simplify your problem in this way:

 

1. Create a TIN volume surface. Doing so, will provide you with the information you are looking for, which is the elevation difference between two surfaces. Choose carefully the base and comparison surfaces. Base surface is usually the Existing Ground, and Comparison surface is any other surface, but they can be swapped as desired.

 

ecfernandez_0-1747420228805.png

To know more abut volume surfaces go to: To Create a TIN Volume Surface 

 

2. Now just use the SurfaceSpotElevationLabel.ByPoint to place regular spot elevation labels wherever you want over that TIN Volume surface, and the number you'll see will be the elevation difference between those surfaces you used to create the TIN Volume surface.

 

Create a list of points to feed the InsertionPoint input, and the TIN volume surface to feed the Surface input.

ecfernandez_1-1747420625439.png

I could not test this to make sure it works, but I hope it does.

 

I hope this helps. Best regards!

 

Camilo Fernández

P.Eng | Transportation

EESignature

LinkedIn
Message 7 of 14

ChrisRS
Mentor
Mentor
Accepted solution

I don't use Dynamo, so I can't help you.

What you want to do can be done conventionally.

 

 @fcernst and @ecfernandez are correct, but you must use their ideas together.

 

You will need a TIN Volume surface as Camilo suggests and two Label Text Reference components as Fred suggests.

 

I have attached a file, so I will not go into detail. Feel free to ask for clarification.

  • Create a TIN Volume surface, say Diff, using EG and FG.
  • Create a new Spot Elevation Label Style, say EG-FG-Diff.
    • Include a text component for the EG surface elevation, EG
    • Include a Surface Reference Text component. FG, targeting Surface Elevation.
      Format as you want the FG component to appear.
      Anchor to EG. You do not identify the target surface at this time.
    • Include a Surface Reference Text component. Diff. targeting Surface Elevation.
      Format as you want the Diff component to appear.
      Anchor to FG. You do not identify the target surface at this time.
    • I formatted the FG and Diff components in different colors for clarity, but you will probably not want that for production work. 
  • Place an EG-FG-Diff spot elevation label targeting EG.
    • The FG and Diff components will display as ???. 
      ChrisRS_3-1747448809273.png

    • Set the reference using the drop-down on the right.
      The elevation values will populate.
        ChrisRS_2-1747448748550.png

    • This spot elevation can be moved or copied. The reference targets remain.
      ChrisRS_4-1747449242406.png
    • The spot elevation labels are dynamic and will reflect any surface modifications.

 

I suspect this can be accomplished using Dynamo,
I do not see any advantage, but one may exist.

 

Good Luck!

Christopher Stevens
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 8 of 14

fcernst
Mentor
Mentor

I like this blend better for what the OP was originally asking for.. 



Fred Ernst, PE
C3D 2027
Ernst Engineering
www.ernstengineering.com
Message 9 of 14

f.concepcionUE5JP
Advocate
Advocate

Thank you for this detailed explanation and for attaching the file — I really appreciate it. What you described makes sense and seems like a solid conventional approach. I can see how combining the ideas from @fcernst and @ecfernandez provides a complete solution. I’ll study the file you shared, and if I have any questions, I’ll be sure to reach out for clarification.

Message 10 of 14

fcernst
Mentor
Mentor

If for some reason you don't need the overhead of an additional Volume surface, you can use a label expression to subtract and get the difference between the two referenced surfaces.



Fred Ernst, PE
C3D 2027
Ernst Engineering
www.ernstengineering.com
Message 11 of 14

f.concepcionUE5JP
Advocate
Advocate

Thank you for the suggestion! I actually tried using a label expression to subtract the elevations, but I keep getting a result of zero. I double-checked and realized that both values in the expression are just referencing {Surface Elevation}, so it’s using the same surface for both.

Unfortunately, in the Expressions editor, I don't see any way to specify which surface (EG or FG) each {Surface Elevation} refers to — there don’t seem to be options to assign or distinguish between the two surfaces within the expression itself. If there's a workaround for that, I’d be happy to try it!

0 Likes
Message 12 of 14

fcernst
Mentor
Mentor

Oh never mind, my bad. I was thinking back to a project where I was labeling flood depths, but I was using Ref Text with Volume surfaces..



Fred Ernst, PE
C3D 2027
Ernst Engineering
www.ernstengineering.com
Message 13 of 14

fcernst
Mentor
Mentor

I wish the Civil 3D development team would pick up the pace and integrate some basic python into expressions like ArcGIS Pro has, etc. 



Fred Ernst, PE
C3D 2027
Ernst Engineering
www.ernstengineering.com
0 Likes
Message 14 of 14

f.concepcionUE5JP
Advocate
Advocate

Totally agree! Integrating Python directly into Civil 3D expressions would open up so many possibilities for automation and customization, just like ArcGIS Pro does. It would really boost productivity and make complex tasks much easier.

0 Likes