BIM

Layers in AutoCAD: a standard layer set, locked layers and deleting layers

Layers in AutoCAD control colour, linetype and lineweight. Covers a standard layer set for building work, locked layers, and why a layer will not delete.

  • Dr. Do Quoc Hoang
  • 15 min read
Eleven numbered layers, enough for a house drawing set and extendable for larger work Photo: Diagram by the Institute of Information Technology in Civil Engineering

Layers in AutoCAD are where a drawing keeps its information. A line on a layer called 01-TUONG tells whoever reads the drawing that it is a wall, even though the line itself carries nothing.

A layer also holds three display properties: colour, linetype and lineweight. Giving those to the layer rather than to each line is the only way to keep a drawing consistent once a set runs to hundreds of sheets. To learn modelling and documentation end to end, see the AutoCAD for construction course.

Layers in AutoCAD and the Layer Properties Manager

The LAYER command, aliased LA, opens the layer manager. It is a floating palette rather than a dialog box, so it can stay open all day.

The Layer Properties Manager Photo: The Layer Properties Manager with a sample layer set. The three numbered areas are the four status columns, the three property columns, and the count at the foot of the palette

What the numbers mark:

No.ElementWhat it is
1Four status columnsOn, Freeze, Lock and Plot. They decide whether a layer shows, is regenerated, can be edited, and prints
2Three property columnsColor, Linetype and Lineweight. Every object on the layer inherits these while set to ByLayer
3The count at the footLayers shown out of layers in total. The drawing here has 12 layers: layer 0 and eleven numbered layers

The buttons at the top left fall into two groups. The left group filters and saves states; the right group creates, deletes and selects layers.

ButtonShortcutWhat it does
New Property FilterAlt+PFilters layers by one or more properties
New Group FilterAlt+GCreates a group you drag layers into by hand
Layer States ManagerAlt+SSaves the whole layer setup under a name
New LayerAlt+NCreates a layer that inherits the properties of the selected one
Delete LayerAlt+DDeletes only a layer nothing uses
Set CurrentAlt+CMakes the selected layer current, which sets the CLAYER variable

Autodesk's LAYER page documents the command.

Creating layers and a standard layer set for a building drawing

New Layer immediately produces a layer called LAYER1 with the name highlighted for typing over. The new layer inherits the properties of whichever layer is selected, so select something close to what you want before clicking.

No national standard governs layer names in Vietnamese drawing sets. But four principles turn up in every office that has been doing this for a while.

PrincipleReason
Put digits at the frontTwo leading digits keep the list sorted by trade order rather than alphabetically
No accented charactersAccented names work, but they break when the file opens on another machine or exports to other software
Use hyphensEasier to read than underscores, and never confused with a space
One layer, one jobDo not put walls and doors on the same layer. Separating them is what makes switching and restyling possible

The layer set in the image at the top of this article follows all four. Its lineweights follow the scale familiar from building drawings: cut lines heaviest, visible lines medium, secondary and dimension lines lightest. The ratio between heaviest and lightest is about four to one, which is enough for the eye to separate them in print.

The four status columns, layer 0 and Defpoints

The four leading columns look alike but do four different jobs.

ColumnMeaning
OnOff means the layer vanishes from screen but is still regenerated with the drawing
FreezeThe layer vanishes and is not regenerated either. On a heavy drawing, freezing is quicker than turning off
LockThe layer still shows but is faded, and editing commands cannot touch it
PlotWhether it prints. The layer still shows on screen but never reaches paper

Two layers are special and worth knowing about before anything else.

Layer 0 is AutoCAD's own layer. It cannot be deleted or renamed. Do not draw documentation on it: it exists for building blocks, because geometry drawn on layer 0 takes the colour and linetype of whichever layer the block is inserted onto.

The Defpoints layer is created automatically the first time a drawing gets a dimension, to hold the definition points of dimension lines. It arrives with its Plot column already off, so it never prints.

The Plot and Transparency columns Photo: The printer icon on row 08-GHI-CHU carries a red circle because the user switched it off. The printer on the Defpoints row is greyed out instead, meaning that cell is locked. Row 06-HATCH has transparency set to 70

The difference between those two printer icons matters. The red circle is a user choice, and clicking it again turns printing back on. Greyed out means the cell is locked: set Defpoints to print and the software accepts the command without changing anything.

