Last updated July 28, 2026
You have inherited a drawing full of blocks whose contents were drawn on named layers in explicit colours. Every time you insert one it ignores the layer you put it on and appears in whatever colour it was built with. The correct fix is to have the block’s contents on layer 0 with colour BYLAYER, so the block takes on the properties of wherever you insert it — but doing that means exploding, changing, reblocking, and redefining, for every block.
These two routines do it without exploding anything. They reach into the block definition itself, change the layer or colour of every entity inside it, and update the drawing. Every insertion of that block updates at once, because the definition is what changed.
They are by Caren Lindsey, the layer one dated June 1993 and the colour one July 1996.
The two commands
- UPDBLKLY — sets every entity in the selected blocks to one layer that you name. If the layer does not exist it offers to create it. Colours are left alone.
- UPDBLKCL — sets every entity in the selected blocks to one colour number. Layers are left alone. It shows a colour number table on screen if you ask for it or type something out of range.
Worth being precise here, because the bundled description reads as though the layer routine also changes colours to BYLAYER. It does not. Reading the code, UPDBLKLY touches the layer and nothing else; colour is the other routine’s job. To get the usual result — contents on layer 0, colour BYLAYER — run UPDBLKLY with layer 0, then UPDBLKCL with colour 256, which is the number for BYLAYER.
The colour table the routine prints is a useful reminder of the two special numbers: 0 is BYBLOCK, 256 is BYLAYER, and 1 to 255 are the ordinary colours.
This changes the block definition
The author puts this in the file in capitals, and it deserves repeating. You select one insertion, but every insertion of that block in the drawing changes, because the block definition is what gets edited. That is the entire point — it is what makes the routine worth having — but it means a stray pick has drawing-wide consequences.
Two things follow. Work on a copy the first time, and regenerate afterwards so you are looking at the updated definitions rather than a stale display. And note that it steps through the entities in the block definition directly, so a nested block inside your block is treated as a single entity: its own contents are not visited. For nested blocks, run the command again picking the nested one.
Both routines install an error handler that restores the previous one if you cancel, so a Ctrl-C partway through leaves your session tidy — though it does not undo the entities already changed. There is no undo grouping, so putting a half-finished run back means several presses of U.
How to load it
Updblock.zip contains the two files, UPDBLKLY.LSP and Updblkcl.lsp. Load whichever you need with APPLOAD, or both. There are no support files. Our AutoLISP guide covers loading.
Step-by-step usage
- Work on a copy of the drawing.
- Type UPDBLKLY. At “Enter new layer name:” type the layer — usually 0. If it does not exist you are asked whether to create it.
- At “Pick blocks to update.” select one or more block insertions. Only insertions are accepted; anything else in your selection is filtered out.
- Then type UPDBLKCL and enter 256 for BYLAYER at the colour prompt, and select the same blocks.
- Regenerate. Every insertion of those blocks now follows the layer it sits on.
Compatibility notes
Dated 1993 and 1996, so written-for rather than tested-on. They work by reading and modifying entity data directly, which is long-standing practice that has not changed, and they drive no commands other than LAYER, so there is a reasonable chance they still behave on a current release — but test on a copy before trusting them with a library.
Plain AutoLISP with no dialog boxes and no Express Tools calls, so nothing in them requires the full product; LT users on LT 2024 or later, the release that brought AutoLISP to LT, should be able to run them. See what runs on AutoCAD LT.
Download
| Name: | UPDBlock |
| Description: | This file contains 2 block updating lisps; Updblkly.lsp – This routine allows the user to update the layer of all entities within a block to a single layer (exam: layer=0) without the user having to explode the symbol. By default the color of all entities are changed to BYLAYER. The routine changes the original definition of the block within the current drawing. Updblkcl.lsp – This routine allows the user to update the color of all entities within a block to a single color (exam: color=BYLAYER) without the user having to explode the symbol. By default the layer name of all entities are NOT changed. The routine changes the original definition of the block within the current drawing. |
| Type: | AutoCAD AutoLISP Routine |
| Author: | Caren Lindsey |
| File Size: | 4 Kb |
| Cost: | Free |
| Worked on: | AutoCAD |
| Download File: | Updblock.zip |
Related routines
- Fixblock — another block maintenance routine.
- Auto Block Rename — bring block names into line with a standard.
- WBLKALL — export the cleaned-up blocks to a library folder.