Draw one parking bay labelled BAY 01, array it fifteen times, and an ordinary array gives you fifteen copies of BAY 01. COUNTARRAY gives you BAY 02 through BAY 16.
What CountArray does
The same applies to grid references, pile numbers, column marks, drainage manholes — anything that runs in sequence and would otherwise be renumbered by hand afterwards.
Two commands. COUNTARRAY is the standard one: fast, no preview. COUNTARRAYLIVE shows the array updating as you drag, but is noticeably slower because it rebuilds every copy on every mouse movement. Fine for a handful of objects, painful for hundreds.
What gets incremented: text, MText, attribute definitions, multileaders, dimension override text, and the attributes inside arrayed blocks.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
COUNTARRAY, orCOUNTARRAYLIVEfor a live preview. - Give the increment. 1 is the default and is remembered between sessions;
-1counts down;0.5works too. - Select the objects to array — anything except viewports.
- Pick a base point, then a second point defining the array vector. That vector sets both the direction and the spacing, so a shorter vector produces a denser array.
- Drag to set how far the array runs, and click.
How it works
Every number found anywhere in the text is incremented and the rest of the string is left alone. So BAY 01 OF 20 increments both figures — which is usually what you want on a sheet label, and is worth knowing about before you use it on text where it is not.
Leading zeros are preserved, so 007 becomes 008 rather than 8 — but only where the original actually had them. A plain 7 becomes 8, not 08. The routine matches what it found rather than imposing a format.
A note on the rounding, which matters more than it sounds. DIMZIN is forced to 0 during the operation and restored afterwards. Without that, repeatedly adding a value accumulates floating-point drift, and an array counting up in ones starts producing 44.0000001 somewhere in the forties. It is the sort of fault that appears only on long runs, which is exactly when nobody is checking every label.
Notes and limits
- All numbers in the string increment, not just the first. Check your text before arraying something like
TYPE 2 BAY 01. - COUNTARRAYLIVE rebuilds everything on every mouse move. Use the plain command for large selections.
- The array vector sets the spacing, not just the direction. Pick the second point at the spacing you want.
- Viewports cannot be arrayed. Everything else can.
Download and details
| Name | CountArray — array objects while incrementing the numbers in their text |
| Download | CountArray.lsp — 20.3 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Commands | COUNTARRAY, COUNTARRAYLIVE |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 20.3 KB, 482 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| 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
- AUTOTAG LISP — numbering that maintains itself as blocks are added and erased
- NUMSTAMP LISP — place incrementing numbers one at a time
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program