;******************************************************** ;* GAE - Global Attribute Editor, Version 0.91 (beta) * ;* * ;* (c) 1997 Tee Square Graphics, Paul A. Turvill, P.E. * ;* * ;* Permission to use, copy and distribute this software * ;* is hereby granted. The Author will be receptive to * ;* comments, ideas, and suggestions for improvements. * ;* * ;* EMail: cadman@whidbey.net * ;******************************************************** ; ;Revision history: ; ; Original beta release 09/04/97. ; ; 0.9>>0.91: Modified to accept Position option; ; Checks added for invalid Style, Layer & Color; ; Revisit to options displays previous choice; ; Angle accepts keyboard or digitizer input. 09/05/97. ; (defun C:GAE (/ blk att val pos siz tmp ang sty lyr clr key p) (setq blk (getstring "\nName of Block <*>: ") att (getstring "\nAttribute Tag <*>: ")) (while (or (null key)(/= key "Go")) (initget "Value Position Height Angle Style Layer Color Go") (setq key (getkword "\nValue/Position/Height/Angle/Style/Layer/Color/Go : ")) (cond ((= key "Value") (setq val (getstring "\nNew Value for ALL attributes: " T))) ((= key "Position") (setq pos T) (prompt "\nNew Insertion Point will be requested for each attribute.")) ((= key "Height") (setq tmp (getdist (strcat "\nNew Height for attribute text" (if siz (strcat " <" (rtos siz) ">") "") ": "))) (if tmp (setq siz tmp))) ((= key "Angle") (setq tmp (getangle (strcat "\nNew Rotation Angle" (if ang (strcat " <" (angtos (* ang (/ pi 180))) ">") "") ": "))) (if tmp (setq ang (* tmp (/ 180 pi))))) ((= key "Style") (setq tmp "") (while (null (tblsearch "style" tmp)) (setq tmp (getstring (strcat "\nText Style for all attributes" (if sty (strcat " <" sty ">") "") ": "))) (if (and sty (= tmp ""))(setq tmp sty))) (setq sty tmp)) ((= key "Layer") (setq tmp "") (while (null (tblsearch "layer" tmp)) (setq tmp (getstring (strcat "\nNew Layer for all attributes" (if lyr (strcat " <" lyr ">") "") ": "))) (if (and lyr (= tmp ""))(setq tmp lyr))) (setq lyr tmp)) ((= key "Color") (setq tmp "") (while (not (or (member tmp (list "R" "Y" "G" "C" "B" "M" "W")) (member tmp (list "RED" "YELLOW" "GREEN" "CYAN" "BLUE" "MAGENTA" "WHITE")) (and (> (atoi tmp) 0)(< (atoi tmp) 256)) (= tmp "BYLAYER")(= tmp "BYBLOCK"))) (setq tmp (strcase (getstring (strcat "\nNew Color for all attributes" (if clr (strcat " <" clr ">") "") ": ")))) (if (and clr (= tmp ""))(setq tmp clr))) (setq clr tmp)) ((= key "Go") nil) (T (setq key "Go")))) (command "attedit" "y" blk att "*" "c" (getvar "extmin")(getvar "extmax")) (while (> (getvar "cmdactive") 0) (if val (command "v" "r" val)) (if (and pos (setq p (getpoint "\nPick new Text Insertion Point (ENTER for no change): "))) (command "p" p)) (if siz (command "h" siz)) (if ang (command "a" ang)) (if sty (command "s" sty)) (if lyr (command "l" lyr)) (if clr (command "c" clr)) (command "n")) (princ) )