Plenty of people borrow Defpoints as a non-printing notes layer. It is a familiar trick but not a clean one, because that layer belongs to the dimensioning machinery. Making your own layer and switching its Plot column off is clearer, and costs one click.

The Transparency column takes a value from 0 to 90. Where a floor hatch sits over wall lines, setting the hatch layer to somewhere between 60 and 80 keeps the lines underneath readable while the material still reads.

Locked layers: faded does not mean locked

The word "locked" suggests the layer is frozen solid. It is not, and the difference decides how you work day to day.

Lock a layer, then run ERASE and drag a crossing window over objects on that layer and on another. The software answers with two lines:

1 found

1 was on a locked layer.

Read both. The first line belongs to the selection step, the second to the filtering step. The window really does catch the object, and only then does the software drop it from the selection set. Seeing 1 found and pressing Enter without reading the line below leaves you believing something was erased when the drawing is untouched.

A locked layer fades Photo: The same drawing twice. On the left the layer carrying the hatch is normal; on the right that layer is locked, so the hatch fades. The two green objects sit on another layer and keep their full strength

How much it fades is set by LAYLOCKFADECTL, which defaults to 50 and accepts whole numbers from minus ninety to ninety. Measuring the brightness of a solid fill on a 255 scale gives this:

ValueWhat you seeBrightness
unlockedThe reference255
0No fading at all255
20Slightly paler212
50The default147
90The palest allowed60
minus 50Remembers fifty but switches the effect off255

The three middle figures are not arbitrary. The drawing background works out to a brightness of 39, and the blend is 255 × (1 − f) + 39 × f, where f is the variable divided by a hundred. Put 0.2 in and you get 211.8; 0.5 gives 147.0; 0.9 gives 60.6.

The negative value is the trick worth remembering. Set LAYLOCKFADECTL to minus fifty and locked layers draw at full strength again, while the variable still remembers fifty.

And here is the point of the whole section. Lines going back to full strength does not mean the layer is unlocked. Fading is only a signal to the eye; the editing block lives in the Lock column. The two are separate, and people routinely mistake them for one thing.

Eight quick layer tools, and three easily confused commands

The Layers panel carries eight small buttons in two rows. Each is a command whose name begins with LAY, and all eight work the same way: you point at an object instead of typing a layer name.

CommandWhat it does
LAYOFFTurns off the layer of the object you pick
LAYISOKeeps the layer of the picked object, and locks and fades the rest
LAYFRZFreezes the layer of the object you pick
LAYLCKLocks the layer of the object you pick
LAYONTurns every layer back on
LAYUNISORestores the state from before isolating
LAYTHWThaws every layer
LAYULKUnlocks the layer of the object you pick

LAYISO is regularly misunderstood. It does not turn the other layers off; it locks and fades them, so their lines stay faintly visible as snapping references. The command's first line says so: Current setting: Lock layers, Fade=50. Type S for Settings to change that, choosing between turning layers off, freezing them in the current viewport, or locking and fading. See the LAYISO page.

The command that reverses it is LAYUNISO, and it is not an undo stack. Call it once and every layer returns. Call it again straight away and the software replies No layers to restore from LAYISO command, exactly what it says when nothing was ever isolated. To isolate several layers at once, pick objects from all of them in a single call.

These next three sound alike and are the set most often called by mistake.

CommandWhere the target layer comes fromWhat changes
LAYMCHAn object you pickThe selected objects change layer
LAYCURThe current layer, with nothing else askedThe selected objects change layer
LAYMCURAn object you pickThe current layer changes; no object is touched
Fixing objects drawn on the wrong layer Photo: On the left, three white rectangles sit on the wrong layer while the fourth is on the right one. On the right, after the command, all four share a colour and therefore a layer

The software separates them for you in its closing line. LAYMCH ends with 3 objects changed to layer "03-CUA", while LAYCUR adds (the current layer). Reading the last line tells you which one you just ran.

LAYMCUR has one habit worth knowing. It accepts an object on a locked layer without a word of warning. You can then keep drawing, and the new lines land on that locked layer. What you cannot do is erase what you just drew, because editing is still blocked by the Lock column.

How to delete a layer in AutoCAD, and why it refuses

