ababs Posted Friday at 11:24 AM Posted Friday at 11:24 AM Hi everyone, I’m working on a project with multiple AutoCAD drawings (building floors), and each floor contains several XREF layers. I want to know if there is a way or tool to change XREF layer properties (such as color, linetype, lineweight, etc.) for multiple drawings at once without opening each file individually. For example: I have many floor plans. Each drawing has the same XREF attached. I want to directly modify the XREF layer overrides across all drawings in bulk. Is there a built-in AutoCAD feature, script, LISP, Sheet Set method, Layer States Manager workflow, or Autodesk tool that can do this automatically? Quote
BIGAL Posted Saturday at 12:51 AM Posted Saturday at 12:51 AM You can use possibly OBDX which can edit a dwg without opening it. Using a script is much simpler as it will open a dwg make the edits then close it. Should be reasonably fast. The obvious first step is what are you trying to change ? You need say a text file with the new settings, layer name, color, linetype on/off and so on. So if I understand correct another way, the sequence may be open a dwg add the xref do the layer changes save and close do next dwg. So what I am asking here does original dwg always have the xref pre loaded. Need sample dwg, txt and a xref. Can be blank just need layers, Quote
ababs Posted Saturday at 08:44 AM Author Posted Saturday at 08:44 AM hello actually we attach the architectural drawings as xref after finishing our mechanical plans we have to publish so we got to change xref's layers properties excpt for title block(which is also xref) Quote
BIGAL Posted Sunday at 12:13 AM Posted Sunday at 12:13 AM (edited) @ababs "actually we attach the architectural drawings as xref " so why not do the changes then as part of an custom attach xref lisp. Again need an idea of what the layer names are and the relevant changes. How do you propose to identify the layers ? By wildcards "wall*" etc Were I worked we redid the color of layers by wildcards about 7 of them. So maybe 50 layers. Edited Sunday at 12:18 AM by BIGAL Quote
ababs Posted 16 hours ago Author Posted 16 hours ago Hi Again for example, here I have 4 xref attached, I need to change the layers properties (make color 180,180,180 and line weight =default) for these xrefs without opening all drawings. Thank you for your time Quote
BIGAL Posted 42 minutes ago Posted 42 minutes ago (edited) So give this a try. Just load the xrefs in a dwg then run this code will reset all the xref layers. Note will do all current XREFS. Just do it as part of adding the XREFS to current dwg. ; https://www.cadtutor.net/forum/topic/99138-layer-properties/ ; Set all xref colors in a dwg ; By AlanH May 2026 (defun c:setxrefcol ( / lst blk lays xname tc) (setq lst '()) (setq blk (tblnext "BLOCK" T)) (while blk (if (member (logand (cdr (assoc 70 blk)) 4) '(4)) ; bit‑4 = xref (setq lst (cons (cdr (assoc 2 blk)) lst)) ) (setq blk (tblnext "BLOCK")) ) (reverse lst) (setq lays (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) (repeat (setq x (length lst)) (setq xname (nth (setq x (1- x)) lst)) (vlax-for lay lays (setq lname (vlax-get lay 'name)) (if (wcmatch lname (strcat "*" lname "*")) (progn (setq tc (vla-GetInterfaceObject (vlax-get-acad-object) "AutoCAD.AcCmColor.20")) (vla-SetRGB tc 180 180 180) (vla-put-TrueColor lay tc) ) ) ) ) (princ) ) (c:setxrefcol) There is no need to try and do it as a after task. Edited 41 minutes ago by BIGAL Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.