The Issue:
During a recent template creation, a client wanted perpendicular, Station/Offset labels for the Left and Right side of an Alignment that would automatically flip, as the default would only maintain its original reference rotation.
The Goal:
Instead of duplicate labels for ALL the label options we wanted to create something smart enough to know what side of the Alignment the label was at and automatically flip/rotate.
The Technique:
A few things went into the making of this dynamic label as there is no default embedded function within the label, we had to approach the solution via an Expression. Initially I attempted to use the “Side” property, but it did not work as expected.
The solutions were achieved with an expression, called “Side”: DEG2RAD(IF(Offset<0,0,180))
- Use the “Offset” value, negative or positive to determine left (-) or right (+) side,
- Embedded with an “If” statement that will issue a 180 flip when greater than (<) Zero Value
- And because the way Civil 3D calculates angles, I added a DEG2RAD function.
We then also wanted to add a gap (0.01) to space the Label from the Marker and built another expression based upon the same idea as above, called “Ofst”: IF(Offset<0,0.01,-.01)
The Expressions can be seen below from the Toolspace > Settings tab > Alignments > Labels > Station and Offset
The label style itself used the “Side” expression for its Rotation Angle and the “Ofst” expression for the Y offset value
I hope you guys have fun with this simple and awesome way to create smart Alignment Offset Labels and this serves as a reminder of what Expressions can do for you.
About the Author
Follow on Linkedin More Content by Kevin Stacy