Recently on one of the discussion groups, someone asked if they could put a box around a structure label in a profile view. The problem with this is that you can’t simply toggle on the display of the border because the label is composed of several components and would look something like this:

Labels with frames turned on

As you can see, it’s not quite what I would like to see. The problem with this is that you can’t create the entire label within one text component. Since the inflow and outflow labels are displayed in a “Text for Each” component. What I would much rather see is something like this:

Labels the way they should be

Now, the primary problem with this is that there’s nothing to simply create a box around. So, what I did was to create the four lines manually. The first line (#1) attaches from the top right of the structure name to the bottom right of the invert out text. Lines #2 and #3 attach to the beginning and end of line #1 respectively and line #4 attach to the ends of lines #2 and #3. The trick here is, how long do lines 2 and 3 need to be? I can’t simply attach them to another point on the labels because the text they attach to are different lengths. Here is what I did, I created a very simple expression the determines the length of the lines. What is in the express? That’s what makes it so simple, it’s just the plotted length of the line. If I need to stretch the frame a bit, I just change the value of the expression and then do a regen.

Here’s the label style showing the lines as well as the expression. Again, to change length of the box around the label, simply change the value in the expression.

Label Style and Expression

One of the limitations of this technique is that all of the boxes in the labels are all the same length. If you need to have the boxes to have different lengths, then you would have to create new expressions and new label styles.

It’s not the best workaround I’ve ever come up with but it does work. Hopefully someone who reads this will offer up a better solution.

About these ads