• 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

ROAD and RAILWAY LISP: Roads and Track from a Centreline

August 6, 2026

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

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type ROAD or RAILWAY.
  3. Pick the centreline.
  4. 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: ROAD and RAILWAY.
  • 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

NameRoadLines — kerbs and shoulders, or rails and sleepers, along a centreline
DownloadRoadLines.lsp — 10.9 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandsRAILWAY, ROAD
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size10.9 KB, 277 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

  • 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

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