cadblockdwg

How-to guide · how to colour blocks bylayer vs byblock

Colour blocks with ByLayer and ByBlock in AutoCAD

DWGDXFFree1,117 words

By Saumyajit Maity · Published 9 May 2024 · Updated 9 May 2024

ByLayer and ByBlock are the two colour (and linetype and lineweight) settings that decide how a block looks once it is inserted, and getting them wrong is why a block sometimes ignores your layers or stubbornly stays the wrong colour. They are not difficult, but they behave differently, and understanding the difference is the key to building blocks that drop neatly into any drawing and obey your standards.

This guide explains what ByLayer and ByBlock actually mean, how a block's internal geometry inherits colour from each, when to choose one over the other, and how to draw a block so it behaves predictably wherever it is inserted. It is the conceptual backbone behind clean, reusable doors and furniture that always match the host drawing.

The examples lean on doors and furniture, since those are the library blocks where consistent, layer-driven colour matters most across many drawings.

What ByLayer means

ByLayer is the default and the workhorse. An object set to ByLayer takes its colour, linetype and lineweight from whatever layer it sits on. Put a line on a layer that is blue, and a ByLayer line is blue; move it to a red layer and it turns red. The layer drives everything.

For blocks, geometry drawn ByLayer on a named layer keeps that layer's properties when inserted, because the layer comes into the host drawing with the block. This is ideal when a block should always look a certain way regardless of the host — its appearance is locked to its own layers.

What ByBlock means

ByBlock is the chameleon. Geometry inside a block that is set to ByBlock has no colour of its own — it adopts whatever properties are current on the block reference as a whole. Insert that block on a red layer, or override the inserted block's colour to red, and the ByBlock geometry turns red to match.

This lets one block definition take on different colours in different places without editing the definition. A door drawn ByBlock can be black in one drawing and grey in another simply by changing the colour of the inserted reference or the layer it lands on, which is powerful for flexible libraries.

How geometry inherits colour through a block

There are three layers to the inheritance. Geometry can be ByLayer (follows its own layer), ByBlock (follows the inserted reference's properties), or an explicit colour like red (always red, ignoring both). When you insert a block, AutoCAD resolves these: ByLayer geometry keeps its layer colour, ByBlock geometry takes the reference's colour, explicit-colour geometry stays put.

The practical gotcha is geometry drawn with an explicit hard-coded colour. It never responds to layers or block overrides, so a door drawn in hard red will be red in every drawing forever. That rigidity is occasionally wanted but usually a mistake.

When to use ByLayer

Choose ByLayer when a block should always present the same way and you control the layers. Title-block parts, standard symbols and most architectural furniture and doors are good ByLayer candidates: draw them on clearly named layers (a furniture layer, a door layer) so every host drawing that uses them gets consistent colour and lineweight automatically.

ByLayer also plays nicely with layer freezing and standards — freeze the furniture layer and all the furniture blocks vanish for a clean structural plan. This is why ByLayer on sensible layers is the recommended default for a shared block library.

When to use ByBlock

Choose ByBlock when you want one definition that can wear different colours depending on context. A generic marker, a hatch pattern element, or a symbol you want to recolour per drawing without maintaining multiple definitions are classic ByBlock cases — set the geometry ByBlock and control its look from the inserted reference.

ByBlock is also the right setting for the elements of a block you intend to override on insertion. If you regularly drop the same block and tint it to suit each plan, ByBlock geometry makes that a one-property change on the reference rather than a block edit.

Drawing a well-behaved block

For most library blocks the reliable recipe is: draw the geometry ByLayer on meaningful named layers, and avoid hard-coded explicit colours unless a feature genuinely must always be one colour. That gives doors and furniture that obey the host drawing's standards and freeze cleanly with their layers.

Reserve ByBlock for the specific elements you want to recolour per insertion. Mixing the two deliberately — ByLayer for the structural outline, ByBlock for an accent you tint per drawing — gives a flexible yet predictable block. The mistakes to avoid are hard-coded colours sneaking in and geometry left on layer 0 with no thought, both of which make a block behave unpredictably across drawings.

There is one special case worth understanding: layer 0 itself. Geometry drawn on layer 0 and set to ByLayer behaves almost like ByBlock, because when the block is inserted onto another layer, that layer-0 geometry inherits the properties of the layer the block now sits on. This is a long-standing AutoCAD trick for making a block adopt the host layer's colour. It works, but it is easy to confuse with true ByBlock behaviour, so decide consciously which effect you want — host-layer inheritance via layer 0, or reference-driven inheritance via ByBlock — rather than relying on it by accident. Document your library's convention so everyone drawing blocks for it follows the same rule, and your doors and furniture will behave the same way no matter who built them.

Free download

Browse the full library — DWG & DXF, no signup.

Download CAD blocks

Questions

Frequently asked

What is the difference between ByLayer and ByBlock?+

ByLayer means an object takes its colour, linetype and lineweight from the layer it sits on. ByBlock means the object has no properties of its own and adopts whatever is current on the block reference it belongs to, so it can change appearance per insertion.

Why does my block ignore the layer I put it on?+

Its geometry was probably drawn with an explicit hard-coded colour rather than ByLayer or ByBlock. Explicit colours ignore both the layer and the block reference, so the geometry stays that colour everywhere. Set the geometry to ByLayer to make it follow its layer.

Which should I use for furniture and door library blocks?+

ByLayer on clearly named layers is the recommended default. It makes the blocks present consistently, obey the host drawing's standards, and freeze cleanly with their layers. Reserve ByBlock for elements you want to recolour per drawing.

How does ByBlock let one block show different colours?+

ByBlock geometry inherits its colour from the inserted block reference. Insert the block on a different-coloured layer or override the reference's colour, and the ByBlock geometry follows, so a single definition can appear in different colours across drawings without editing it.

Related downloads

Blocks for this guide

Popular blocks to download

Related categories

Related guides