Home › Forums › Problems and solutions in GDL › Documentation elements, text handling › FIXING A CUSTOM LABEL WIDTH
Tagged: tags labels
- This topic has 4 replies, 4 voices, and was last updated 11 months ago by
Bruce Walker.
-
AuthorPosts
-
-
February 23, 2020 at 22:59 #18579
Leah Bell
ParticipantHi there!
I am trying to make a wall tag that takes the of an object element ID from a wall and looks like a text box with an arrow right next to it. I made a text box with a background fill and outline and drew in the arrow at the size I want it to be at. I deselected ‘Wrap text’ in the text properties. I saved the arrowhead and the text box as a label. When I insert the label however, the text box comes out the same width as the original text box, rather than being the width of the text in the Element ID, which is what I would prefer (see attached image). Also, I would like the label to be inserted at the point of the arrowhead, however it is inserting at the top left corner.
Can anyone instruct me on how to fix these issues?
Thank you kindly!!
Attachments:
-
February 24, 2020 at 03:59 #18581
Lingwisyer GC
ParticipantAs far as I know, there is no way to retrieve the text length when using [i]Autotext[/i] values. If you go into the code and change it to [i]Requests[/i] you will then be able to do a follow up request for the length which can then be plugged into the textbox size.
Ling.
AC18-23 AUS 4006
Self-taught, bend it till it breaks.
Win7 | E5620 x 2 | 24GB | K2200 -
February 24, 2020 at 15:19 #18583
James Murray
ParticipantLabels saved via save as label are very inflexible. What you are trying to do requires a coded label. The box will have the length of the ID string, which can be gotten using STW. The height will come from the Height_of_style REQUEST.
James M
-
April 2, 2020 at 01:20 #18674
Bruce Walker
ParticipantreqNote = "Your Text Here" DEFINE STYLE 'txtStyle' LABEL_FONT_NAME, LABEL_TEXT_SIZE, 5, 0 STYLE 'txtStyle' ! Get the Height and Width of the displayed Text, convert it to model size r = request("Height_of_style", "txtStyle", _heightOfText_mm) _height = _heightOfText_mm * GLOB_SCALE / 1000 _width = STW(reqNote) / 1000 * GLOB_SCALE
-
April 2, 2020 at 01:21 #18675
Bruce Walker
ParticipantYou need to divide by 1000 as text parameters use the Real Number type
-
-
AuthorPosts
- The forum ‘Documentation elements, text handling’ is closed to new topics and replies.