Last updated July 28, 2026
SLOT draws a slotted hole — the obround shape with two straight sides and a semicircle at each end — from four inputs: the centre point, the width, the overall length, and the angle it runs at. It comes out as a single closed polyline, so it can be offset, hatched, trimmed to or used as a boundary without any tidying up.
Drawing one by hand means two circles, two tangent lines, four trims and a join, and getting it on an angle makes it worse. This is one command.
It is by Mike Pillers, a machine and mechanism design consultant in San Jose, and the header timestamps it to 22:41 on 18 July 1986 — which makes it the oldest piece of code on this site, and a reminder that somebody was working late.
Length means overall length
The one thing to get right. The length you give is the overall length of the slot, tip to tip including both rounded ends — not the centre-to-centre distance between the two end radii, which is the other common way of dimensioning a slot.
The code subtracts the width from the length before working out where the arc centres go, which is what makes that true. So for a slot 12 wide and 40 long overall, the arc centres end up 28 apart. If your drawing dimensions slots centre-to-centre, add the width before you type the length.
The width is the full width across the slot, which equals the diameter of the end radii.
What it does in practice
All four inputs are taken relative to the centre point, so the width and length prompts let you show a distance on screen as well as type it, and the angle prompt lets you pick a direction off existing geometry rather than working out a number.
The geometry is done with vector arithmetic rather than a sequence of construction steps, which is why the result is clean at any angle rather than accumulating rounding as it rotates. The slot is drawn as one polyline: straight side, arc, straight side, arc, closed.
It also drops a point object at the centre before drawing, and sets the point display mode to a plain dot while it does. That gives you something to snap to for the next feature — a bolt hole, a dimension origin — but it is an extra object in your drawing that you may not want. Erase it if it is in the way, or delete the two lines that create it if you never want it.
One small untidiness: command echo is switched off and not put back, so AutoCAD will be quieter afterwards. Set CMDECHO to 1 if that bothers you.
Command reference
The file defines a single command, SLOT, and reminds you when it loads: “Type SLOT to envoke the command”.
How to load it
Unzip Slot.zip and load SLOT.LSP with APPLOAD, or add it to the Startup Suite if you do mechanical detailing. No support files. Our AutoLISP guide covers loading.
Step-by-step usage
- Type SLOT.
- At “Enter CENTER POINT of SLOT:” pick the middle of the slot. Snap to a construction line or existing feature for accuracy.
- At “Enter WIDTH of SLOT:” type the width across, or show it on screen.
- At “Enter LENGTH of SLOT:” type the overall length — see the note above.
- At “Enter ANGLE of SLOT:” type an angle or pick two points to show the direction. The slot is drawn.
Compatibility notes
1986. Written-for rather than tested-on by the widest margin of anything here. That said, it uses only point arithmetic and the PLINE command, none of which has changed in the intervening decades, so there is a fair chance it simply works.
Plain AutoLISP with no dialog boxes and no Express Tools calls, so nothing requires the full product; LT users on LT 2024 or later, the release that brought AutoLISP to LT, should be able to run it. See what runs on AutoCAD LT. It only adds geometry, so try it in a scratch area and check the proportions against a dimension before using it in anger.
Download
| Name: | Slot |
| Description: | Draws a long slot with rounded ends by specifying center point, width, overall length, and angle of slot. |
| Type: | AutoCAD AutoLISP Routine |
| Author: | Mike Pillers |
| File Size: | 1 Kb |
| Cost: | Free |
| Worked on: | AutoCAD |
| Download File: | Slot.zip |
Related routines
- BOLTS — the metric fasteners that go through the slots.
- Mechanical drafting collection — holes, dowels and tolerance symbols.
- AWELD — welding symbols for the same detail drawings.