AEDIT
AEDIT
AEDIT
; AEDIT.LSP
;
; This program replaces or changes attribute values.
; ******************************************************************
;
(Defun C:AEDIT (/ sa at ns cs)
(setq oler *error*
*error* myerr)
(setq cm (getvar "cmdecho")) (setvar "cmdecho" 0)
(setq os (getvar "osmode")) (setvar "osmode" 0)
(initget "V P A S H C L")
(setq kw (getkword "\nChange Attribute A/C/H/P/S/V <C>: "))
(if (= kw nil) (setq kw "C"))
(cond ((= kw "V")
(prompt "\nChange attribute value... ")
(setq sa (entsel "\nSelect Attribute <Exit>: "))
(while sa
(setq at (cadr sa))
(princ "\n ")
(setq cs (getstring 1 "\nString to change <All>: "))
(setq ns (getstring 1 "\nNew string value: "))
(if (/= cs "")
(command "ATTEDIT" "" "" "" "" at "" "v" "C" cs ns "")
(command "ATTEDIT" "" "" "" "" at "" "v" "R" ns "")
)
(princ "\n ")
(setq sa (entsel "\nSelect Next Attribute <Exit>: "))
)
)
((= kw "C")
(prompt "\nChange attribute color... ")
(setq sa (entsel "\nSelect Attribute <Exit>: "))
(while sa
(setq at (cadr sa))
(princ "\n ")
(setq ns (getstring 1 "\nNew Color: "))
(command "ATTEDIT" "" "" "" "" at "" "c" ns "")
(princ "\n ")
(setq sa (entsel "\nSelect Next Attribute <Exit>: "))
)
)
((= kw "H")
(prompt "\nChange attribute text height... ")
(setq sa (entsel "\nSelect Attribute <Exit>: "))
(while sa
(setq at (cadr sa))
(princ "\n ")
(setq ns (getreal "\nNew Text height: "))
(command "ATTEDIT" "" "" "" "" at "" "h" ns "")
(command)
(princ "\n ")
(setq sa (entsel "\nSelect Next Attribute <Exit>: "))
)
)
((= kw "S")
(prompt "\nChange attribute text style... ")
(setq sa (entsel "\nSelect Attribute <Exit>: "))
(while sa
(setq at (cadr sa))
(princ "\n ")
(setq ns (getstring 1 "\nNew text style: "))
(command "ATTEDIT" "" "" "" "" at "" "s" ns "")
(princ "\n ")
(setq sa (entsel "\nSelect Next Attribute <Exit>: "))
)
)
((= kw "P")
(prompt "\nChange attribute position... ")
(setq sa (entsel "\nSelect Attribute <Exit>: "))
(while sa
(setq at (cadr sa))
(princ "\n ")
(setq ns (getpoint "\nNew Text insertion point: "))
(command "ATTEDIT" "" "" "" "" at "" "p" ns "")
(princ "\n ")
(setq sa (entsel "\nSelect Next Attribute <Exit>: "))
)
)
((= kw "A")
(prompt "\nChange attribute text rotation... ")
(setq sa (entsel "\nSelect Attribute <Exit>: "))
(while sa
(setq at (cadr sa))
(princ "\n ")
(setq ns (getangle "\nText rotation angle: "))
(command "ATTEDIT" "" "" "" "" at "" "a" (rtd ns) "")
(princ "\n ")
(setq sa (entsel "\nSelect Next Attribute <Exit>: "))
)
)
((= kw "L")
(prompt "\nChange attribute Layer... ")
(setq sa (entsel "\nSelect Attribute <Exit>: "))
(while sa
(setq at (cadr sa))
(princ "\n ")
(setq ns (getstring 1 "\nNew Layer: "))
(command "ATTEDIT" "" "" "" "" at "" "l" ns "")
(princ "\n ")
(setq sa (entsel "\nSelect Next Attribute <Exit>: "))
)
)
)
(setvar "cmdecho" cm)
(setvar "osmode" os)
(Princ)
)
#####################################