Anyone have a Lisp Routine to scale text objects a certain value and have the program actually scale each text object as you pick them.
The change text height using the Properties function does not work for what I need because the objects I need to scale are Mtext objects with
Background Mask, and when you use the Properties function to change their text height it messes up the background mask so that you have to
select each text entity and stretch the mask area smaller or larger, but if you use the scale function it scales the background mask as well so the
background mask coverage is still the same.
Anybody have a lisp?
Here is a quick draft that should perform as you require:
(defun c:smt ( / i o s ) (initget 6) (setq smt:scl (cond ( (getdist (strcat "\nSpecify scale factor <" (rtos (cond (smt:scl) (2.0))) ">: " ) ) ) ( smt:scl ) ( 2.0 ) ) ) (if (setq s (ssget "_:L" '((0 . "MTEXT")))) (repeat (setq i (sslength s)) (vla-scaleentity (setq o (vlax-ename->vla-object (ssname s (setq i (1- i))))) (vla-get-insertionpoint o) smt:scl ) ) ) (princ) ) (vl-load-com) (princ)
I generally set my MTEXT to 0 width and 0 height (except numbered notes) and the background mask moves with the text.
Hi Lee,
How do you scale the TEXT and MTEXT objects based on their Justification Point?
The selected TEXT objects of my drawings have different Justifications like LEFT, RIGHT, CENTER, TL, TC, TR, ML, MC, etc.
I can't figure out how to do that
Greetzzz,
Gerben
Hi Gerben,
The following should perform as you require:
(defun c:smt ( / i o s ) (initget 6) (setq smt:scl (cond ( (getdist (strcat "\nSpecify scale factor <" (rtos (cond (smt:scl) (2.0))) ">: " ) ) ) ( smt:scl ) ( 2.0 ) ) ) (if (setq s (ssget "_:L" '((0 . "TEXT,MTEXT")))) (repeat (setq i (sslength s)) (vla-scaleentity (setq o (vlax-ename->vla-object (ssname s (setq i (1- i))))) (if (or (= "AcDbMText" (vla-get-objectname o)) (= acalignmentleft (vla-get-alignment o)) ) (vla-get-insertionpoint o) (vla-get-textalignmentpoint o) ) smt:scl ) ) ) (princ) ) (vl-load-com) (princ)