AutoCAD Layer-Fu

A problem came to my attention today that I have meant to write up for a while. 

The problem is this: Say you are an AutoCAD user and don't want to see layers from an XREF. 
To hide all XREF layers, you can highlight the Layer Filter group that AutoCAD creates for you and toggle on Invert Filter. 

The problem with this technique is that after closing the drawing and coming back in, the Invert Filter toggle will have cleared itself.

Invert filters resets upon opening drawings every time. This has been true for AutoCAD back as far as I can remember. There are several opinions among users whether this is helpful or annoying. On the Autodesk side, there are no plans to change this behavior.

The good news is that it is SUPER easy to make your own "non-XREF" filter. Create a new layer property filter with ~*|* in the description field, as shown below:

  • The ~ is a "NOT" logical filter
  • The vertical bar | is always present in XREF layer names.
  • and of course the asterisk * is a wildcard.

So this filter is saying, "Show me layers that are not XREF"


There's all kinds of fun stuff you can do to create specific layer filters. I like to call it "Layer Fu."
# (pound)
Matches any numeric digit
@ (at)
Matches any alphabetic character
. (period)
Matches any non-alphanumeric character
* (asterisk)
Matches any string and can be used anywhere in the search string
? (question mark)
Matches any single character; for example, ?BC matches ABC, 3BC, and so on
~ (tilde)
Matches anything but the pattern; for example; ~*AB*matches all strings that don't contain AB
[ ]
Matches any one of the characters enclosed; for example, [AB]C matches AC and BC
Matches any character not enclosed; for example, [~AB]C matches XC but not AC
Specifies a range for a single character; for example, [A-G]C matches AC, BC, and so on to GC, but not HC
` (reverse quote)
Reads the next character literally; for example, `~AB matches ~AB

Thanks & have a wonderful long weekend,

No comments:

Post a Comment