Last updated July 27, 2026
FixBlock is a free AutoLISP routine that fixes one of the most common problems with AutoCAD blocks from outside sources: internal geometry drawn on hard-coded layers with fixed colours and linetypes. Pick a block and the routine rewrites its definition so that every sub-entity sits on layer 0 with colour and linetype set to ByBlock, while the block insert itself stays on its original layer.
The layer 0 and ByBlock convention is what lets a block take its display properties from wherever it is inserted. Blocks built any other way ignore the layer they sit on and fight your layer standards, and redefining them by hand is tedious. FixBlock is the quick alternative, and one of many free routines in our LISP routine library.
What FIXBLOCK does in practice
Walking through the code, a single run does the following:
- Moves every sub-entity in the selected block’s definition to layer 0.
- Sets each sub-entity’s linetype to ByBlock, adding the property where an entity does not carry one.
- Sets each sub-entity’s colour to ByBlock, again adding the property where it is absent.
- Gives the same layer, colour and linetype treatment to the attributes on every insertion of that block name in the drawing.
- Leaves each block insert on the layer it was originally placed on.
- Regenerates the drawing so the change shows straight away.
Because FIXBLOCK edits the block definition itself, every insertion of that block name updates, not just the one you picked. The routine also carries some sensible guards. It checks that your pick really is a block and stops with an alert if it is not, it refuses to touch xrefs, and it saves and restores the CMDECHO system variable around the run. The work is opened as an UNDO group, and a built-in error handler backs the changes out if something goes wrong mid-run.

Command reference
The file defines a single command.
FIXBLOCK— prompts for one block reference, then resets the layer, colour and linetype of everything inside that block’s definition, including its attributes.
The remaining defuns in the file (the main worker, an attribute updater, system variable save and restore helpers, and an error handler) are internal and are not called directly. The author is listed as Anon, and the only credit in the file is a revision note dated 3 December 2003, initialled YZ, recording that the program was changed to work from a keyword on the command line.
How to load it
Download and extract Fixblock.zip, then load FIXBLOCK.LSP with the APPLOAD command. To have it available in every session, add the file to the Startup Suite in the same dialog. If you are new to loading LISP files, our AutoLISP guide covers loading and the basics of the language.
Step-by-step usage
- Type
FIXBLOCKat the command line. - At the prompt Select block to change : pick one block reference.
- The command line reports Processing block: followed by the block name, then Updating blocks sub-entities. . . with a dot printed for each entity processed.
- Updating attributes. . . follows while the attributes on every insertion of that block name are updated.
- The drawing regenerates and the routine reports that it is done.
FIXBLOCK handles one block name per run, so run it again for each block you want to clean up. Once a block is fixed, put the inserts on the layers they should follow and control colour and linetype through those layers, or through the insert’s own property overrides.
Compatibility notes
The listing below records that the routine worked on AutoCAD 2006, and the revision history in the file dates to 2003, so treat it as written for releases of that era rather than tested on anything current. It is, however, plain AutoLISP throughout: standard entity access, no DCL dialog files and no Express Tools (acet-) functions. AutoLISP has shipped with every full version of AutoCAD for decades, and AutoCAD LT gained AutoLISP support in LT 2024 — see what runs on AutoCAD LT for where the limits sit.
Two cautions. The routine changes the block definition for the whole drawing, so every insertion of the selected block name is affected. It also deliberately refuses xrefs — edit those in the source drawing instead.
Download
| Name: | Fix Block |
| Description: | Changes selected blocks sub-entities to layer 0 with color ‘byblock’ but does not change the inserted layer original layer. |
| Type: | AutoCAD AutoLISP Routine |
| Author: | Anon |
| File Size: | 2 Kb |
| Cost: | Free |
| Worked on: | AutoCAD 2006 |
| Download File: | Fixblock.zip |
Related routines
- Block Rename — tidy up block names as part of the same clean-up pass.
- Block Count — tally the block insertions in a drawing.
- WBlock All — write a drawing’s blocks out to separate files.