This is what people search for most around layers, and it is also where drawings get lost.

The Delete Layer button only removes an empty layer. A layer still holding objects is refused, so clicking it by accident costs nothing. LAYDEL is a different matter: Autodesk describes it as "Deletes all objects on a layer and purges the layer". The LAYDEL page adds that it also modifies any block definition using that layer.

The LAYDEL dialogs Photo: On the left, the Delete Layers box with the first entry in the list already selected. On the right, the confirmation, which states plainly that objects on the layer will be deleted too

Two details there deserve a pause. First, the left-hand box preselects the first entry in the list, not the layer you had in mind; clicking OK out of habit can take out your grid layer and everything on it. Second, the confirmation says outright that all objects on the layer, or referencing it, go as well.

The safe way to run it is to point at an object in the drawing rather than open the box. The command then asks at the command line, prints a warning carrying the word WARNING, and asks Do you wish to continue? [Yes/No] <No>. The default is No, so pressing Enter to hurry through cancels rather than deletes.

Five reasons a layer will not delete Photo: Five cases that come up when a layer refuses to be deleted, and what to do about each

For bulk cleaning use PURGE, aliased PU, then pick Layers and Purge All. It only removes layers nothing refers to, which makes it far safer than LAYDEL. The command-line version is -PURGE, handy inside a script. See the PURGE page.

Merging layers, the Layer States Manager and LAYWALK

Drawings that arrive from elsewhere usually carry several layers doing one job under different names. LAYMRG merges them. Autodesk puts it as "Objects on merged layers are moved to the target layer, and the original layers are purged from the drawing". See the LAYMRG page.

The command asks twice: the layer to merge, then the target. Both are picked with the mouse, and both offer a Name option that opens a dialog. That dialog preselects the first entry in the list just as LAYDEL does, so type the name into the field before clicking OK.

Drawing a plan means turning the ceiling layer off. Drawing the ceiling means turning off sanitary ware and turning on lighting. Switching a dozen layers by hand every time you change task guarantees something gets missed. LAYERSTATE solves it.

The Layer States Manager Photo: The Layer States Manager with one saved state. The four numbered areas are the list of states, the button column, the restore options, and the current state line

What the numbers mark:

No.ElementWhat it is
1The Layer states listOne row per saved state, with the space it was saved in and a column showing whether it still matches the drawing
2The button columnNew saves the current layer setup, Update overwrites, Edit and Rename adjust, Delete removes. Import and Export exchange states with other drawings
3The Restore options blockTurn off layers not found in layer state is ticked: layers added after saving are switched off on restore
4The Current layer state lineReads *UNSAVED* until a state is restored. Pick a name, click Restore, and every layer returns to that state

This command has no command-line version. Type -LAYERSTATE and the software answers Unknown command. Saving a layer state from a program means calling an AutoLISP function instead.

One more command suits a strange drawing carrying dozens of unexplained layers: LAYWALK. Its box lists every layer, and clicking each name in turn shows what that layer holds. Restore on exit is ticked by default, so closing the box puts everything back.

Frequently asked questions

Which command opens the layer palette?

LAYER, aliased LA. What opens is a floating palette, so it can stay open for the whole working session.

Why will a layer not delete?

Five cases come up: layer 0, the Defpoints layer, the current layer, a layer still holding objects, and a layer that came in with an attached drawing. The last three can be worked around; the first two cannot.

How do I remove unused layers?

Run PURGE, pick Layers and choose Purge All. It only removes layers nothing refers to, which makes it safe. The command-line version is -PURGE.

What is the difference between the Delete Layer button and LAYDEL?

The button only removes an empty layer and refuses one that still holds objects. LAYDEL removes the objects and the layer, so a mistaken click costs part of the drawing.

My locked layer draws at full strength. Is it unlocked?

No. Fading is controlled by LAYLOCKFADECTL, and a negative value switches the fading off while the layer stays locked. The editing block lives in the Lock column, not in the fading.

How do I merge two layers into one?

Run LAYMRG, pick an object on the layer to merge, then an object on the target layer. The objects move across and the original layer is purged from the drawing.

About the author

Dr. Do Quoc Hoang — Deputy Director of the Institute of Information Technology in Civil Engineering – Hanoi University of Civil Engineering, and a specialist in software development for construction