Numbering that has to be maintained by hand is numbering that eventually has a gap in it. AUTOTAG watches a set of blocks and renumbers the whole sequence whenever one is added, copied or erased — so it is always complete and always in order.
What AutoTag does
Insert another block and it takes the next number. Delete one from the middle and everything after it closes up. Copy three and they number themselves. Nothing is renumbered by hand.
This is what you want for grid references, pile numbers, tree tags and sample points — anything where the sequence must stay complete and in order, and where a missing number is a real problem rather than a cosmetic one.
Two commands control it: AUTOTAGON enables automatic numbering, AUTOTAGOFF disables it. Numbering is also enabled on load if AutoTag:Startup is set, so putting the file in your acaddoc.lsp makes it permanent.
How to use it
- Configure it first — see the note below. It ships pointed at a block called
myblockand a tag calledmytag, which will match nothing in a real drawing. - Load the routine with
APPLOAD, or put it on your support file search path. - Type
AUTOTAGONto start watching. - Work normally. Insert, copy and erase the blocks; the numbering keeps itself correct.
- Type
AUTOTAGOFFto stop.
How it works
There are two reactors, and the reason is worth understanding. An object reactor watches the numbered blocks for erase, copy and unerase. But it fires during a command, while the drawing is mid-edit and the database is not settled — renumbering at that moment would be unsafe.
So the object reactor does not renumber. It creates a command reactor, which fires once the command has finished and the database is stable. That second reactor does the renumbering and then removes itself. The work is deferred to the first safe moment rather than done at the first possible one.
The object reactor is also detached while renumbering runs. Without that, the changes it makes would trigger it again and recurse indefinitely.
Undo is deliberately ignored. A flag records when the UNDO command is running and suppresses renumbering while it is. Without that, undoing a deletion would be immediately followed by a renumber — which is not what anyone means by undo.
Both the block name and the tag name accept wildcards, so “GRID*” matches every block whose name starts with GRID.
Notes and limits
- Configure the settings block before using it. Out of the box it points at
myblockandmytagand will match nothing. This is deliberate — it cannot start renumbering something in your drawing by accident. - Blocks are numbered in database order, which is the order they were created, not their position on the sheet. If you need left-to-right or along-a-path numbering, this is the wrong tool — use
NUMINCinstead. - Reactors live for the session. Use
AutoTag:Startupandacaddoc.lspto make it permanent. - Turn it off before bulk edits you do not want renumbered, then back on afterwards.
Download and details
| Name | AutoTag — keep an attribute automatically numbered as blocks change |
| Download | AutoTag.lsp — 24.2 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Commands | AUTOTAGOFF, AUTOTAGON |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 24.2 KB, 585 lines |
| Error handling | None. |
| Undo | The whole operation is wrapped in a single undo group, so one U reverses all of it. |
| Compatibility | AutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer. |
| Author | YZ, August 2026 |
| Licence | Free to use, supplied “as is” with no warranty. |
References
- NUMSTAMP LISP — place incrementing numbers where you choose
- ATTCLONE LISP — match the formatting of the numbered attributes
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program