AutoLISP for AutoCAD

BLKBOM_

Block BOM Generator. Scans your entire drawing, groups instances by name and attributes, sums lengths, places a table with live block previews. Drop it in and run it.

Stable v1.1.0 MIT License AutoCAD 2010+
Michael Collins_  //  onthelevelconcepts.com
Commands

Three commands.

Command
What it does
BLKBOM
Scan drawing, pick extra attribute columns, set title, place table
BLKBOMREGEN
Rebuild existing BOM table in place -- no prompts, no re-picking the insertion point
BLKBOMSETTINGS
Configure sort field, sort order, and config file save location
Installation

Drop it in. Run it.

  1. Download BLKBOM.lsp
  2. In AutoCAD type APPLOAD at the command line
  3. Browse to BLKBOM.lsp and load it
  4. To auto-load: add it to the Startup Suite in the APPLOAD dialog
  5. Type BLKBOM -- it works
No setup required

On first run BLKBOM writes a config file and dialog definition to your AutoCAD Support folder automatically. Both are tiny, always overwritten, never accumulate.

Requirements

AutoCAD 2010 or later, Windows. Not compatible with AutoCAD LT or AutoCAD for Mac.

Block Setup

Three things to know.

1 // BOM ATTRIBUTE -- REQUIRED

Add an attribute to every block you want in the schedule. Everything else is silently ignored.

Tag: BOM   // case-insensitive
Value: YES   // case-insensitive -- yes, Yes, YES all work

2 // LENGTH -- OPTIONAL

BLKBOM looks for length in this order. Dynamic block parameter wins.

// 1. Dynamic block parameter named LENGTH (reads actual stretched value)
// 2. Block attribute with tag LENGTH (reads text value)

Accepted formats: 10'-0"   10'-6 1/2"   120   120.5
// Units auto-detected from INSUNITS. Output always architectural feet-inches.

3 // EXTRA ATTRIBUTES -- OPTIONAL

Any other attribute becomes a choosable column. When you run BLKBOM a dialog lists every attribute tag found across all BOM=YES blocks -- with the prompt text alongside. Check what you want, hit OK.

// Example dialog:

[ ] ENDEL      [ Ending Elevation ]
[ ] HEIGHT    [ Conveyor Height ]
[ ] STARTEL   [ Starting Elevation ]
Grouping Rules

How rows combine.

Rows combine when Block Name + all checked extra attributes match exactly. LENGTH is the only exception -- it always sums, never groups.

Blank matches blank

Two blocks with the same name where a chosen attribute is missing on both -- they combine into one row.

Different values = separate rows

If a checked attribute differs between two blocks of the same name, they each get their own row.

Table Layout

What gets placed.

Preview
Count
Name
Length
3
CONV-STRAIGHT
97'-0 25/32"
1
CONV-CURVE-90
--

With extra columns (appended alphabetically after Length):

Preview
Count
Name
Length
Height
2
CONV-STRAIGHT
18'-0"
36"
1
CONV-STRAIGHT
12'-0"
42"
Support Files

What gets written to disk.

File
Location
Purpose
BLKBOM_V1-1-0.cfg
AutoCAD Support folder
Sort settings. 2 lines. Always overwritten.
BLKBOM_V1-1-0.dcl
AutoCAD Support folder
Attribute picker dialog. Always overwritten.

Table handle and settings are stored inside the .dwg file itself in a named object dictionary -- no separate data file on disk. This means BLKBOMREGEN works correctly after saving and reopening the drawing.

Changelog

Version history.

v1.1.0 -- 2025
  • Fixed BLKBOMREGEN -- namedobjdict / dictsearch / entmakex replaces broken VLA xrecord read
  • Dynamic block LENGTH parameter support via vla-getdynamicblockproperties
  • Parameter wins over attribute when both exist
  • Attribute picker DCL uses action_tile callbacks for reliable toggle capture
  • Unit scaling moved to top-level function (nested defun not valid in AutoLISP)
  • Grouping key uses chr(1) string separator (assoc requires atom keys)
  • Folder browser opens at Windows default location
v1.0.0 -- 2025
  • First release
  • Full drawing scan, no selection prompt
  • BOM=YES attribute controls inclusion
  • Live block preview column via setblocktablerecordid
  • Architectural feet-inches output, auto-detects INSUNITS
  • DCL checkbox dialog for extra attribute columns
  • BLKBOMREGEN and BLKBOMSETTINGS commands
  • 32/64-bit safe ObjectID handling