• 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

FIELDSNOOP LISP: Reveal the Formatting Code Behind a Field

August 3, 2026

Field formatting codes are short, cryptic and almost impossible to work out from the dialogs — things like %lu6%qf1 or %lu2%pr3%ps[,m2]. FIELDSNOOP takes a field that already displays exactly the way you want and tells you the code that makes it do so.

What FieldSnoop does

Pick the field, read the code, paste it into your own routine or into another field. Works on Text, MText, attributes, multileaders and dimensions.

This is the fastest way to learn field formatting at all: build one through the normal dialog until it looks right, then ask what it actually said.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type FIELDSNOOP.
  3. Pick an object containing a field.
  4. Read the reported code and reuse it.

How it works

A field is not stored in the text object you can see. The object holds a placeholder, and the real expression lives in an ACAD_FIELD dictionary hanging off it.

It gets worse. The expression can reference other fields, which live in their own dictionaries. And any expression longer than 250 characters is split across multiple DXF group 3 entries that have to be stitched back together.

So reconstructing the text of a field means reading the placeholder, walking into the dictionary, reassembling the split string, and then recursively resolving every nested field and object reference it contains. Three helper functions do that between them — which is why a job that sounds like “read a string” is 245 lines.

Notes and limits

  • The object must actually contain a field. Plain text has no code to report.
  • It reads and reports only. Nothing in the drawing is changed, so there is no undo group.
  • Nested fields are resolved recursively, so a field built from other fields still reports usefully.
  • Pair it with FIELDSTAMP. The code you find here is exactly the second argument that routine wants.

Download and details

NameFieldSnoop — report the formatting code of a selected field
DownloadFieldSnoop.lsp — 10.0 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandFIELDSNOOP
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size10.0 KB, 245 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

  • AREASTAMP LISP — build your own one-key field commands using the code you found
  • FORMATBRUSH LISP — copy formatting from one field to others without reading it
  • FIELDGRAFT LISP — copy the whole field, not just its formatting
  • 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