Print Page | Close Window

Mtext Width factor

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=5718
Printed Date: 20.Apr.2026 at 11:08


Topic: Mtext Width factor
Posted By: Prasanna Achar
Subject: Mtext Width factor
Date Posted: 19.Apr.2011 at 10:52

Is it possible to change the multiple mtext width factor in a single command? 




Replies:
Posted By: John Connor
Date Posted: 19.Apr.2011 at 11:57

What method are you currently using?



-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Prasanna Achar
Date Posted: 19.Apr.2011 at 12:12
by editing value in text formatting toolbar one by one..
 
 
I had gone gone with cad tip #5773. but it does not worked for me..


Posted By: John Connor
Date Posted: 19.Apr.2011 at 12:38
Both of the methods in tip #5773 should have worked.  Try again.  Use a smaller selection set as a test.

-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: alanjt
Date Posted: 19.Apr.2011 at 15:41
?

(defun c:WD (/ ss wd)
  ;; Change width of selected MText and MultiLeader objects
  ;; Alan J. Thompson, 11.05.09
  (vl-load-com)
  (if (and (setq ss (ssget "_:L" '((0 . "MTEXT,MULTILEADER"))))
           (setq wd (initget 4)
                 wd (cond ((getdist "\nWidth <0.0>: "))
                          (0.)
                    )
           )
      )
    (progn
      (vlax-for x (setq ss (vla-get-activeselectionset
                             (cond (*AcadDoc*)
                                   ((setq *AcadDoc* (vla-get-activedocument
                                                      (vlax-get-acad-object)
                                                    )
                                    )
                                   )
                             )
                           )
                  )
        (vl-catch-all-apply
          (function vlax-put-property)
          (list x
                (cond ((eq (vla-get-objectname x) "AcDbMText") 'Width)
                      ((eq (vla-get-objectname x) "AcDbMLeader") 'TextWidth)
                )
                wd
          )
        )
      )
      (vla-delete ss)
    )
  )
  (princ)
)



Posted By: John Connor
Date Posted: 19.Apr.2011 at 16:05
Nice routine there Alan.  Thanks.

-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: alanjt
Date Posted: 19.Apr.2011 at 16:13
Originally posted by John Connor John Connor wrote:

Nice routine there Alan.  Thanks.

You're welcome. 99% of the time, I just use MText with a zero width, but it comes it handy when I have text from someone else that I want to fix - especially annoying when they have a huge width and background masking turned on.

Here's a simple macro I use to place MText with an initial prompt of using a zero width or you can right-click/enter once and it will allow you to place text normally.

; mtext with 0 width
(defun c:T (/ pt)
  (initdia)
  (command "_.mtext")
  (if (setq pt (getpoint "\nSpecify insertion point <First corner>: "))
    (command "_non" pt "_W" 0.)
  )
  (princ)
)


FYI: I keep cmdecho set to 0 at all times, so it probably looks a lot cleaner on my end.

BTW, where is the option to insert code tags? I have to type them myself.



Print Page | Close Window