Sunday, March 5, 2017

Tilde conflict between AIA/NCS layer name specification and AutoCAD wildcards

National CAD Standard (AIA) layer name specification version 6 (2014) allows us to use only alphabetic and numeric characters and "~" (tilde) in layer names.  But the tilde has a wildcard meaning in AutoCAD.  What are we to do?

Tilde in NCS/AIA

In NCS/AIA, tilde is used to pad layer name groups that simply don't need 4 characters.  Examples include "PIT" and "TIP".

Tilde in AutoCAD

In AutoCAD, tilde is a wildcard character that means "anything except the following pattern".  If you were to use tilde in a layer selection string, AutoCAD would interpret it as a wildcard rather than a literal tilde unless you preceded it with a reverse quote (unshifted tilde), the "escape" character for AutoCAD wildcards.



We can ignore the fact that tilde is a wildcard.  This works fine for us at first until we need to use the tilde in a layer selection string.  It can complicate our life while we are drafting and programming.  And it does not "feel" right.  But it is a possible workaround.  In fact, depending on the community consensus, this may be the default workaround, and programmers may have to search for tildes in all layer wildcards and escape them with reverse quotes.  I would advocate against it because it is a hidden "gotcha" for drafters and programmers.

Alternate padding character

We can use a zero to pad groups.  This may not "look" very nice.  Examples would be "-0PIT-" or "-PIT0".

Repeat last character

We can repeat the last character.  Examples would include "-PITT-" and "-TIPP-".


I cannot find a web consensus.  But I am eager to see one emerge.  My inclination for now is to use initial zeroes, though my preference is weak.   What's your opinion?

No comments: