Sure thing:
- (defun c:L8 ( / NewCol layers def n c ss ) (vl-load-com) ;; © Lee Mac 2010 [color=blue](setq NewCol ;; New Colour for Objects[/color] (setq layers (mapcar 'strcase '([color=blue] ;; List your Layers Here (may use Wildcards): "LC_*" ;;------------------------------------------;;[/color] ) ) ) (while (setq def (tblnext "LAYER" (null def))) (setq n (strcase (cdr (assoc 2 def))) c (cdr (assoc 62 def))) (if (not (vl-some (function (lambda ( s ) (wcmatch n s)) ) layers ) ) ( (lambda ( tbl ) (entmod (subst (cons 62 (* NewCol (/ (abs c) c))) (assoc 62 tbl) tbl ) ) ) (entget (tblobjname "LAYER" n)) ) ) ) (if (setq ss (ssget "_X" (list (cons -4 "") ) ) ) ( (lambda ( i / e l ) (while (setq e (ssname ss (setq i (1+ i)))) (if (assoc 62 (setq l (entget e))) (if (setq l (entmod (subst (cons 62 256) (assoc 62 l) l ) ) ) (entupd e) ) ) ) ) -1 ) ) (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) ))
The above changes all object NOT on your list layers to ByLayer - would you want EVERYTHING (including your listed layers) changed to ByLayer? |