Cut and Fill color map in Civil 3D

Cut Fill Map
The goal here is to produce a cut and fill map similar to what is shown above, where:

  • The positive and negative values are different colors
  • The positive values include a leading “+” sign
  • The negative values include a leading “-” sign

The inherit problem is that you want to place a single label and have it display the proper sign and be in the proper color. If you do not require the “+” sign, then you can do this in a different (and less complex) way. So back to our goal stated above. I have seen various ways of doing this, and this is probably a combination of a few of them as far as I can tell.

Make two Expressions

  • Go to Settings > Surface > Label Styles > Spot Elevation.
  • Right click on Expressions and Choose New.
  • Give it a name of “move if positive”
  • In the Expression field, enter IF({Surface Elevation}>0,50000,0)
  • Copy this string to the clipboard and press OK
    move_if_positive
  • Create another new Expression
  • Give it the name “move if negative”
  • Paste in the same string as above, then change the > sign to a < sign, then press OK.
    move_if_negative

Create the Spot Elevation Style

  1. Create a new Spot Elevation Style
  2. Give it the name “Cut and Fill”
  3. Set the options on the General tab as you desire
  4. Delete any and all components present on the Layout tab

Add the CUT text component

  1. Add a new text component, name it CUT
  2. Click in the “Contents” field, then click the button that appears there.
  3. You are now in the Text Component Editor”
  4. On the right side text edit portion, erase whatever is there.
  5. From the Properties Dropdown on the left, choose “Surface Elevation”.
  6. Below that, under Sign, choose “Sign Negative -“
  7. Set any other options you want such as the precision, etc.
  8. When you are done, press the Arrow to push the Field over to the edit box.
  9. Close the Text Component Editor
  10. Under “X Offset”, choose the Expression “move if positive”
  11. Under “Y Offset”, choose the Expression “move if positive”
  12. Make any other changes you want such as color, angle, etc.

cut1

Add the FILL text component

  1. Add another new Text Component, name it FILL
  2. Click in the “Contents” field, then click the button that appears there.
  3. You are now in the Text Component Editor”
  4. On the right side text edit portion, erase whatever is there.
  5. From the Properties Dropdown on the left, choose “Surface Elevation”.
  6. Below that, under Sign, choose “Hide Negative Value”
  7. Set any other options you want such as the precision, etc.
  8. When you are done, press the Arrow to push the Field over to the edit box.
  9. EXTRA STEP ! Add a “+” sign as a prefix to this data.
  10. Close the Text Component Editor.
  11. Under “X Offset”, choose the Expression “move if negative”
  12. Under “Y Offset”, choose the Expression “move if negative”
  13. Make any other changes you want such as color, angle, etc.
  14. When you are done, close the Label Style Composer.

fill1

How it works

Since we added two components to the CUT and FILL label style, they will both show up whenever you place a Spot Elevation label. This is generally not a problem because both labels will reflect the same value (the Surface Elevation), you can control the draw order of the elements _and_ you can tell the FILL labels to ignore negative values.

But when you want to see the “+” sign and the “-” sign as a prefix, things get tricky. So we need some expressions in order to manipulate some part of the label at “run time”.

Expressions are used to modify certain input data and return a value to be used in a label. The first expression above named “move if positive” evaluates the Surface Elevation and if it is negative (less than 0.0), the expression returns 0. If the Surface Elevation is positive (greater than 0.0), then the expression returns 50000.0

Recall that we set the “X offset” and “Y offset” values of the “CUT” label to the value of the expression named “move if positive” So let’s say you pick a point to label whose surface elevation is -3.5. The expression is evaluated and since it is less than 0.0, it returns 0.0 to the “X” and “Y” label coordinates and the “CUT” label is displayed exactly where you pick.

The label is not done. Remember it is going to place a FILL label also. The Fill label has the “X offset” and “Y offset” set to the expression “move if negative”. The “move if negative” expression is just the opposite of the first one. It returns 0.0 if the Surface Elevation is positive and it returns 50000.0 if the Surface Elevation is negative. The point you picked to label had an elevation of -3.5, so the expression returns 50000.0 and this becomes the “X offset” and “Y offset” for the FILL label. In other words, it is 50000.0 units away and will not show up on your plan view.

Most other methods we have read about use an Expression to modify the text height instead of the X and Y offset. Obviously, by placing another set of labels 50000 units away, a Zoom Extents will reveal a surprise for an unsuspecting user. Let us know your thoughts on this.