• 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

TAGBATCH LISP: Set Attribute Values Across Many Drawings

August 3, 2026

Build a list of “in this block, set this tag to this value”, choose the drawings, and TAGBATCH applies the lot to every one of them. This is the revision letter that has to change on ninety title blocks, the project name that was wrong on every sheet, the drawn-by initials that need swapping when a job changes hands.

What TagBatch does

Block names can be patterns. The name accepts AutoCAD wildcards, so one entry covers a family of blocks sharing a tag: TITLE*, *BORDER*, A1-TB,A3-TB, or * for every attributed block. Dynamic blocks are matched on their effective name, so the anonymous *U27 names never have to be dealt with.

The value can be more than a fixed string. Three operators can appear anywhere inside it and can be combined with each other and with ordinary text.

<[TAG]> is the current value of another attribute in the same block — so a DESCRIPTION tag set to <[NUMBER]> - <[NAME]> makes each block fill in its own values.

<L#n#L> is n plus the layout number, counting from zero in tab order. <D#n#D> is n plus the drawing number, counting through the drawings in the order you listed them. Combining the two numbers every sheet of every drawing uniquely.

How to use it

  1. Test on a copy of the folder first. See the warning below.
  2. Load the routine with APPLOAD, or put it on your support file search path.
  3. Type TAGBATCH.
  4. Build the list — type it, use Select Blocks to read tags off blocks on screen, or load a CSV of block, tag and value.
  5. Choose the drawings.
  6. Read the report of any files that were locked and skipped.

How it works

Unlike most batch tools, TagBatch does not use ObjectDBX. It writes a script that opens each drawing properly, applies the changes, saves and closes.

That is a deliberate trade. Opening each drawing is slower, but it is the only way the counting operators can work: the layout counter needs the real tab order, and both counters need to carry from one drawing to the next. The running counts are kept on the LISP blackboard, which is the one piece of memory that survives a drawing being closed.

Three files are produced in the AutoCAD support folder: a script that drives the run, a small LISP file the script loads into each drawing holding the code that does the work, and a settings file remembering the list and folder for next time.

Building the list has three routes and they mix freely. Type it into the three boxes. Or use Select Blocks, which reads every attributed block you select and offers its tags and current values as a checklist — far quicker than typing, and it cannot misspell a tag. Or load a CSV of three columns, which Save writes back, so a list built once is reused on every project.

The same block and tag cannot appear twice; duplicates are found and reported rather than silently applied in an unpredictable order.

Notes and limits

  • Every listed drawing is opened, modified and SAVED. There is no undo across files. Test on a copy of the folder first. Every time.
  • Files open elsewhere are detected and skipped. Each drawing is checked for a lock file before the run, and any that are in use are listed rather than failing part-way through.
  • Counters start at whatever you type. <D#100#D> numbers a hundred drawings from 100 upwards.
  • Duplicates are rejected, not merged. One value per block-and-tag.

Download and details

NameTagBatch — set block attribute values across many drawings
DownloadTagBatch.lsp — 114.4 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandTAGBATCH
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 size114.4 KB, 2,405 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

  • ATTPULL and ATTPUSH LISP — the ObjectDBX approach, faster but without counters
  • SHEETFILL LISP — filling title blocks from a CSV register instead
  • TAGTWEAK LISP — editing one attribute across a single drawing
  • 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