AutoCAD gives you window and crossing selection, but both are rectangles. When the boundary you care about is an irregular site outline, a room, a zone or a circle, you are reduced to a fence or a lot of shift-clicking. CORRAL traces the boundary you point at and builds a WPolygon selection from it.
What Corral does
Two ways to use it. Type CORRAL at the command line and the objects inside the boundary are selected and gripped, ready for the next command.
Or type 'CORRAL transparently at any Select objects: prompt, and the enclosed objects are fed straight into the command already running. ERASE, COPY, MOVE and the rest can all use it as a selection method — which is where it earns its keep, because you are not selecting first and then deciding what to do.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
CORRALto select and grip the contents of a boundary. - Or start any command, and at the Select objects: prompt type
'CORRAL— with the leading apostrophe. - Pick the polyline or circle to use as the boundary.
How it works
The picked boundary is traced and its vertices used to build a WPolygon selection — the polygon equivalent of a window, which AutoCAD supports but does not make easy to drive from an existing object.
The CMDACTIVE test is what distinguishes the two modes. If no command is running, the routine starts its own SELECT to collect the objects. If one is running, it feeds points into the selection prompt already waiting. One routine, two behaviours, decided by asking AutoCAD what state it is in.
It deliberately does not open an undo group. The routine only selects — it never modifies the drawing — so an undo group would push an empty entry onto the undo stack. Worse, when used transparently it would corrupt the undo record of the host command, so that undoing the ERASE you just did would not behave properly. Not opening one is the correct decision, not an omission.
Notes and limits
- The boundary must be a polyline or a circle. It is traced as picked, so it needs to be a real closed object.
- WPolygon selects what is fully inside. Objects crossing the boundary are not caught — that is window behaviour, not crossing.
- The leading apostrophe matters for transparent use:
'CORRAL, notCORRAL. - It changes nothing, which is why there is deliberately no undo group.
Download and details
| Name | Corral — select everything inside a picked polyline or circle |
| Download | Corral.lsp — 8.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | CORRAL |
| Requires | nothing beyond a CAD platform with AutoLISP. |
| Source size | 8.6 KB, 184 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
- ZONE LISP — total polyline length or area by layer
- TAPE LISP — total the length of whatever you have just selected
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program