;;;ELISE MOSS ;;;WWW.MOSSDESIGNS.COM ;;;FEBRUARY 2006 ;;;THIS ROUTINE UPDATES SELECTED TEXT OR MTEXT OBJECTS TO THE CURRENT TEXT STYLE & height (defun c:upt () ;get the current text style (setq ts (getvar "TEXTSTYLE")) ;;get the current text height (setq textobj (tblobjname "STYLE" ts)) ; get style data (setq textstyle-data (entget textobj)) (setq th (cdr (assoc 40 textstyle-data))) ; next select text/mtext to be changed (setq ss (ssget (list (cons -4 "") ) ) ) ; get number of items selected (setq sno (sslength ss)) ;;then loop thru and change (setq item 0) (while (< item sno) ; get the item (setq txt-item (ssname ss item)) ; get the item data (setq txt-data (entget txt-item)) ; switch to a current text style (setq txt-data (subst (cons 7 ts) (assoc 7 txt-data) txt-data)) ;;switch to current text style text height (if (/= th 0.0) (setq txt-data (subst (cons 40 th) (assoc 40 txt-data) txt-data)) ) ;; otherwise keep the text height ;update the database (entmod txt-data) (entupd txt-item) (command "regen") ;increment the counter (setq item (+ 1 item)) ) ; end while ) ;end defun