BRACKET draws the tall bracket used to gather several lines of text and point them at one thing — a group of notes against a leader, a schedule of parts against an item, a set of options against a single answer.
What TextBracket does
Pick the two ends of the span and say how far it should reach. Corners can be square, chamfered or rounded.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
BRACKET. - Pick the two ends of the span.
- Give the reach, and choose square, chamfered or rounded corners.
How it works
The polyline width is read with SETVAR, directly, rather than by opening the PLINE command to see what it says.
That is worth spelling out, because the original tried to do it with (command "pline" pt1 ^C), where ^C was meant as a cancel. That works in a menu macro, where ^C is two characters the menu system reads as Escape — but in LISP it is a symbol named ^C, which is unbound, evaluates to nil, and leaves PLINE open at a prompt.
The same confusion ended its polylines with \r, which is likewise a symbol rather than a carriage return. It happened to work, because an unbound symbol is nil and nil closes a command — but only by luck.
Corners are drawn, not filleted into place. Setting FILLETRAD, CHAMFERA and CHAMFERB to get a corner shape leaves all three at the new values for whatever you draw next.
No variable is named ANGLE. A global by that name shadows the built-in angle function for everything that runs afterwards in the session.
Notes and limits
- Three corner treatments — square, chamfered, rounded.
- System variables are left alone.
- Drawn as one polyline, so it can be offset or stretched with the notes.
- One undo group covers the bracket.
Download and details
| Name | TextBracket — draw a bracket around a group of notes |
| Download | TextBracket.lsp — 8.3 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | BRACKET |
| Requires | nothing beyond a CAD platform with AutoLISP. |
| Source size | 8.3 KB, 185 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | The whole operation is wrapped in a single undo group, so one U reverses all of it. |
| 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
- TEXTFRAME LISP — boxing text rather than bracketing it
- RESPACE LISP — evening up the notes inside it
- DIMNOTE LISP — notes hung off a dimension
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program