;| ************************************************************************ GCC.LSP - (c) 1998 Tee Square Graphics Global Color Changer for AutoCAD R14. Changes all objects and layer definitions of a selected color to a different color of user's choice. (load "GCC") to load, GCC to run. ************************************************************************ |; (defun C:GCC (/ cmd old ent clr lyr new ss col) (command "_.undo" "_be") (setq cmd (getvar "cmdecho") old (entsel "\nPick Object of Color to change: ") ent (entget (car old)) clr (cdr (assoc 62 ent)) lyr (cdr (assoc 8 ent))) (if (null clr) (setq clr (cdr (assoc 62 (tblsearch "layer" lyr))))) (setq new (acad_colordlg clr nil) ss (ssget "x" (list (cons 62 clr))) lyr (tblnext "layer" T)) (if ss (command "_.chprop" ss "" "_c" new "")) (while lyr (setq ent (entget (tblobjname "layer" (cdr (assoc 2 lyr)))) lyr (tblnext "layer")) (if (= (cdr (setq col (assoc 62 ent))) clr) (progn (setq ent (subst (cons 62 new) col ent)) (entmod ent)))) (setvar "cmdecho" cmd) (command "_.undo" "_e") (princ) ) (alert (strcat "GCC.LSP - (c) 1998 Tee Square Graphics\n\n" "Global Color Changer (Objects and Layers)\n" " Type GCC to start.")) (princ)