(DEFUN DTR (A) (* PI (/ A 180.0)) ) (defun modatterr (msg) (if msg (princ msg)) (if os (setvar "osmode" os)) (if ortho (setvar "orthomode" ortho)) (if snpst (setvar "snapstyl" snpst)) (if cstyl (setvar "textstyle" cstyl)) (if ol (setvar "clayer" ol)) (if oc (setvar "cecolor" oc)) (if olderr (setq *error* olderr)) (if (equal (entlast) txtobj) (entdel txtobj)) (if (null ang) (princ "\n You must enter or pick the orientation of the attribute. ")) (command "_.undo" "_end") (princ) ) (DEFUN C:MODATT (/ ol oc cstyl snpst os ortho e1 s1 p1 attent elist styl ht jusval cont jus ang stylist stylht txtobj attlay) (command "_.undo" "_g") (setq olderr *error* *error* modatterr) (setq ol (getvar "clayer")) (setq oc (getvar "cecolor")) (setq cstyl (getvar "textstyle")) (setq snpst (getvar "snapstyl")) (setvar "snapstyl" 0) (setvar "cmdecho" 0) (setq os (getvar "osmode")) (setq ortho (getvar "orthomode")) (setvar "osmode" 0) (setvar "orthomode" 0) (setq E1 (entsel "\nPick attribute to rotate and move: ")) (setq S1 (cadr E1)) (setq attent (nentselp s1)) (setq elist (entget (car attent))) (setq styl (cdr (assoc 7 elist))) (setq attlay (cdr (assoc 8 elist))) (setq attcolr (cdr (assoc 62 elist))) (setq ht (cdr (assoc 40 elist))) (setq jusval (cdr (assoc 72 elist))) (setq cont (cdr (assoc 1 elist))) ; (setq rot (dtr (cdr (assoc 50 elist)))) (if (= jusval 4) (setq jus "M")) (if (= jusval 0) (setq jus "L")) (if (= jusval 2) (setq jus "R")) (if (= jusval 1) (setq jus "C")) (if (and (= jusval 1) (assoc 74 elist)) (setq jus "M")) (setq ang (rtd (getorient S1 "\nDesired orientation of the attribute: "))) (setq stylist (tblsearch "style" styl)) (setvar "textstyle" styl) (setq stylht (assoc 40 stylist)) (setvar "clayer" attlay) (if attcolr (if (numberp attcolr) (setvar "cecolor" (itoa attcolr))(setvar "cecolor" attcolr))) (if (/= jus "L") (if (> (cdr stylht) 0.00) (progn (command "_.text" jus s1 ang cont) (command "_.scale" "l" "" s1 (/ ht (cdr stylht))) ) (command "_.text" jus s1 ht ang cont) ) (progn (if (> (cdr stylht) 0.00) (progn (command "_.text" s1 ang cont) (command "_.scale" "l" "" s1 (/ ht (cdr stylht))) ) (command "_.text" s1 ht ang cont) ) ) ) (setq txtobj (entlast)) (prompt "\nMove to new position") (command "_.move" txtobj "" s1 pause) (setq p1 (getvar "lastpoint")) (entdel txtobj) (command ".ATTEDIT" "Y" "" "" "" S1 "" "a" ang "p" p1 "") (setvar "osmode" os) (setvar "orthomode" ortho) (setvar "snapstyl" snpst) (setvar "textstyle" cstyl) (setvar "clayer" ol) (setvar "cecolor" oc) (setq *error* olderr) (command "_.undo" "_end") (princ) )