• 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

SPYGLASS LISP: Live Object Inspector With a Cursor Ring

August 3, 2026

Run SPYGLASS and a green ring follows your cursor. Sweep it over the drawing and every object it touches reports itself in a floating label: type, layer, colour, linetype, lineweight, and whatever else is relevant — radius for a circle, length for a line, area for a closed polyline, the full attribute list for a block.

What SpyGlass does

No clicking, no dialog, no Properties palette taking up half the screen. You move the mouse and the drawing explains itself.

The second mode turns the same ring into a layer isolator. Click any object and every layer except its own is switched off, so you can see one system at a time in a crowded drawing. Shift-click puts them all back.

Controls: move the mouse to inspect, TAB switches between inspect and isolate, + and - resize the ring, Enter, Space or Escape finish.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type SPYGLASS.
  3. Sweep the ring over the drawing. Objects report themselves as it touches them.
  4. Press TAB to switch to layer isolate, then click an object to isolate its layer.
  5. Shift-click to switch every layer back on. Press Enter or Escape to finish.

How it works

The whole command lives inside a grread loop, which reports mouse movement and keystrokes continuously without ending. Two temporary entities are created up front on a scratch layer: a circle, which is the visible ring, and an MText, which is the floating label. On every mouse move both are repositioned by editing their entity data directly with entmod and entupd — far faster than erasing and recreating them, which is what makes the display keep up with the cursor.

Detection is two-stage, and both stages are necessary. A crossing-window selection over the ring’s bounding square finds the handful of candidates cheaply. Then each candidate is tested with IntersectWith against the ring itself, so only objects the ring genuinely crosses are reported. Stage one alone would report anything in the square’s corners; stage two alone would mean testing every object in the drawing on every mouse move.

Property reporting walks a table rather than testing types. The inspector goes through a list of property names and asks each object whether it has that property. A circle answers to RADIUS and AREA but not TEXTSTRING; a line answers to LENGTH but not RADIUS. Nothing needs to know in advance what it is looking at, and an object type nobody anticipated still reports everything it can.

A few properties get special treatment because their raw values are meaningless to read: colour and lineweight are enumerations that need naming, angles need formatting to the drawing’s angular units, and justification codes need looking up.

Notes and limits

  • An object entirely inside the ring is not reported, because it does not intersect it. Shrink the ring with - and it will be picked up.
  • Shift detection needs Express Tools. Without it, TAB back to inspect mode and re-run, or use LAYON.
  • Everything is restored on exit — ring size, mode, and the layers that were on when the command started — including after an error or a cancel.
  • Blocks report their effective name, insertion count, whether they are dynamic or an xref, and every attribute value.

Download and details

NameSpyGlass — hover over objects to inspect them, or isolate their layers
DownloadSpyGlass.lsp — 34.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandSPYGLASS
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size34.6 KB, 830 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

  • XRAY LISP — the full property list of one object, in detail
  • STRAYHUNT LISP — finding objects that do not belong
  • LAYERHARVEST LISP — auditing layers across a whole folder
  • 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