You cannot turn off, freeze or change the color of a layer if the layer name contains the characters "#", "@", or "~" because these characters are wildcards in the new Layer Properties Manager.
To resolve this problem, use one of the following workarounds:
- Set the value of the LAYERDLGMODE variable to 0.
The Layer Properties Manager from previous versions of AutoCAD will be used instead, and these characters will not be considered wildcards.
- On the command line, enter VBASTMT and then paste the following code on the command line:
For Each myLayer In ThisDrawing.Layers: myLayer.Name = Replace(myLayer.Name, "@", "rpl"): myLayer.Name = Replace(myLayer.Name, "#","rpl"): myLayer.Name = Replace(myLayer.Name, "~","rpl"): next
This code iterates through the Layers database and replaces the characters "@", "#", and "~" with the string “rpl”, in the layer name.
If you want, you can use a different replacement string by replacing all instances of "rpl" in the above code with the desired string or character before pasting the code on the command line.