Jump to content

Text box auto resize


EmilyB

Recommended Posts

Hello,

 

Is there any way to automatically re-size text boxes to fit text?

 

The reason I ask is that I've got background mask on all my text and have just reduced the text size by half - I'm not looking forward to resizing each box.....

 

Thanks for your time,

Emily

Link to comment
Share on other sites

Welcome to the forum!

 

There is no way to do that, as far as I know. It would be nice if AutoCAD resized mtext width automatically when you changed the height. Something for the Wish List, I guess....

  • Like 1
Link to comment
Share on other sites

are you referring to the box that is created when using the express tool textmask? if so, it may be quicker to TEXTUNMASK then TEXTMASK each text entity.

Link to comment
Share on other sites

if a load of the mtexts are the same size, you can at least do one the right size, then match properties for the rest.

partial answer at best i'm afraid!

Link to comment
Share on other sites

Thanks for all your advice.

 

Unfortunately I can't match properties as my text is all at different angles.

 

I'll look into the textmask tool as that sounds it'd be helpful to use for new text - just in case I have to resize again.

 

Cheers,

Emily

Link to comment
Share on other sites

if you use the background mask that is a mtext property, it should automatically resize. and if TextUnmask doesnt get rid of the mask, it sounds like someone created a wipeout manually and put it behind the text.

Link to comment
Share on other sites

Would something like this work?

 

(defun c:UpdateMTextWidth ( / ss i e ) (vl-load-com)
 ;; © Lee Mac 2011
 
 (if (setq ss (ssget "_:L" '((0 . "MTEXT"))))
   (repeat (setq i (sslength ss))
     (vla-put-width (vlax-ename->vla-object (setq e (ssname ss (setq i (1- i)))))
       (* 1.05 (cdr (assoc 42 (entget e))))
     )
   )
 )

 (princ)
)

Link to comment
Share on other sites

I stand corrected, if the mtext has a predefined width, the background mask will not automatically resize. I completely forgot about predefined width, as most of our notes do not have widths.

Link to comment
Share on other sites

  • 6 years later...
  • 2 years later...

Lee Mac- I copied the following exactly as shown below and pasted it into a notepad and saved it as an .lsp file. Then I went to my UI and loaded the lisp. Then I typed UpdateTextWidth and the command line says Select Objects, but when I select my mtext and press enter, nothing happens. It deselects and ends the command with no comment. Did I do something incorrectly?

 

Thank you, Heidi 

 

(defun c:UpdateMTextWidth ( / ss i e ) (vl-load-com)
 ;; © Lee Mac 2011
 
 (if (setq ss (ssget "_:L" '((0 . "MTEXT"))))
   (repeat (setq i (sslength ss))
     (vla-put-width (vlax-ename->vla-object (setq e (ssname ss (setq i (1- i)))))
       (* 1.05 (cdr (assoc 42 (entget e))))
     )
   )
 )

 (princ)
)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...