Changing the color of xref dependent entities is a popular topic here in the Cadalyst CAD Tips. Tips 4330, 3995, 3828, 3770, and 2278 all have something to do with modifying xref layer colors. Matt’s routine is similar, but it’s different enough to warrant a new entry. When you run this routine, a list of each xref is generated along three options for the colors of the xref layers: Default (keep things as is), Reset (reset colors back to those in the source drawing), or Change (change all layers to a single color). If you are in a floating viewport, you also have the option of making these color changes to just that viewport.
After you load the LISP file, run the command XRL. A dialog box will open, listing each xref. If you do nothing and press OK, no changes will occur since all of the radio buttons are set to Default. Find the one or more xrefs you want to change, and choose either Reset or Change and press OK. Of course, entities in xrefs whose color is hardcoded cannot be changed by modifying the xref layer color. Also note that the dialog box for this command is generated dynamically so depending on the size of your display, if you have more than about 30 xrefs, the dialog box may not fit. Lastly, AutoCAD 2016 and later includes a system variable named XrefOverride that can be used to force layer colors on xref entities, even if they have been hardcoded in the source drawing. |