cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Variable Label Line Length

Variable Label Line Length

Standard Practice here is to underline the first line of a text callout. We can't always predict the length of that line, nor how many lines of text will be included in the label, nor which one will be longest. Having a line able to look at the longest text line would be really helpful, or at least having it graphically adjustable would be helpful.

18 Comments
troma
Mentor

Have you tried using the underline format?

 

Underline label text.PNG

doni49
Mentor

And since sometimes it's nice to have control over the line (what color, how far from the text etc):

 

C3D_LabelWithLine.png

 

 

sample dwg file

ChrisRS
Mentor

You can do this now by adding a line component to your label style.

 

If you want the underline to be the width of the longest line:

     Start point anchor component:   <name of text component>

     Start point anchor point:            Top Left

     Use End Point Anchor:                Yes 

     End Point Anchor Component:   <name of text component>

     End Point Anchor Point:             Top Right

     Start Pint Y Offset:                      A negative value = approximately text height x -1.66

     End Pint Y Offset:                       A negative value = approximately text height x -1.66

The line will be slightly longer that the text. If you do not want this, set the gap value of the text component to 0.00

(The text component gap value allows a border box to be drawn.)

 

If you want the underline to be the width of the first line you need t text components.

     First line text component should be formatted as underline

     Anchor top of second component to bottom of first text component
          (Top Left to Bottom Left for left aligned, Top Center to Bottom Center for centered, etc.)

 

    I you want more control of the underline, add a line component instead of underlining the first line.

          Start point anchor component:    <name of text component>

          Start point anchor point:              Bottom Left

          Use End Point Anchor:                  Yes

          End Point Anchor Component:     <name of text component>

          End Point Anchor Point:                Bottom Right

 

 

 

The line will be slightly longer that the text. If you do not want this, set the gap value of the text component to 0.00
(The text component gap value allows a border box to be drawn.)

baileysan
Enthusiast

ChrisRS, my issue is that sometimes the longest text component is unknown, so I'm wanting the line length to search for all text components and lengthen as needed, much like a multileader operates.

troma
Mentor

@baileysan it is often possible (not always) to combine all text components into one component. Will that work for you?

ChrisRS
Mentor

@baileysan, if you can limit your label to one text component as @troma suggests, the following works.

 

Add a line component. Anchor it to the top left and top right of the text component, then shift it downward.

 

     Start point anchor component:   <name of text component>

     Start point anchor point:            Top Left

     Use End Point Anchor:                Yes 

     End Point Anchor Component:   <name of text component>

     End Point Anchor Point:             Top Right

     Start Pint Y Offset:                      A negative value = approximately text height + 2(gap)

     End Pint Y Offset:                       A negative value = approximately text height + 2 (gap)

 

Here is a drawing with a couple styles based on this idea:

 

Underline Label Example.dwg

 

If you have 2 or more text components, you would need a workaround. Each text component would need a line anchored to it and shifted into position. You would be stacking multiple lines on top of each other so it looked like the underline was based on the longest line. If you want to provide some examples of what you are doing, I can try to give you some guidance.  

 

Good luck

 

Underline Label example.PNG

baileysan
Enthusiast

@ChrisRS That is a great workaround. Perhaps one day it'll become unnecessary, but I like that appraoch in the meantime.

troma
Mentor

I like the multiple lines workaround!

ChrisRS
Mentor

@baileysan and @troma, Thank you!

 

If you come up with a style using the work around, I like to see it.

 

DJGinAZ
Advocate

@ChrisRS This is a common scenario for us. Almost all of our styles are built to underline the first line of text. Many styles have 2, 3 or 4 separate text components in them (station, offset, elevation, text, etc.) and we don't always know which line will be the longest. Here is a basic example of when that causes a problem:

 

Civil Frustrations.JPG

 

In these instances, the label is either exploded (with a small polyline added and grouped) or the plus sign is used to add a vertex in the leader to extend the label. Both of which are frustrating when trying to move the label.

We could build a style with the line referencing the Top Text and one style referencing the Bottom Text for scenarios like the Alley ##, however, because of the underlined first line, we have to have left and right styles for almost every label. SO.... that would me an having four different styles just for this station equation.  

 

If you have any suggestions I'm all ears....

ChrisRS
Mentor

@DJGinAZ, I think this is what you want.

 

Link: Underline Label Multiline

 

There is a Right Leader version, but I prefer the Left leader version with the leader vertex snapped tot eh right end of the underline. This stays connected if you move the label, but needs to be reconnected if the label contents change causing the underline to change.

 

I used color and draw over so you can see the 4 underlines. You will want to use one color, probably "Bylayer"

 

Of Note:

Text height is 0.06, gay is 0.02, resulting in a line spacing of 0.10. You will need to adjust if you change text height.

Left Bottom of "Text" is anchored to feature.

Top left of "Text 2", "Text 3" and "Text 4" are all anchored to bottom left of "Text"

"Text 3" and "Text 4" have Y offset of -0.1 and -0.3 respectively.

"Line 1" start and end are bottom left and bottom right of "Text" (pretty obvious)

"Line 2" start and end are top left and top right of "Text 2" (also pretty obvious)
"Line 3" start is top left of "Text 2" and top right of "Text 3". End Y offset is 0.10
"Line 4" start is top left of "Text 2" and top right of "Text 4". End Y offset is 0.20

 

 

Underline Label Multi Text Component.PNG

ChrisRS
Mentor

I posted a reply.

Christopher R. Stevens

DJGinAZ
Advocate

Interesting work around. I like it. For Text 2,3, and 4, are you anchoring them to the feature with a Y offset OR to the text above it?

 

I believe the only practical option is the "Leader Left" setup you created because our text is traditionally left justified. I'll explore it more using that solution and see if I run into any other problems.

 

Thanks Chris.

ChrisRS
Mentor

@DJGinAZ,

The Bottom Left of the first Line, "Text" is anchored to the feature.

 

Top Left of "Text 2", "Text 3" and "Text 4" are anchored to Bottom Left of "Text"

(In this case,I suppose you could anchor them to the feature since that is where the bottom left of Text is. In general though, I think it is more clear that the anchor is to "Text")


"Text 3" is Y offset -0.10, one line downward from "Text 2".
"Text 4" is Y offset -0.20, two lines downward from "Text 2"

 

Were you able to get the download link to work? I have difficulty adding and attachment.

 

Pleas let us know how it goes.

DJGinAZ
Advocate

The link worked but it wasn't interactive. It was pretty much just the Image...

ChrisRS
Mentor

There may be a drawing file and image file attached to this massage.



Can anyone tell me how to attach files to comments?



Christopher R. Stevens

jchu6XXGH
Enthusiast

Can you re-upload

 

Link: Underline Label Multiline

 

that one?

thx

ChrisRS
Mentor

I still have the file(s) and am willing to share, @jchu6XXGH.

I do not know how to link or upload in Ideas or PMs.

If you PM me your email address, I will forward the files to you.

 

Chris Stevens

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea