Non-Xref Layer Filter
February 1, 2008 by rockmaster
Ever since AutoCAD 2000, we’ve had the ability to filter our layer manager and layer toolbar views. One thing that I always found myself doing is adding a filter which shows only non-xref layers. It’s easy enough to create one (just use ~*|* as a name filter), but I wanted something faster, so I wrote a VBA script to add the filter.

It’s a simple thing, but it saves me a lot of time. Here’s how you can use this script.
Start by downloading this .dvb file (22 kb). You could load and run it with VBAMAN, but I like to have a toolbar button handy. To create a toolbar button to run this VBA app, type CUI.
In the Command List pane, click the “New Command” button.

Now pick an image for the button, change the name to “Create Non-Xref Layer Filter” or something equally brilliant, and copy the following text into the Macro field (changing <path to file> to whatever folder you keep your macros in):
^C^C_-vbarun "C:/<path to file>/createnonXreffilter.dvb!Module3.Main";
Now drag (or paste) the command from the Command List to whatever Toolbar location you want.

That’s it. Now just click on the toolbar whenever you want to add this filter. (Now if only I could figure out a way to apply it to the layer toolbar without having to go into the Layer Manager).
I like to have this filter in my acad.dwt default drawing template, too.
Donnie Gladfelter has an article on how you can add VB apps or other scripts to a tool pallette.
Erhan Toker has some additional information about layer filters.
I hope this helps!