- (defun c:setcolor( / ss color sinf sname i)
- (prompt "选择要改变颜色的对象...")
- (setq ss (ssget))
- (initget 5)
- (setq color (getint "输入颜色值:"))
- (setq i 0)
- (repeat (sslength ss)
- (setq sname (ssname ss i))
- (setq sinf (entget sname))
- (if (assoc 62 sinf)
- (setq sinf (subst (cons 62 color) (assoc 62 sinf) sinf))
- (setq sinf (append sinf (list (cons 62 color))))
- )
- (entmod sinf)
- (setq i (1+ i))
- )
- (princ)
- )
|