Friday, April 29, 2011

Express Yourself

Expressions are one of those tools in Civil 3D that are greatly underutilized.  I was asked recently by a BDM to help a client who was looking for a surface label that would shorten the labels to the left of the decimal place to only show 55.1 rather than 1155.1 as seen in the screen capture below.


After thinking long and hard about the issue, I decided to use the TRUNC expression to accomplish the task.  The TRUNC variable removes anything right of the decimal place.  In order to end up with a label that only displays the ones and tens value, I determined that I would need to divide the elevations by 100, and then truncat it so the resulting value would be the thousand and hundreds place, respectively.  I finally mutilple the resulting value by 100 to give the ones and tens place a value of zero.  I finally subtract the original surface value from the new to generate my label. 

  
The expression above essentially is 1155.1 - 1100.1 = 55.1

  
Here is the resulting label created from the expression.  Expressions allow us the ability to create labels that currently don't exist within the software.

No comments:

Post a Comment