A drawing whose geometry sits millions of units from the origin behaves badly: snaps become unreliable, hatches fail, dimensions drift, and display artefacts appear at high zoom. STRAYHUNT finds the object causing it.
What StrayHunt does
Why it happens. Coordinate arithmetic is done in double precision, and the further from the origin you work, the fewer bits remain for the fractional part. Almost always the cause is not the drawing itself but one stray object — a point, a line, a piece of text — accidentally placed at some enormous coordinate, dragging the drawing extents out with it. ZOOM EXTENTS then zooms to a mostly empty rectangle and everything real becomes a dot.
Why this replaces a simple extents warning. Checking EXTMIN and EXTMAX and popping an alert tells you that you have a problem. It does not tell you which object causes it, and finding that by hand in a large drawing is genuinely difficult — the object is by definition somewhere you cannot see.
This examines every object individually, lists the offenders by type and layer with their coordinates, and offers to select them and zoom to them so you can deal with them.
STRAYHUNT finds and reports. STRAYCHECK is a silent check for loading at startup, printing a one-line warning only if there is something to report.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
STRAYHUNTwhen a drawing is behaving oddly, orZOOM EXTENTSshows mostly empty space. - Read the list of offenders — type, layer and coordinates.
- Accept the offer to select and zoom to them.
- Load
STRAYCHECKat startup to be warned automatically.
How it works
StrayHunt:Limit is the distance from the origin beyond which an object is considered stray.
The default of 1e8 is deliberately generous. Real survey coordinates can legitimately reach the millions, and flagging those would make the tool useless on exactly the drawings that need it most — a site plan on a national grid is not broken, it is just a long way from zero.
Lower it if you work purely in local coordinates, where anything past a few thousand units is genuinely suspect.
Notes and limits
- Tune the limit to how you work. 1e8 suits survey coordinates; lower it for local-coordinate drawing.
- STRAYCHECK is the one to autoload. It is silent unless there is a problem.
- It reports and navigates; it does not delete. Deciding what a stray object should become is yours.
- It changes nothing, so there is no undo group.
Download and details
| Name | StrayHunt — find objects sitting at absurd coordinates, and go to them |
| Download | StrayHunt.lsp — 11.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Commands | STRAYCHECK, STRAYHUNT |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 11.6 KB, 305 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
- SPYGLASS LISP — inspect what the stray object actually is
- STOPWATCH LISP — measure whether a drawing is slow, and where
- STARTUPBUILD LISP — load STRAYCHECK automatically for every drawing
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program