Using Text to auto resize box

Hi All,
first off i would just like to thank anyone in advance who responds to this question
Now…

Question: I am importing text from a csv file to automatically populate the text I need. now the text needs to be in a box that is 10mm height but I need the length to be extended depending on the length of the text as some is a longer word than others. the purpose of the box is so I can cut out the word from a sheet of thin plastic.

Is there any way to extend the with of the box automatically based on the length of the text?

any suggestions are greatly appreciated!
Thanks

here is a picture of what I mean if it helps

image

I want the smaller words like “GAUGES” to have a smaller box and the longer words that are out of the box to have an extended box.

I know already did that once but I can’t remember how. :thinking:
I think there is a tool for that.

But I think you can always draw a new box around the text… :wink:

Haha Yes, I could always just draw another box. Thats Just a small snippet there are a lot more. I was just wondering if there is a Tool for future reasons.

But thankyou I will have a deeper look and see if I can find that tool.

Why not “freeze” the boxes and not the text until they shrink to text dimensions.
I had to make an HVAC joke, sorry. :laughing:
“GAUGES”, “TESTO REF FITTINGS”, “TESTO PROBS”, etc,… yeah, I’m familiar with that too.

There is no tool to size the box to the size of variable text. But, there is an option to resize the variable text to the size of the box. If you select your variable, and go to the shape properties tab, you can set the Max Width for the text, and possibly use the “Squeeze” toggle

Thankyou for that suggestion. This isnt exactly what i wanted but i think it will have to do for the moment.
Thanks

1 Like

@Kuth hahaha i will take that into consideration
laughing

I think I already know how I did it but it was one by one. Basically, one by one, I centered (vertically and horizontally) the text in the box using that crosshair-like tool.
Then I selected the coordinate reference point at the center (center point of the set of nine points) 0:30 to 1:20 of the video:

After defining this point, I selected the text inside the box to see the Height and Width of the text in the dimensions fields.
Then (with the lock symbol unlocked) I selected the rectangle around the text and gave it the measurements of the text plus the margin I wanted. As the coordinate reference point is selected in the center, the rectangle will “shrink or stretch” to both sides and keep the text centered in the box.
It’s still a “one by one” solution, but it seems more efficient than drawing new boxes around the text for example.

1 Like

Good idea with the numeric edits @Kuth . :slight_smile:

If you were making a lot of these it is also possible to have a program like python read text from a .csv and create an .svg file with the text enclosed within dynamically fitting rectangles. e.g. what you see below was done with a script, with a slight vertical (‘VSpace’) manual adjustment to the text once imported. In this script (which I had an AI tool generate) the length of the text is based on a guess at the average character size, so if you had a lot of narrow characters e.g. “i,t,l” there would be bigger gaps at the sides.

1 Like

Thanks.
If the features exist, they are meant to be used. :wink:

1 Like

Hi again,
sorry for being inactive for so long, i was having trouble with my email accounts and couldn’t sign into anything.

thankyou for the replys while i have been absent.
@NicholasL thankyou that is a good idea ill give that a try.
@Kuth i will have a look at what you mean in the video asap as soon as i get time.

thanks again for all the replys everyone it has been very helpful.

1 Like