• 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

STRETCHBOTH LISP: Extend Both Ends of Lines and Arcs

August 3, 2026

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

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type STRETCHBOTH.
  3. Give the distance, or press Enter to reuse the last one.
  4. 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

NameStretchBoth — extend both ends of selected objects in one operation
DownloadStretchBoth.lsp — 17.2 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandSTRETCHBOTH
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size17.2 KB, 409 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

  • 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

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