不确定您的意思是将颜色覆盖设置为颜色8还是图层颜色,但这里是一个开始:
- (defun c:L8 ( / NewCol layers ss )
- ;; © Lee Mac 2010
- (setq NewCol [color=blue];; New Colour for Objects[/color]
- (setq layers
- (mapcar 'strcase
- '(
- [color=blue] ;; List your Layers Here:
- "0"
- "Defpoints"
- ;;---------------------;;[/color]
- )
- )
- )
- (if
- (setq ss
- (ssget "_X"
- (list
- (cons -4 "<NOT")
- (cons 8 (LM:lst->str layers ","))
- (cons -4 "NOT>")
- )
- )
- )
- (
- (lambda ( i / e l )
- (while (setq e (ssname ss (setq i (1+ i))))
- (entupd
- (cdr
- (assoc -1
- (entmod
- (if (assoc 62 (setq l (entget e)))
- (subst (cons 62 NewCol) (assoc 62 l) l)
- (append l (list (cons 62 NewCol)))
- )
- )
- )
- )
- )
- )
- )
- -1
- )
- (princ "\n--> No Objects Found on Other Layers <--")
- )
- (princ)
- )
- ;;-------------------=={ List to String }==-------------------;;
- ;; ;;
- ;; Constructs a string from a list of strings separating ;;
- ;; each element by a specified delimiter ;;
- ;;------------------------------------------------------------;;
- ;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;;
- ;;------------------------------------------------------------;;
- ;; Arguments: ;;
- ;; lst - a list of strings to process ;;
- ;; del - delimiter by which to separate each list element ;;
- ;;------------------------------------------------------------;;
- ;; Returns: String containing each string in the list ;;
- ;;------------------------------------------------------------;;
- (defun LM:lst->str ( lst del )
- ;; © Lee Mac 2010
- (if (cdr lst)
- (strcat (car lst) del (LM:lst->str (cdr lst) del))
- (car lst)
- )
- )
我猜了一下比例。。。 |