Label Expression Examples

Converting Northings and Eastings to Polar Coordinates

You can create expressions for point labels to convert northings and eastings to polar radius and polar angle values. These expressions compute the radius and angle from the coordinate system origin to the point.

Polar Radius Expression Syntax:

SQRT (Northing^2 + Easting ^2)

Format as Distance.

Polar Angle Expression Syntax:

ATAN2 (Northing, Easting)

Format as Angle.

Converting Astronomic Direction to Magnetic Direction

All internal angle calculations in Autodesk Civil 3D are done in radians. You can take this into account when you apply a formula to an angle, such as when you label a line with both a true direction and a magnetic direction.

To subtract a 15d 30' 15" magnetic declination from an astronomic direction to derive the magnetic direction, you can set up the following expression:

Known:

PI = 3.141592654

360 degrees = 2(pi) radians

1 radian = 57.29577951 degrees

Given:

15d 30' 15" = 15.50417 degrees

Expression Syntax:

{Segment Direction} - (15.50417*((2*pi)/360))

Or alternatively using the built-in functions as follows:

{Segment Direction} - DEG2RAD(15.50417)

Format the result as Direction.

Tower Top Elevation

You can create expressions for surface spot elevation labels to calculate the sum of the height of a structure such as an airport control tower with the ground elevation.

Tower Top Expression Syntax:

{Surface Elevation+ 228.5}

In this example, 228.5 is the height of the structure.

Depth to Pipe Invert

You can create expressions that represent the depth from the surface to the invert of pipes. These expressions are useful in Pipe Data Bands Styles and Pressure Network Data Bands Styles when labeling profile views. Each pipe has two depth to invert values. One for the start of the pipe and one for the end of the pipe. Create the two expressions for either the Plan Profile of Pipes or Pressure Pipes as follows.

Known:

Based on the pipe style, you can use the following pipe properties in the expressions.

{Start Cover}: The cover at the beginning of the pipe.

{End Cover}: The cover for the end of the pipe.

{Diameter Inside}: The diameter on the inside of the pipe.

{Thickness}: The thickness from the inside diameter to the outside diameter of the pipe.

Start Depth to Invert Expression Syntax:

{Start Cover}+{Diameter Inside}+{Thickness}

End Depth to Invert Expression Syntax:

{End Cover}+{Diameter Inside}+{Thickness}