Expressions have got to be one of the coolest things in all of Civil 3D. I was teaching a styles class a couple weeks ago and when we got to expressions, one of my students asked if we could use expressions to label the length of a vertical curve, but just the length of the part of the curve that was within the profile view. I got to thinking about it and this post will show you the results of what we did.
First of all, a little bit of information is needed. There are a couple properties of vertical curves that we will be using for this label, specifically the start and end station value of the curve. What we need to do is check to see if the beginning of the curve (and likewise the end of the curve) lies within the profile view. To do this, we create an expression that will check this. If the beginning of the curve lies within the view, then the expression will return a value of 0. If it doesn’t, it will return a value of the distance from the start of the curve to the start of the profile view. Likewise, we will check the end of the curve to see if it’s in the profile view. If it is, return a value of 0, if not, return the distance from the end of the curve to the end of the profile view.
We then create a third expression that will take the total curve length and subtract off these two values. If both ends of the curve are within the profile view, then we simply get the length of the curve. This expression is the one that will be placed in the curve label instead of the total length of the curve.
Now that we have the expression created, simply add it to your label.
Once you have added the expression to your label, here’s an example of what it can do. As you can see, the “LVC” is the overall length of the curve and the “LVC in view” is the length of the curve within just the view.
If anyone would like to see this label in use, you can download a drawing HERE with the expression being used. Leave a comment here, I would love to hear what you think about this.