• 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

FENCECUT LISP: Split Everything That Crosses a Fence

August 6, 2026

Draw a fence across a drawing and every object it crosses is cut at the crossing point. Nothing is erased and nothing moves — objects are simply split in two where the fence passes through them.

What FenceCut does

This is the operation you want before deleting half a plan, before moving a section of a site layout, or before putting a match line through a drawing that has to be split across two sheets. TRIM and BREAK both do parts of it, but neither will run a line across a drawing and divide everything it meets in one pass.

The fence is either picked point by point, or taken from a line or polyline you have already drawn — useful when the match line is real geometry that has to stay.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type FENCECUT.
  3. Pick the fence point by point, or select an existing line or polyline to use as one.
  4. Everything crossing it is split where it crosses.

How it works

Objects are gathered with a fence selection, which is AutoCAD’s own way of asking “what does this line cross” and is far more reliable than testing crossing windows segment by segment.

Each object is then intersected against the fence through the object itself rather than by hand, so arcs, ellipses, splines and polylines with bulges all work.

Each crossing point is then broken, using the point both to identify the object and to place the break. That one trick is what lets a single piece of code split every curve type: whatever is under that point gets divided there, with no gap.

Circles are a special case, and necessarily so. A circle has no ends, so there is no such thing as breaking one at a single point — the result would still be one object. A circle crossed twice is therefore replaced by two arcs spanning between the crossings, which is the only sensible reading of “cut this circle in half”. A circle the fence only clips once is left alone, and reported.

Layer, colour, linetype and width all come through untouched, because objects are broken rather than deleted and redrawn.

Notes and limits

  • Nothing is erased. Objects are split where they cross.
  • A circle clipped only once is left alone and reported — there is no meaningful single-point break.
  • The temporary fence polyline is removed before the command ends.
  • One undo group covers the whole pass.

Download and details

NameFenceCut — split every object crossing a fence, in one pass
DownloadFenceCut.lsp — 12.3 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandFENCECUT
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size12.3 KB, 291 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

  • CLIPBOX LISP — clip to a rectangle and delete the outside
  • HIDESECTION LISP — break an object and hide the middle piece
  • VERTINJECT LISP — adding a vertex rather than breaking
  • 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