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
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
WALLCLEAN. - Window the junction.
- 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
| Name | WallClean — tidy a crossing or a junction of double lines |
| Download | WallClean.lsp — 8.6 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | WALLCLEAN |
| Requires | nothing beyond a CAD platform with AutoLISP. |
| Source size | 8.6 KB, 203 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
- 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