Here is the expression: IF({Surface Elevation}/2=TRUNC({Surface Elevation})/2), {Surface Elevation}, -1)
The expression starts of with the IF command, which tells the expression to check for given output. The surface elevation/2 is telling the interval at which we want our contours to be displayed. In this example, we want to label every other contour, but this could be set to /3, which would check for every third contour, etc. By using the TRUNC command, we are checking to see if the contour is divide by 2 evenly. For example, a surface elevation of 102 would generate a value of 51 and a truncated value of 51, where as a surface elevation of 101 would generate a value of 50.5 and a truncated value of 50. In the example, the surface elevation 102 would be labeled, while 101 would not. This portion is taken care of by the last part of the expression which is {Surface Elevation}, -1. If the statement is true, then it uses the surface elevation, if not it generates a -1 value for a false statement.
The reason we are having the statement generate a negative value is that the label style composer, as seen above, the Sign option allows us to hide negative values. Note, in my expression, I'm having a false statement generate a value of -1, but in theory, it could be any number as long as it is negative. This is ultimately how we can have Civil 3D label contours at a given interval.
Here is what your new label should look like. Why spend anymore time then needed to quickly label your contours.
No comments:
Post a Comment