; 16-Feb-09 NEHolt created (defun c:r90 ( / x en ed x50 newed) ; Purpose: rotate leader MTEXT in 90 degree increments (while (setq x (entsel "\nSelect wire color/ga label:")) (setq en (car x)) ; get selected entity name (setq ed (entget en)) ; read the entity's data ; make sure it's MTEXT entity (if (= (cdr (assoc 0 ed)) "MTEXT") (progn ; okay to continue. ; Rotate MTEXT by 90 degrees. Get current rotation (setq x50 (cdr (assoc 50 ed))) ; (in radians) ; Add "(* pi 0.5)" radians (or "90" degrees) (setq x50 (+ x50 (* pi 0.5))) ; Substitute new value into copy of entity's data (setq newed (subst (cons 50 x50)(assoc 50 ed) ed)) ; Write new version of entity's data back (if newed (entmod newed)) (entupd en) (command "_.REGEN") ; force display to update ) ) ) (princ) ; quiet / clean exit ) (princ "Type R90 [Enter] to run this utility")(princ)