The LENGTHEN command extends one end at a time, and you have to pick the end you mean. STRETCHBOTH does both ends of every object in a selection at once — useful for extending a run of grid lines, section marks or setting-out lines past the geometry they refer to.
What StretchBoth does
Give a distance, select the objects, and every one grows by that amount at each end. The last distance used is remembered between AutoCAD sessions.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
STRETCHBOTH. - Give the distance, or press Enter to reuse the last one.
- Select the lines, arcs and polylines. Closed objects cannot be picked.
How it works
Each object type needs something different.
A line has each endpoint pushed outward along the line’s own direction, by scaling the vector between the two ends.
An arc has its start and end angles adjusted. The angular change is the extension divided by the radius — which is simply the definition of a radian — so the arc grows by exactly the requested arc length at each end, not by a chord approximation.
A polyline has only its first and last segments changed. A straight segment is extended like a line; a curved one needs its bulge recomputed as well as its endpoint moved, or the arc’s curvature would change instead of its length — which looks almost right and is not.
Some extensions are refused. Extending both ends of an arc far enough would make them meet and pass through each other, turning the arc inside out. Any end where that would happen is silently left alone rather than producing nonsense geometry.
Notes and limits
- Closed objects are excluded by the selection filter — they have no ends.
- Arcs grow by true arc length, not by chord.
- An arc that would turn inside out is left alone at that end.
- The distance persists between sessions. Press Enter to reuse it.
Download and details
| Name | StretchBoth — extend both ends of selected objects in one operation |
| Download | StretchBoth.lsp — 17.2 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | STRETCHBOTH |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 17.2 KB, 409 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
- PARTOFFSET LISP — why bulge has to be recomputed rather than copied
- TWINOFFSET LISP — offsetting to both sides rather than extending both ends
- Grid systems on drawings — what grid lines are usually being extended for
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program