CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
Czech English Deutsch
Login/Register:
 Visitors: 2104 
RSS tips RSS channel - CAD tips
RSS discussion RSS channel - CAD discussion

Discussion Discussion forum

HelpCAD discussion

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedMtext Width factor

 Post Reply Post Reply
Author
Prasanna Achar View Drop Down
Newbie
Newbie


Joined: 21.Jan.2011
Location: India
Using: Autocad2008
Status: Offline
Points: 8
Direct Link To This Post Topic: Mtext Width factor
    Posted: 19.Apr.2011 at 10:52

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



Edited by Prasanna Achar - 19.Apr.2011 at 10:59
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2013, AutoCAD 2014
Status: Offline
Points: 3751
Direct Link To This Post 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 2013>>

Back to Top
Prasanna Achar View Drop Down
Newbie
Newbie


Joined: 21.Jan.2011
Location: India
Using: Autocad2008
Status: Offline
Points: 8
Direct Link To This Post 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..


Edited by Prasanna Achar - 19.Apr.2011 at 12:15
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2013, AutoCAD 2014
Status: Offline
Points: 3751
Direct Link To This Post 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 2013>>

Back to Top
alanjt View Drop Down
Groupie
Groupie


Joined: 08.Apr.2009
Location: United States
Using: Civil 3D 2009/2011
Status: Offline
Points: 30
Direct Link To This Post 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)
)

Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2013, AutoCAD 2014
Status: Offline
Points: 3751
Direct Link To This Post 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 2013>>

Back to Top
alanjt View Drop Down
Groupie
Groupie


Joined: 08.Apr.2009
Location: United States
Using: Civil 3D 2009/2011
Status: Offline
Points: 30
Direct Link To This Post 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.


Edited by alanjt - 19.Apr.2011 at 16:13
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,188 seconds.