• 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

WALLCLEAN LISP: Clean Up Where Double Lines Cross

August 6, 2026

Two walls drawn as pairs of parallel lines cross each other, and you are left with a little box of overlapping segments in the middle. The same happens with ducts, pipes, kerbs and roads. Window the mess and WALLCLEAN clears it: a crossing becomes a clean cross, a junction becomes a clean tee, and nothing else is touched.

What WallClean does

The rule it works to. For every line in the selection, find where the other selected lines cross it. Then:

crossed twice or more  the piece between the outermost two
                        crossings is removed - this is a line
                        passing through, and the middle must go
crossed once          the shorter end is removed - this is a line
                        running INTO the junction and stopping
not crossed           left alone

Those two cases are the whole of it. A cross needs the first rule on all four lines; a tee needs the first on the wall being run into and the second on the two lines running into it. There is no need to say which kind of junction it is — the geometry already says.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type WALLCLEAN.
  3. Window the junction.
  4. Press Enter.

How it works

It is not told the wall thickness, and does not need to be. The crossings are measured directly.

That matters more than it sounds. The three routines this replaces depended on a global holding the wall thickness, set elsewhere — which meant they only worked on walls of one width, and had to be told again whenever that changed. Measuring the junction removes the question entirely, and is why this works on ducts and kerbs as readily as on walls.

Everything it needs is in the one file. Between them the originals called GETLINE, GETINTER, ECHO_OFF and ECHO_ON, none of which was in the file — they lived in a companion called MORE.LSP that is not part of the collection. Every one of the three failed on its first line.

Nothing outside the selection is touched, so you can window loosely.

Notes and limits

  • Window the junction — only selected lines are considered.
  • Works on any thickness, and on mixed thicknesses in one pass.
  • Crosses and tees both, with no mode to choose.
  • One undo group covers the cleanup.

Download and details

NameWallClean — tidy a crossing or a junction of double lines
DownloadWallClean.lsp — 8.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandWALLCLEAN
Requiresnothing beyond a CAD platform with AutoLISP.
Source size8.6 KB, 203 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

  • WALLRUN LISP — walls that clean their own corners as you draw them
  • TWINOFFSET LISP — drawing the double lines in the first place
  • MLINESHIFT LISP — the multiline alternative
  • 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