Pick a polyline and get a road or a railway built along it. ROAD draws kerbs or shoulders either side at a width you give, and can add a centre line down the middle. RAILWAY draws two rails and lays sleepers across them at a spacing, each one square to the track at that point.
What RoadLines does
Both follow curves properly, because both work from the curve itself rather than from its straight segments. A road built by offsetting the segments of an arc-fitted polyline comes out faceted, and a sleeper placed square to a segment rather than to the track is a few degrees out everywhere the alignment bends.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
ROADorRAILWAY. - Pick the centreline.
- Give the width, and for a railway the sleeper spacing.
How it works
The width you give is the width you get. A road width taken from LTSCALE — which is a display setting for dashed lines and has nothing to do with how wide a road is — comes out at whatever the last person to touch the drawing left it at.
The centreline you pick is left in place. Erasing the thing the user picked, without asking, is not a reasonable thing for a routine to do.
Sleepers are drawn directly rather than built as a block called Railroad and scattered along the track with MEASURE. That approach leaves the block behind in the drawing whether you want it or not, and it puts sleepers at even spacing along the curve without regard for their rotation.
No command is split across two calls. Opening a command in one (command) call and finishing it in a later one works right up until something interrupts in between, and then leaves AutoCAD mid-prompt with the routine gone.
BLIPMODE, CMDECHO and REGENMODE are put back to what they were, rather than to what somebody assumed they had been.
Notes and limits
- Two commands:
ROADandRAILWAY. - Curves are followed, not approximated from segments.
- The centreline stays — erase it yourself if you do not want it.
- One undo group covers the run.
Download and details
| Name | RoadLines — kerbs and shoulders, or rails and sleepers, along a centreline |
| Download | RoadLines.lsp — 10.9 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Commands | RAILWAY, ROAD |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com). |
| Source size | 10.9 KB, 277 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
- CHAINAGE LISP — chainage marks along the same alignment
- BANKSLOPE LISP — batter slopes either side of it
- BOXCULVERT LISP — what goes under it
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program