;Rename Layer Of Selected Object
;created by: Igal Averbuh 2016 inspired by Alan Thompson routines
(defun c:CL (/ clay sset pt nl)

(if
(and
(setq e (car (entsel "\nSelect entity to rename it's layer: ")))
(setq e (tblsearch "layer" (cdr (assoc 8 (entget e)))))
)
(prompt
(strcat
"\nLayer: "
(cdr (assoc 2 e))
", Color: "
(itoa (cdr (assoc 62 e)))
)
)
)

(setq nl (getstring "\nSet new Layer Name to rename layer of selected entity: "))

(command "-LAYER" "R" (strcat(cdr (assoc 2 e))) nl "")

)

(c:cl)

Advertisements