In this exercise, you will create an expression that calculates the magnetic compass direction of an alignment at each geometry point.
Expressions make use of the same properties that you can add to label styles, such as Point Elevation, Northing, and Easting. By using expressions, you can set up separate mathematical formulas, using the existing properties. For example, you could subtract a value from a point elevation, and display that number along side the actual elevation in a point label.
Create an expression
This exercise uses Labels-5c.dwg with the modifications you made in the previous exercise, or you can open Labels-6a.dwg from the tutorials drawings folder.
This label style displays geometry points, design speed, and true compass direction at the geometry point. In the next few steps, you will create an expression to calculate the magnetic direction. You will add this expression to the geometry point label in Exercise 2: Inserting an Expression Into a Label Style.
This property will be used as the basis for computing the magnetic direction.
Use the button to enter pi.
The completed equation looks like this:
{Instantaneous Direction}-(15.5*(2*pi/360))
The expression includes a conversion from degrees to radians because Autodesk Civil 3D uses radians for all internal angle calculations. The value used for declination of magnetic North (-15.5 degrees) is just an example. To be accurate, this must match the current value, subject to geographical location and gradual changes over time.
In Toolspace, on the Settings tab, appears next to the Expressions node, and the new expression appears in the list view.
To continue this tutorial, go to Exercise 2: Inserting an Expression Into a Label Style.