;***************圖層CHANGE功能***********************************]

(defun c:cgc (/ os ce bm ss se la )
             (setq   os (getvar "OSMODE")
                     ce (getvar "CMDECHO")
                     bm (getvar "BLIPMODE"))
             (setvar "OSMODE" 37)
             (setq se (getstring "\n Input layer name<any key>/Select matching object <enter>"))
                 (if (= se "")
                     (progn 
                       (setq la (cdr (assoc '8 (entget (car (entsel "\n Select an Object to match it"))))))
                       (setq ss (ssget))
                       (command "_change" ss "" "p" "la" la "")
                       )
                     (progm
                       (setq la (getstring "\n Enter layer name>"))
                       (setq ss (ssget))
                       (command "_change" ss "p" "la" la "")
                       )
                      )
             (setvar "OSMODE" os)
             (setvar "CMDECHO" ce)
             (setvar "BLIPMODE" bm)
             (princ) ;圖層改變功能亦可媲美於圖層复製功能!!!
)






