Civil 3D Expressions and Non-Annotative Labels

Civil 3D expressions are a powerful tool you may be familiar with. They allow you to customize labels with calculated values based on information stored in Civil 3D objects. I’d like to give you a quick overview to get you started, so I’ll show you how to use an IF statement and how to make labels with a static (non-associative) text height.

An IF statement can be used to select from two choices based on a boolean criteria. It’s probably best to take a look at these screen captures to get the idea. First, to create a new expression, navigate to the label style category in question. Right-click on Expressions and click New.In the New Expression dialog box fill out the information. The Properties button, , is where you get built in properties like {Surface Elevation} to add to your expression. The function button, , is where you get your functions, like IF. The expression in the following says something along these lines:

IF({Surface Elevation}<150,-150
+ {Surface Elevation},{Surface Elevation})

“If the surface elevation is less than 150 return the negative difference between the surface and 150. If it’s 150 or more return the surface elevation.”

When you’re done with your new expression, click OK and create a new label style to utilize the expression. In this case, add the expression to the content portion of your label with the sign set to (bracket negative). Fire up your labeling tools and voila, you have your customized labels. In this case, the new label may be useful for spot elevations on a grid. You can use it to see which spots need to be raised and by how much.

As you know, Civil 3D labels are annotative. That’s cool…unless you don’t want them to automatically scale. There’s no easy way to turn that feature off if you want to plot your labels with a fixed model space text height. Luckily, you can do it with an expression.

  1. Determine your text height in model space, say 6′.
  2. Create a new expression – 6/{Drawing Scale Conversion}
  3. Finally, go into your label style and set the text height on the layout tab to the name of this new expression. Now when you go into your layout and change the viewport scale your labels will enlarge or shrink just like normal model objects.

I hope this helps you understand and get started with expressions!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *