• 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

PARTOFFSET LISP: Offset Part of a Polyline to Both Sides

August 3, 2026

The standard OFFSET command works on a whole object. When you only want to offset the middle stretch of a long polyline — to show a widening, a crossing, or a section of kerb build-out — you normally have to break the polyline, offset the fragment and then repair the original. PARTOFFSET does it without touching the source polyline at all.

What PartOffset does

Give an offset distance, pick the polyline, then pick two points along it bracketing the section you want. Two new polylines appear, one either side of that section. The original is left exactly as it was.

The distance is remembered between runs, so repeated use only needs Enter.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type PARTOFFSET.
  3. Give the offset distance, or press Enter to reuse the last one.
  4. Pick the polyline.
  5. Pick two points along it, bracketing the section to offset.

How it works

A temporary polyline is constructed representing just the selected section, then AutoCAD’s own offset is applied to it twice — once positive, once negative — and the temporary object is deleted. Using the real offset engine rather than computing parallel geometry by hand is what makes this handle arc segments and varying width correctly.

The intricate part is building that temporary polyline, because the picked points almost never land exactly on a vertex. Where a pick falls part way along a segment, that segment must be split — and both its width and its curvature have to be divided proportionally, or the offset section will not line up with the polyline it came from.

Width divides linearly. Curvature does not. Curvature is stored as a bulge, which is the tangent of a quarter of the arc’s included angle, so it has to be converted to an angle, split, and converted back. That is what the arctangent and tangent calls in the code are doing.

Getting that wrong is precisely the bug that version 1.1 of the original was published to fix — a split arc that looks nearly right and does not quite meet.

Notes and limits

  • The original polyline is not modified. Two new polylines are created beside it.
  • Arc segments and varying width are handled, because the real offset engine does the work.
  • Pick points need not be on vertices. Segments are split proportionally where they fall.
  • The distance persists between runs — press Enter to reuse it.

Download and details

NamePartOffset — offset only part of a polyline, to both sides at once
DownloadPartOffset.lsp — 15.3 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandPARTOFFSET
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size15.3 KB, 320 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

  • TWINOFFSET LISP — offsetting to both sides of a whole object
  • MLSHIFT LISP — changing which line a multiline is measured from
  • VERTEXINJECT LISP — adding vertices to a polyline
  • 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