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
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
FIELDSNOOP. - Pick an object containing a field.
- 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
| Name | FieldSnoop — report the formatting code of a selected field |
| Download | FieldSnoop.lsp — 10.0 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | FIELDSNOOP |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 10.0 KB, 245 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | Not needed — this routine only reads the drawing and changes nothing. |
| Compatibility | AutoCAD (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. |
| Author | YZ, August 2026 |
| Licence | Free 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