FIXING A CUSTOM LABEL WIDTH

Tagged: 

Viewing 4 reply threads
  • Author
    Posts
    • #18579
      Leah Bell
      Participant

      Hi 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:
    • #18581
      Lingwisyer GC
      Participant

      As 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

    • #18583
      James Murray
      Participant

      Labels 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

    • #18674
      Bruce Walker
      Participant
      reqNote = "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
    • #18675
      Bruce Walker
      Participant

      You need to divide by 1000 as text parameters use the Real Number type

Viewing 4 reply threads
  • The forum ‘Documentation elements, text handling’ is closed to new topics and replies.