## Wednesday, June 09, 2010

### Label Curve Center Point

Sometimes you need to label the center of the point. It would be nice to have the solution to be dynamic. If we use a Curve Label it is possible to have a dynamic solution as the curve moves. There are some cases where the label will need to be added again, but for the most part if the alignment changes the label will update it’s location back to the Curve Center Point.

To accomplish this three expressions are needed. The first is the length from the start of the curve to the center point, also known as the radius. The radius value needs to be divided by the Drawing Scale Conversion in order to eliminate Civil 3D from adjusting the length. The second expressions checks to see if the curve goes to the right or the left and determines if the angle of rotation from the start direction, 90 or –90 degrees. The CenterTextRotation adjusts the block have the text anchored to the block to show horizontal to the bottom of the printed page.

CenterPoint:

CenterAngle:

IF({Start Direction}+{Delta Angle}>2*pi,IF({Start Direction}+{Delta Angle}-2*pi={End Direction},pi/2,-pi/2),IF({Start Direction}+{Delta Angle}<={End Direction}+0.00000001,-pi/2,pi/2))

CenterTextRotation:

IF({Start Direction}+{Delta Angle}>2*pi,IF({Start Direction}+{Delta Angle}-2*pi={End Direction},{Start Direction}+pi,{Start Direction}),IF({Start Direction}+{Delta Angle}<={End Direction}+0.00000001,{Start Direction},{Start Direction}+pi))

After creating the expression the values may be used to create a label. By adding a line with rotation of CenterAngle, Visibility to False and the length as the CenterPoint. Next add a block at the end of the hidden line and then anchor the center point text to the block. We then get a label that looks something like this:

http://screencast.com/t/OGQ1ZGUyYjQ

The drawing is done in Civil 3D 2010.

Anonymous said...

Am I missing something Chris? If you want to label the centre of a curve can't you create a label with block and/or text with the anchor point set to centre?

Christopher Fugitt said...

You are correct. I missed that feature. I thought there was too before I wrote the post, but I missed it when I checked before doing all of the math. Thanks for setting me straight.

Unknown said...

Chris, I saw the blog about the center label and my thoughts too went to expressions. I didn't know there was a center point either. I like your solution better just 'cause it has great expressions in it!