• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

BLOCKTALLY LISP: Count Blocks and Build a Schedule

August 3, 2026

BLOCKTALLY counts every block in the drawing, or just the ones you select, and delivers the result as a real AutoCAD table, a text file, a CSV spreadsheet, or a listing at the command line. This is the door schedule, the fixture count and the furniture list — without selecting each symbol type in turn and reading numbers off the status bar.

What BlockTally does

The table output is the interesting one. Alongside each block name and quantity it can place a live preview of the block itself, so the schedule shows what each symbol actually looks like. Anyone reading the drawing can match the schedule to the plan without a legend.

Four output formats. Table places a real AutoCAD table in the drawing using the current table style, optionally with previews. Text file is tab-separated for pasting into anything. CSV opens directly in Excel. Command line gives a formatted listing with dot leaders in the text window, for a quick look without creating anything.

The CSV uses the list separator from your own Windows regional settings, so it imports cleanly in every locale rather than only in the one it was written in.

Headings, column titles, sort field and sort order are configurable through BLOCKTALLYSET and remembered between sessions.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Run BLOCKTALLYSET once to choose the output format, headings and sort order. The settings persist.
  3. Type BLOCKTALLY.
  4. Count everything, or select the blocks to count.
  5. For table output, pick the insertion point.

How it works

Xrefs are excluded. An external reference is an insertion in the DXF sense, but nobody wants SITEPLAN.dwg × 1 in a fixture schedule. Xrefs are identified from the block table and filtered out before counting.

Dynamic blocks count under their real name. A dynamic block whose parameters have been changed is stored under an anonymous name such as *U47. Counting those literally would scatter one door type across twenty meaningless entries. Each anonymous name is traced back to the definition it came from, so all twenty count as one door. Without that, a schedule of a modern drawing is nonsense.

The preview column. A table cell can be told to display a block instead of text, by being given the object ID of that block’s definition. Each block is looked up in the drawing’s block collection and the cell handed its ID, with auto-fit on so the preview scales itself to the cell.

Object IDs are the one genuinely awkward corner of the AutoCAD ActiveX interface: on 64-bit AutoCAD they do not fit in the integer type the original property returns. The routine works out once which of the three possible retrieval methods this installation supports, then rewrites itself to use only that one — so the test is paid for once rather than on every cell.

Notes and limits

  • Set it up with BLOCKTALLYSET first. Output format, headings and sort order all live there.
  • Previews need the table style to allow block cells. The preview column uses the current table style, so check it renders how you want on one schedule before doing forty.
  • Xrefs are not counted — deliberately. If you want an xref inventory, that is a different job.
  • Anonymous dynamic block names are resolved, so counts reflect real block types rather than parameter states.

Download and details

NameBlockTally — count blocks and produce a schedule
DownloadBlockTally.lsp — 44.1 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandsBLOCKTALLY, BLOCKTALLYSET
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com); nothing extra — the dialog is written to a temporary file at run time and deleted again, so there is no .dcl to install.
Source size44.1 KB, 1,090 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoNot needed — this routine only reads the drawing and changes nothing.
CompatibilityAutoCAD (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.
AuthorYZ, August 2026
LicenceFree to use, supplied “as is” with no warranty.

References

  • BLOCKPURGE LISP — remove the blocks the count shows you do not need
  • AREATABLE LISP — the same idea for areas rather than blocks
  • DEEPCOUNT LISP — counting that follows nesting
  • More free AutoLISP routines on this site
  • Wisey’s Steel Shapes — free structural steel section drawing program

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in