Jump to content

MTEXT - change text width


dbroada

Recommended Posts

I see that Lee has written something similar recently and that he is on the forum right now. I wonder if I will be lucky....

 

I have a drawing in which somebody has used "FIT" justification on all his text. It looks rubbish. I have changed all the text into MTEXT but would like to reduce the width of the text string - NOT THE BOX - to 80%.

 

I can easily edit to do this but a simple click would be preferable. Any routines available?

Link to comment
Share on other sites

Give this a shot Dave,

 

(defun c:mtw (/ i ss e s el)

 (if (and (setq i -1 ss (ssget "_:L" '((0 . "MTEXT"))))
          (not (initget 6))
          (setq w (cond ((getreal "\nSpecify Width Factor <0.8> : ")) (0.)))
   
   (while (setq e (ssname ss (setq i (1+ i))))
     (setq s (cdr (assoc 1 (setq el (entget e)))))
     (entmod (subst (cons 1 (strcat "{\\W" (rtos w) ";" s "}")) (assoc 1 el) el))))

 (princ))

Be careful with pre-formatted MText though, as it messes with MText formatting strings.

 

Lee

Link to comment
Share on other sites

First look - seems to do excactly what I want.

 

I don't have a problem with pre formating as a little while ago it was a text object rather than an MTEXT object.

 

Yet again, many thanks. :)

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