Chriss Fugitt - Making an Impression with Expressions

advertisement

Making an Impression with Expressions

Introduction

Civil 3D has numerous options when creating labels, sometimes the default options come up short in getting the appearance or the required information included in the label. Other than wishing the item was in the program we can use expressions to create the look and content needed. Expressions provide flexibility, controllability and extend the benefits of using Civil 3D.

Creating Expressions

Creating expressions is rather simple. You go into Civil 3D’s Toolspace, Setting Tab and go to the Civil 3D label type you want to create an expression for, right clicking the

Expressions icon.

Insert Chris Fugitt Image01.png (Caption: Starting an New

Expression)

Once a new expression is created the New Expression dialog pops up as shown in Figure

01. The first, and probably hardest, decision in expression process is providing a name.

This is because once you name the expression you can’t revise the name once the dialog box is closed. When naming the expression try to use something succinct and easy to understand what the expression does. Utilize the description to provide a more verbose explanation on the purpose of the expression. Thankfully the description and expression formula may be changed after the expression has been created.

Insert Chris Fugitt Image02.png (Caption: New Expression dialog with expression tools identified)

In building the expression various tools are available and they are identified in Figure 2.

The most basic is the numbers on the left side of the New Expression Dialog Box. An expression may be as simple as using a numerical value. Moving to the right of the number pad are the logical operators. When used logical operators return numerical values of 1 for true and 0 for false. Further to the right are the Insert Property and Insert

Function buttons.

The Insert Property inserts information from the Civil 3D object. The properties available depend on which Civil 3D object the expression is created from. The Insert Function provides mathematical functions, including, but not limited to, geometric functions, returning the absolute of a number or the ability to use an If/Then evaluation. At the bottom of the screen is the Format result as: drop down. The format chosen determines what options are provided when adding the expression to a text component. In the New

Expression Dialog Box provided in this article the result is formatted as a Double. A

Double is a special numerical value format capable of displaying accuracy to 16 decimal

points. If the expression is planned to be used in a text component it is important that the correct result is chosen to make utilizing the result easier. Additional, or incorrect, options may be provided that will give incorrect results in the label.

Uses

Modifying the location of label components is a good example for using an expression.

For instance in a station Offset label it may be desirable for a label line to be directed away from an alignment, as shown in Figure 3.

Insert Chris Fugitt Image03.png (Caption: Same Label but different appearance)

If expressions were not used two different labels would be required, one for the left side and one for the right side. The expression used is the OffsetRotaton expression in the

New Expression Dialog Box above.

Expressions may also be used to hide label components. Some Civil 3D users prefer not to see the ending major station because it typically ends at an uneven number. An expression may be used to hide the last label. To do this the expression will utilize an

If/Then statement to check to see if the station value matches the alignment ending station. If it does the expression will return a small value, 0.00001, if it is not it will return the value of the text height. For meter drawings the text height is the actual value, for feet drawings the text height is the height desired divided by 12, in order to convert the text height from feet to inches. The expression used and the graphical difference is apparent in Figure 04.

Insert Chris Fugitt Image04.png (Caption: Major Station End values using an Expression to alter the displayed value)

In addition expressions may be used to derive information from properties of Civil 3D objects. One useful application of this is getting flow rate, Q, and the flow velocity, V, utilizing the Manning’s equation. The expression for Q for feet drawings is below:

Publisher note: please use special format for the following code snippet

1.486*pi*((({Start Crown Elevation}-{Start Invert Elevation})/2)^2)*(1/{Manning Coefficient})*((({Start

Crown Elevation}-{Start Invert Elevation})/4)^(2/3))*(SQRT({Pipe Slope}))

Once we have the Q expression created, the expression may be used in other expressions, such as calculating the flow velocity, V.

Publisher note: please use special format for the following code snippet

Q/(pi*({Inner Pipe Diameter}/2)^2)

Another example of deriving information from properties of Civil 3D objects is calculating the Sight Distance of a profile vertical curve. There are two cases that need to be examined when calculating the Sight Distance, S. The first case when S is greater than the Curve Length, L, and the other is when S is less than L. The expressions to calculate the two cases are below.

Publisher note: please use special format for the following code snippet

S>L Expression: ({Profile Curve Length}+(2158/(({Grade In}-{Grade Out})*100)))/2

S<L Expression: SQRT(({Profile Curve Length}*2158)/(({Grade In}-{Grade Out})*100))

This example, as shown in Figure 05, is based on the State of California Highway Design

Standards; some states utilize a different formula. Once added to a vertical curve label it is easy to see the Sight Distance provided by the vertical curve.

Insert Chris Fugitt Image05.png (Caption: California Highway

Design Standard format to show Sight Distance)

Conclusion

Utilizing expressions within Civil 3D allows the user to extend the capabilities of the program. From controlling how label components are located to getting additional information from the labels. Expressions will help you make a good impression with your plans.

Download