Reduce MText Box Width of multiple MText

demus72
Collaborator
Collaborator

Reduce MText Box Width of multiple MText

demus72
Collaborator
Collaborator

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

0 Likes
Reply
Accepted solutions (2)
9,535 Views
10 Replies
Replies (10)

ChicagoLooper
Mentor
Mentor
Accepted 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. 

 

1-Here a three separate mtext with varying sizes of text mask.1-Here a three separate mtext with varying sizes of text mask.

 

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.

 

2-Change 'Paper defined width'' to 0.2-Change 'Paper defined width'' to 0.

Chicagolooper

EESignature

RobDraw
Mentor
Mentor

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.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.

demus72
Collaborator
Collaborator

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

0 Likes

RobDraw
Mentor
Mentor

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. 


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes

pendean
Community Legend
Community Legend
>>>...how to get the mtext box the exact width of the text....<<<
What does that mean to you, please explain or post screenshots.

0 Likes

demus72
Collaborator
Collaborator

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.

MTEXT RULER.jpg

MTEXT RULER 2.jpg
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".

MTEXT RULER-DOUBLE CLICK.jpg
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.

0 Likes

RobDraw
Mentor
Mentor

@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.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes

ChicagoLooper
Mentor
Mentor
Accepted solution

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.

 

  1. For middle center justified text, you’ll get five grips i.e., one in the middle plus four more in each corner, where the corners literally 'defines the extents' of your text box. To reduce the width so the box ‘hugs’ your mtext, double click on the arrows shown below. The box will reduce and so will your mask. 1-Mtext with middle center justification.1-Mtext with middle center justification.
  2. While in the mtext command, select the ‘Width’ option after your first click and before the second click. When prompted for width, enter 0. After 0, you may finish your second click. (These two clicks, e.g. upper left and lower right, will define your text box area.) For middle center justified text, the 0 width will force your mask to hug your mtext even though you won’t have the customary four corner grips. 2-Select 'W" for width during the mtext command. Enter Width=0.2-Select 'W" for width during the mtext command. Enter Width=0.

 

 

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.

 

 3-Comparing RESULTS of mask for middle center justification.3-Comparing RESULTS of mask for middle center justification.

 

 

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

EESignature

0 Likes

Anonymous
Not applicable

My MText objects don't have that "paper defined width" property.  I'm on vanilla, are you on C3D?

pendean
Community Legend
Community Legend
>>>...My MText objects don't have that "paper defined width" property...<<<
@Anonymous You get that only if you are using annotative text styles: if not, then no.
0 Likes