Civil 3D Contour Labels: Auto Decimal Place

For a long time, with Autodesk Civil 3D I have wanted a smart contour label that drops decimal values.  Something like what is available for Stations, a modifier that could “Drop Decimal Value for Whole”, but none are available by default.

1_Contours

Next, I then turned to Equations and was not able to come up with something simple.  I then found an old post for Crest and Sag Profile Labels, from a colleague James Mussleman.  In the post, equations are leveraged to controls text height.  Below we create a contour label based on the same idea:

  1. First, we will do “Math” to check for the whole number.

2_Contours

  1. Next, an “If” statement is created that will show/hide the right of the decimal. To be used as 2nd Text Height value.

3_Contours

  1. Last, a two-component text label is created:
    • The primary text will always be shown (“Elev-Lt”) with the whole value left of the decimal.
    • 4_Contours
    • The secondary portion of text (“Elev-Rt”) will autohide decimals based on the “If” statement used as height for values right of decimals.
    • 5_Contours

This setup will be useful for situations when contours are set less than whole values or when Surface analysis creates user-defined contours.

6_Contours

7_Contours

 

About the Author

Leo Lavayen

Civil Applications Expert<br><br>As an Applications Expert, Leo is responsible for supporting, training and implementation of software for survey and civil engineering professionals. He has more than 17 years of experience helping large and small, public and private clients in the eastern United States.

More Content by Leo Lavayen
Previous Article
Inventor 2019 Frame Generator Enhancements
Inventor 2019 Frame Generator Enhancements

In Inventor 2019.1, the Frame Generator tool was enhanced in its looks and interface usability. The basic w...

Next Article
Autodesk Civil Engineering Data Translator
Autodesk Civil Engineering Data Translator

This cloud-based extension now runs outside of Civil 3D. You can find it in the Autodesk folder of your st...

Need tech support? Let us help!

Learn More