One more question:
Do you want to change all Xref layers or just layers that related a picked Xref block ? Anyway, try this program and let me know if this work for you;
(defun c:Test (/ blk doc name lay lname) ;; Tharwat - Date: 04.May.2016 ;; (if (and (setq blk (car (entsel "\nSelect Xref block :"))) (vlax-property-available-p (vlax-ename->vla-object blk) 'path) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)) name (cdr (assoc 2 (entget blk)))) )(progn (if (not (tblsearch "LTYPE" "HIDDEN")) (vla-load (vla-get-Linetypes doc) "HIDDEN" "acadiso.lin") ) (while (setq lay (tblnext "LAYER" (not lay))) (if (wcmatch (setq lname (cdr (assoc 2 lay))) (strcat name "|*")) (entmod (append (entget (tblobjname "LAYER" lname)) '((62 .(6 . "HIDDEN") (370 . -3)))) ) ) (vla-regen doc AcAllviewports) ) (alert "Nothing selected or object is not Xref. Block !") )(princ))(vl-load-com)
only related picked Xref Block
thanks i will try this one out tomorrow and give you feedback
EDIT :
just tested the routine its working fine except that it doesn't change the blocks nested in xrefs I found this one years ago, and it is quite useful. I make a block of dwg or xref it in....
VVA Post #7thru to -> #14
http://www.cadtutor.net/forum/showthread.php?533-Lisp-colour-change-for-all-layers-and-blocks&p=208437&viewfull=1#post208437
页:
1
[2]