Jeff has a great routine below for changing the color in a specified layer. I am wondering how to modify it it change xref layers with a wild card ex: (Color2Layer 8 "*|A-PATT-POCH") does not work Gary ;;;by Jeff Mishler ;;; (Color2Layer 8 "A-PATT-POCH") (defun Color2Layer (color layer / atts doc lay lays lokt) (vl-load-com) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-layers doc) (if (and (= color (vla-get-color lay)) (not (vl-string-search "|" (vla-get-name lay)))) (progn (setq lays (cons (vla-get-name lay) lays)) (if (vla-get-lock lay) (progn (setq lokt (cons (vla-get-name lay) lokt)) (vla-put-lock lay :vlax-false)))))) (vla-startundomark doc) (setq lay (vla-add (vla-get-layers doc) layer)) (vla-put-color lay color) (vlax-for blk (vla-get-blocks doc) (vlax-for ent blk (if (or (eq (vla-get-color ent) color) (member (vla-get-layer ent) lays)) (vla-put-layer ent layer)) (if (and (vlax-property-available-p ent "hasattributes") (vla-get-hasattributes ent) (setq atts (vlax-invoke ent "getattributes"))) (progn (foreach att atts (if (or (eq (vla-get-color att) color) (member (vla-get-layer att) lays)) (vla-put-layer att layer)) (vla-update att)))))) (if lokt (foreach lay lokt (vla-put-lock (vla-item (vla-get-layers doc) lay) :vlax-true))) (vla-endundomark doc) (princ))