• 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

VALUETALLY LISP: Count Attribute Values Into a Table

August 3, 2026

VALUETALLY counts how many times each distinct attribute value appears, and builds the result as an AutoCAD table.

What ValueTally does

Where TAGTOTAL adds numbers up, this counts occurrences — so it answers “how many of each type?” rather than “what do they come to?”. Point it at a drawing full of door blocks with a TYPE attribute and you get a door schedule: FD30 × 14, FD60 × 3, and so on.

Select the blocks, choose which tags to count from a filtered list, pick a point, and the table appears sorted alphabetically by value.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Go to the space you want counted — only the current one is included.
  3. Type VALUETALLY.
  4. Select the blocks, then choose the tags from the filtered list.
  5. Pick a point for the table.

How it works

Presetting the tags skips the dialog entirely. ValueTally:Tags can be filled in, which is useful for a command you run repeatedly on the same kind of block.

Entries are case-insensitive and may use wildcards, so DOOR* matches DOOR_TYPE and DOOR_REF alike. Leave it empty to always be asked.

ValueTally:Title and ValueTally:Headings control the table’s appearance — set the headings to a single-element list to omit the heading row altogether, which is what you want when the table is being placed inside an existing schedule frame.

Notes and limits

  • Only the current space is counted — model space when in model space, the active sheet when in paper space.
  • It counts occurrences, not values. Use TAGTOTAL to add numbers up.
  • Preset the tags for a command you run often.
  • Results are sorted alphabetically by value.

Download and details

NameValueTally — count how often each distinct attribute value appears
DownloadValueTally.lsp — 18.3 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandVALUETALLY
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 size18.3 KB, 476 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoThe whole operation is wrapped in a single undo group, so one U reverses all of it.
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

  • TAGTOTAL LISP — totalling numeric attribute values rather than counting them
  • STRINGTALLY LISP — counting text occurrences rather than attribute values
  • STATETALLY LISP — counting dynamic blocks by visibility state
  • 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