Expressions And X – Y Offsets in Labels

One of the local agencies we have to submit to typically wants the invert label labeled at the intersection between the pipe and manhole wall, similar to the picture to the right. See the rest of the post for a quick and easy way to add a pipe label to go to the correct location.

In 2007 we created the label with expressions to get the invert elevation correct and dragged the label over to the proper location. In 2008 we are able to add the label to the pipe and with expressions in the X – Y offset to get the label to the correct location.

To get a label to look like the one to the above create two expressions, I will call them Xoffset and Yoffset. The original position of the label is at the middle center of the pipe. The Xoffset will be:

(({2D Length – Center to Center}*0.5)-2)/(12*40)

The 12 is to convert the feet to inches and the 40 is to adjust the value to match the viewport scale, in this case it is 1″=40′.

To set the Yoffset we will use an expression to follow the slope of the pipe and then subtract the corresponding Y value. In this case the expression will be:

(-({Inner Pipe Diameter}/2)+((({2D Length – Center to Center}-4)/2)*ABS({Pipe Slope})))/(4*12)

Note the 40 has been changed to 4, since my profile view vertical exaggerates by 10. So if James needed to use this label on a sewer job in Dallas it would be 3.333.

Add the Xvalue and Yvalue to the label and you should be ready to go. For the other end of the pipe some of the signs need to be changed to get the label to show correctly. While you may not have this situation on your sewer plans it may be helpful to use on other labels.

1. Michael Putnam says:

Chris,

I am trying to make a structure lable style that reflects our current company standards. I am trying to write and offset expression so that one label will label the structure name station and rim attached to one line (rotated 90 attached to the top of the structure) and I.E. In and I.E Out attached to a line (rotated 270 attached to the bottom of the structure). I have posted this question on Autodesk discussion Groups and I have not figured out how to do this. I need to be able to write and expression for the y-offset of the second line so that it attaches to the bottom of the structure in profile (profile exageration 10 and scale 20).

Mike

2. Here’s a sample. Just change the 4 in the expression to match your requirements. It’s the one with today’s date.