MATCHROT turns a selection so that one line in it ends up parallel to another line you point at. No angles to work out and none to type.
What MatchRotate does
For squaring a detail up to a wall that is not on a round number, lining a note up with a pipe run, or setting a north point to a site boundary.
ALIGN does something related but not the same — it moves and scales as well, and needs matched pairs of points. This only turns, about a base point you choose.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
MATCHROT. - Select the objects to turn, and pick the base point to turn about.
- Pick the reference line in the selection — the edge that is to end up parallel to something.
- Pick the target line.
How it works
Two lines are picked. The first is the reference in the selection; the second is the target. The difference between their angles is how far everything turns.
Both are read with nentsel rather than entsel, so an edge inside a block can be used without exploding it. On a site plan the boundary you want to square up to is usually inside an xref, and that one choice is the difference between the routine being useful and being useless.
The rotation is worked out before ROTATE starts. Starting the command and then going off to ask three questions leaves ROTATE hanging at a prompt if anything goes wrong in between.
Notes and limits
- Pick the reference line inside your selection first, then the target outside it. The other way round turns it backwards.
- Nested edges work — blocks and xrefs do not need exploding.
- ORTHOMODE and the pick aperture are restored, including on cancel.
- One undo group covers the rotation.
Download and details
| Name | MatchRotate — rotate a selection to match another line |
| Download | MatchRotate.lsp — 6.1 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | MATCHROT |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 6.1 KB, 146 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
- SKEWBOX LISP — drawing square to something skewed in the first place
- BASEPIN LISP — moving the point a block rotates about
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program