(defun c:layerchange (/ oldlayer newlayer ss)
(setq oldlayer (getstring "\nEnter the name of the layer to be changed: "))
(setq newlayer (getstring "\nEnter the name of the new layer: "))
(setq ss (ssget "_X" (list (cons 0 "LWPOLYLINE,CIRCLE,ARC,LINE") (cons 8 oldlayer))))
(command "_.CHPROP" ss "" "LA" newlayer)
(princ)
)
来自chatGPT3.5大模型