Display full version of the post: Mtext Width factor
Prasanna Achar
19.04.2011, 10:52
Is it possible to change the multiple mtext width factor in a single command? Prasanna Achar2011-04-19 10:59:09
John Connor
19.04.2011, 11:57
What method are you currently using?
Prasanna Achar
19.04.2011, 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..Prasanna Achar2011-04-19 12:15:34
John Connor
19.04.2011, 12:38
Both of the methods in tip #5773 should have worked. Try again. Use a smaller selection set as a test.
?[code](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))[/code]
John Connor
19.04.2011, 16:05
Nice routine there Alan. Thanks.
[QUOTE=John Connor]Nice routine there Alan. Thanks.[/QUOTE]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.[code]; 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))[/code]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.
alanjt2011-04-19 16:13:56