Change the color of selected object- Lisp

(defun c:lcc ( / obj layer color)
 (while (setq obj (nentsel "\nSelect entity on layer: "))
 (setq layer (entget
 (tblobjname "layer" (cdr (assoc 8 (entget (car obj)))))
 )
 color (acad_colordlg (cdr (assoc 62 layer)))
 )
 (if color
 (entmod (subst (cons 62 color) (assoc 62 layer) layer))
 )
 )
 (princ)
 )

No comments:

Post a Comment