I found many posts over the years about this subject but I am not having any luck with a solution.
I have a drawing that has forty some instances of mtext with wipeouts on. We decided to reduce the scale by half increasing the number of drawings by two. In doing so, the width of all instances of MText that have a wipeout are twice as wide as necessary. Can someone direct me to a lsp that will reduce the width of the MText box or wipeout to the actual length of the text string for multiple MText?
Thank you
Solved! Go to Solution.
Solved by ChicagoLooper. Go to Solution.
Solved by ChicagoLooper. Go to Solution.
If you are using text mask on your mtext and the mask is too wide (see image-1), you can make the mask width the appropriate size.
Select the all the mtext or a large amount of mtext. Then with the mtext selected go to Properties Palette and change 'Paper defined Width' from *VARIES* to 0 (zero). See image-2. After you've made it 0, the mask will 'shrink' to fit the width of your mtext.
Chicagolooper
If you are really using wipeouts, they would be separate entities from the text.
Do you mean "background mask"?
If so, @ChicagoLooper has a solution that will work.
Thanks for the reply RobDraw.
I apologize, I did mean text mask or background mask rather than wipeouts.
ChicagoLooper's suggestion does work but I'd really like to figure out how to get the mtext box the exact width of the text.
Thanks
The exact width based on what?
@ChicagoLooper's solution is as good as good as it gets. It's dynamic and won't require changing an assigned width when edits happen.
When mtext is created, if your mtext editor settings are set to display the ruler, the user can click on the diamond at the end of the ruler and drag it left or right to adjust the width of the mtext box.
If the user double clicks on the diamond, the width of the mtext box is reduced to the smallest width required to contain the text. In other words, "the exact width of the text".
In my original post, I suggested a scenario where the scale of a plan drawing was reduced by half with many instances of mtext with background masks. When reducing the height of all the mtext to match the scale, the width of the mtext box becomes twice as long as necessary which isn't normally an issue but in this case it is because of the background masks. Yes, grabbing all instances of mtext and adjusting its width to 0 is a viable solution. For some unknown reason, there are times when the Defined Width property is grayed out and the user isn't able to adjust it to 0. Does that help pendean?
I am looking for a lisp routine that adjusts the width of multiple mtext objects to match the exact width of the text string rather than manually edit each individual instance of mtext by double clicking on the diamond on the ruler.
Thank you all for posting replies.
@demus72 wrote:Yes, grabbing all instances of mtext and adjusting its width to 0 is a viable solution. For some unknown reason, there are times when the Defined Width property is grayed out and the user isn't able to adjust it to 0.
When columns are activated, the assigned width property cannot be edited.
@demus72 wrote:I am looking for a lisp routine that adjusts the width of multiple mtext objects to match the exact width of the text string rather than manually edit each individual instance of mtext by double clicking on the diamond on the ruler.
This request is better suited in the Customization and LISP forum.
To optimize the size of your text mask so the mask doesn’t have ‘extra space’, you’ll need to properly define the area where you want to place your text. This involves clicking-and-dragging a text box at the beginning of the mtext command. For middle center justified mtext, drag out a box that’s too wide and you’ll have extra space on both sides or drag a box too tall and you’ll have too much space above and below.
We don’t want to waste valuable time calculating the ideal box size, we have better things to do like watch Youtube and scratch itches in nsfw bodily places that some countries consider jailable offenses..
To make text mask 'hug' your mtext, there are two things you can do. Unfortunately, neither of them is good for existing mtext, e.g. when you change the drawing scale and the annotative text size gets smaller—they’re more suitable for new individual mtext, especially during the initial mtext creation. If you have a lot of existing mtext, then you can't use either of these options and will have to resort to the method described in post #2 of this thread.
The image below illustrates mtext using the two options above for middle centered justification. When width=0, you have a center grip. The mask will hug your mtext. If you have a second and third line, it’ll hug the widest of your three mtext lines.
For existing annotative mtext that are subjected to size reductions due to drawing scale changes, you'll have to select all existing mtext, and by all I mean you DO NOT HAVE TO ADJUST EACH PIECE OF TEXT INDIVIDUALLY, you are doing it in a single operation, then force the width to 0 for all those entities in the Properties Palette.
Chicagolooper
My MText objects don't have that "paper defined width" property. I'm on vanilla, are you on C3D?
Can't find what you're looking for? Ask the community or share your knowledge.