So, I was reading The Swamp and came across a post about getting an alignment station/offset label to draw a line over to the alignment. There were a few options but I came up with my own solution and I would like to share it here with all of you.
So, This is what the user wants the labels to look like (I drew this up myself so if you think it looks sloppy, the blame lies solely on me):
You can do this with a station label and just have it add the line and then the text but, what if you need to adjust the labels so they are farther from the alignment? Or on the other side? Well, this is what you get:
(select the image to see the animation)
So, what did I do? To start off with, I used a station/offset label with a line component. In this post, I’m going to focus on the line itself and not necessarily the text. Create a new label style, delete everything (I like to start out fresh) and add in a line component. The line will attach middle center of the feature as there is nothing else to attach to at this point. The end of the line will be calculated so don’t specify an ending point.
Now, to control the length and the rotation of the line, we have to create a couple expressions. The length of the line is determined by the offset value of the label location but, the length of the line is also dependent on the drawing scale. If the scale changes, the length of the line changes. I’m going to use a technique I wrote about in an earlier blog post HERE to avoid the length of the line changing when the drawing scale changes. Basically, I’m going to take the offset value and divide it by the drawing scale factor:
We also need to create an expression for the rotation of the line. I used the Instantaneous Direction of the line. The problem with that is if I just use that for the rotation, it rotates the line the wrong direction. To overcome this, simply multiple the direction by a negative 1. Also, the line is going the wrong direction so we need to add a rotation of 180 degrees to the line so add in pi to the direction (remember it’s in radians).
Now, use these two expressions in the label style for the length of the line and it’s rotation:
Add some text components, some more line components, and perhaps a reference text component and you are good to go! Hope this helps everyone!
October 30, 2010 at 11:02 am
I wish I could get his to work. My line comes in at an angle along the tangent. What am I missing? What are the other settings that are important?
Thanks a million
Jim
October 30, 2010 at 1:06 pm
I figured out my problem. I needed to set my orientation to World Coordinate System. Also is there a way to force the 1st line of text to always be on top of the line per the View. Follow link for example
http://picasaweb.google.com/lh/photo/DUeOTLpH_s0wsfnr1yfdQYOk7hE0Ld9biqRtuPr1Vz8?feat=directlink
Thanks
Jim
October 31, 2010 at 9:11 pm
I’m glad you were able to figure it out and that you shared it with us.
As for keeping the label on top of the line, check out THIS post.
October 27, 2011 at 8:52 am
Awesome solution. However, I’m still having a problem: I want to keep the station value on top of the line and any other part of the text (whether there’s a carriage return or not) to be on the bottom. Can you elaborate on how that’s done?
October 30, 2011 at 6:50 pm
Perhaps something along these lines would work for you:
http://bit.ly/sOfYiB
November 8, 2011 at 7:52 am
Yeah, I read and tried to follow it but I’m feeling like it’s not clearly written. Can you elaborate using steps?
May 18, 2011 at 10:40 am
Is there a way to do this with the geometry points (PC & PT)? What I mean is to have the ability to drag the line and label outwards and remain perpendicular.
Thanks for your postings
Jim
November 9, 2011 at 12:54 pm
Is there a way to right an expression that tells it to add a counting routine? For example, I am labeling station offset to cogo points and would like to add a text component that increases a single numerical value at each click.
December 7, 2011 at 8:55 pm
Not that I’m aware of. This would probably need to be done by creating a custom routine via vb.net or some other programming language.
February 7, 2012 at 7:26 am
Very Cool trick, I could use this with some modifications in our const. docs.
Thanks,
February 21, 2012 at 6:10 pm
Is there a way to get the line to take a “dynamic 90” bend? So if the labels are very close together I can get a stagger effect?
February 29, 2012 at 8:21 am
Unfortunately, station offset labels don’t support staggering of labels. You could pull it off to the dragged state and manually add the breaks to the leader.
July 16, 2012 at 9:16 pm
What about adding lables for sta. and offset fo curb radii. Would you use alignment station offset fixed? I need to lableel radii and the sta. offset. Currently I add the lable then edit the label individually after listing the radii. I want to pick and have it labeled auto…
September 29, 2012 at 3:04 pm
I don’t know of any way to include the radius of a curve in a station offset label, sorry. You might be able to create a curve label that references the alignment but I’m not sure if it will get you what you want.