### December 2012

So a little while ago, someone in the discussion group asked how to go about dropping the zeros at the end of a label. For example, if a value was 100.1111, they wanted to see 100.111. If the value was 100.0001, they wanted to see 100. Apply this to the entire range and you get an idea of what was wanted;

One Label Style, Different Precisions

In the image above, you can see the total length of the line in the component on the bottom and the component on the top is displaying with different precision based on the value of the label.

NOTE: The method I came up for solving this issue only works if the values can never be negative. If the values you are labeling can be negative (such as a surface elevation) this technique won’t work

## Setting Up the Style

What you’ll need: 1 component for each precision you’ll want in the label and one expression for each of those. I’ll start this off by creating the component if the label rounds to the nearest ones place.

The expression basically does this: It checks to see if the number is the same when rounded to the nearest one and when it’s rounded to the nearest one thousandth. If they are the same, return the value. If they are different, return -1 (negative one). The expression will look like this (for a line label):
IF(ROUND({General Segment Length})=ROUND({General Segment Length}*1000)/1000,{General Segment Length},-1)

Expression for Display to the Ones Place

I called this expression “ones”.

Now use this expression within a label component. Instead of using the length of the line in the label, use this expression. The trick here is to change the precision to the ones place and then set the “Sign” value to “hide negative value”. That’s what the -1 is used for. If the test in the expression is false, then don’t display anything, if it’s true, display the value at a precision of 1.

Label Component Used to Display the Ones Place

Repeat the expression/component process for the rest of the precisions you want to use in the label (tip: just copy the “ones” component for the rest of them). For the tenths place, add an additional IF statement to the expression. If the “ones” expression is greater then or equal to zero, then return -1, otherwise, test for the next precision. This expression looks like this:
IF(ones>=0,-1,IF(ROUND({General Segment Length}*10)/10=ROUND({General Segment Length}*1000)/1000,{General Segment Length},-1))

Expression for Display to the Tens Place

The expression for the hundredths place is very similar but with an extra IF statement to check both the “ones” and “tenths” expressions.

Finally, you’ll need one last expression for everything else. This one is really simple, basically, if “ones” is greater then 0 or if “tens” is greater then 0 or if “hundreds” is greater then 0 then return -1. Otherwise, return the value.

IF(ones>=0,-1,IF(tens>=0,-1,IF(hundreds>=0,-1,{General Segment Length})))

Expression for Display to the Thousands Place

## Wrap Up

Once you have the expressions created and added to your label, it works like a charm. HERE is a quick little video I made showing the expression at work. I took a line and labeled it and then changed the length of the line using the dynamic input.

Additionally, if you would like a copy of the file that I showed in the video, you can download it HERE.

Have fun playing with your new label knowledge!

Civil 3D uses a Triangulated Irregular Network (TIN)  for surface models, just like every other piece of civil engineering software that I’m aware of. There a  couple of major limitation to a TIN that you should be aware of. First, every single horizontal location (i.e. every x,y coordinate) can have only one elevation. This means no vertical faces and no overhangs or undercuts. The other limitation is since it’s made up of a bunch of triangles, you can’t have curves in your surface. If you have curved data that you want to add to your surface, you must approximate this with straight line segments, and this is where the mid-ordinate distance comes into play.

## What the Mid Ordinate Distance Is

When you add data to your surface, one of the options is the mid-ordinate distance. What the heck is the mid-ordinate distance? Well, it’s the distance from the midpoint of a curve to the midpoint of the arc.

Mid Ordinate Distance

When you add something like a curve to your surface as a breakline, boundary, or contour; the surface cannot follow the curve so it uses the Mid Ordinate Distance to approximate the curve. Basically what happens is C3D will start at the end of the curve and draw a line to another point on the curve so the mid ordinate distance between those two points on the curve equal what is set in the dialog box.

Mid Ordinate Calculated

As you can see in the image, there is a little bit left over at the end, when you add this to a surface, you don’t want that little bit left over so Civil 3D then evenly distributes the number of points added to the feature along it. This will result in a final Mid Ordinate Distance slightly less then what was calculated.

Mid Ordinates Distributed Along Curve

So, instead of adding just the ends of the curve to the surface, the Mid Ordinate Distance allows us to determine how many points along the curve we want to add.

## What Should You Set It To?

Now that you know what it is, what should it be set to? In the default template, it’s value is set to 1 drawing unit (1′ in the imperial template and 1m in the metric template). Is this value too big? Too small? Or just right? Let’s think of this in a different way. Don’t think of it in the abstract Mid Ordinate Distance way, think of it instead as “How far away from my data should I allow my surface to be created?” If you set the Mid Ordinate Distance to 1′, then the triangle of your surface can be up to 1′ away from the actual data. It’s your call, is this acceptable or not?

Here’s how I like to figure out an acceptable Mid Ordinate Distance. What is the smallest distance between any two breaklines you’ll have in your surface? Are you modeling a haul road for a mine? Or are you modeling curb and gutter for a commercial parking lot? In my experience (primarily land development) I use a lot of curb and gutter. When I model the flow line and the top face of curb in a standard curb and gutter, that’s a horizontal distance of 2″. Take that smallest distance and cut it in half to get your desired Mid Ordinate Distance, in this case 1″. Since 1″ is about 0.08333 I will typically us 0.1′.

## Can I Change the Default?

Well, of course you can! Ok, let me rephrase that, if you are using Civil 3D 2010 or later you can. On your toolspace, go to the Settings tab and expand out Surface and Commands:

Command Settings Location

As shown in the image, there are three commands (at least that I know of) that can have the Mid Ordinate Distance set, AddSurfaceBoundaries, AddSurfaceBreaklines, and AddSurfaceContours. Right click on the command you want to change and choose Edit Command Settings. In the command settings, expand out “Add data options” and change the “Default mid-ordinate distance” setting.

Mid Ordinate Distance Defaults

Hopefully this will help you understand what’s going on with this setting and, have a Merry Christmas!