TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Biscuits on March 12, 2008, 01:51:56 PM
-
Using Windows XP with Autocad2008.
I'm looking for a routine to select an attribute (to obtain text height)
then select other attributes to change their text height to match the previous selection.
Would appreciate any assistance with this.
-
Look at 'nentsel' to select the first attribute. Then grab the Height property. Then use the routine here (http://www.theswamp.org/index.php?topic=19886.0) to select the other attributes.
-
Need more?
(setq en1 (entget (car (nentsel))))
(setq en2 (cdr (assoc 40 en1)))
-
So, any progress?
-
Poor lsp skills and time constraints are my excuses for little progress for now.
Not sure how to combine your statements with T.Willey's
Thanks for your help
-
I'll see if I can whip something up for you then. I've got a little time.
-
My general disclaimer applies - "It aint pretty but it works"
There is a regen after each selection, and the variables aren't reset, but I've run out of time to make it a bit more friendly. Others here could probably do quite a bit better, but hey, it works.
Enjoy!
;match_att_ht.lsp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;start prog
(defun c:match_att_ht ()
(setq en1 (entget (car (nentsel))))
(setq en2 (cdr (assoc 40 en1)))
(setq cntr1 1)
(while (= 1 cntr1)
(setq ent1 (nentsel "\nSelect any text object <HIT ESC TO STOP>:" ))
(setq en1-2 (car ent1))
(setq en3 (entget (car Ent1)))
(setq en3
(subst(cons 40 en2)
(assoc 40 en3)
en3))
(entmod en3)
(entupd en1-2)
(command "regen")
(princ)
);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;while
)
-
Lookin' purty to me!
Thank you.
Works great.
-
Not a problem (today anyway)!