• 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

STAIRRUN LISP: Stair Riser, Tread and Opening Calculator

August 6, 2026

Give STAIRRUN a floor-to-floor height and it works out the ways a stair can be built to get up it, checked against the code you are working to. For each it reports the riser, the tread, the total run, the floor opening needed to keep headroom, and the pitch.

What StairRun does

The awkward part of a stair is that the riser count must be a whole number, so you cannot simply pick a riser height — you pick a count and the height follows.

This offers the three counts either side of the code maximum, which is nearly always where the answer lies, and then lets you test any tread width you like against them.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type STAIRRUN.
  3. Give the floor-to-floor height, or pick two points and let it measure.
  4. Choose the code you are working to.
  5. Read the table, then try tread widths against the count you like.

How it works

Tread from riser: 2R + T = 25. A rule of thumb going back to Blondel in 1675, and still the basis of comfortable going. A steep flight needs a deep tread and a shallow one can take a narrow tread; this is the trade at a walking pace.

Opening for headroom:

opening = total run × (headroom + floor build-up) / total rise

Similar triangles. The stair soffit runs parallel to the nosing line, so the horizontal distance needed to gain the headroom plus the thickness of the floor above is in the same ratio as the run is to the rise.

This is the number that catches people out, because a stair that fits in plan can still be unbuildable once the opening is drawn.

The current IBC and IRC limits are offered first, with the old BOCA and NFPA figures kept for checking existing work against what it was built to.

The tread width is not held in a variable called T. T is the symbol for true in LISP, and overwriting it breaks every test in the session until the drawing is closed — including tests inside AutoCAD’s own routines. It is the single most damaging thing a LISP routine can do, and it is worth checking for in anything you download.

The floor-to-floor height is asked for rather than read from a global left behind by some other routine, and every variable is declared local, so nothing leaks into the drawing.

Notes and limits

  • The code list is current IBC and IRC, with BOCA and NFPA retained for checking older work.
  • Floor-to-floor can be picked off the drawing instead of typed.
  • 2R + T = 25 is a rule of thumb, not a code requirement — check going and rise against your own code.
  • It reports; it draws nothing.

Download and details

NameStairRun — work out risers, treads, run and the floor opening
DownloadStairRun.lsp — 14.1 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandSTAIRRUN
Requiresnothing beyond a CAD platform with AutoLISP.
Source size14.1 KB, 292 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

  • STAIRPAN LISP — the pans that make up the flight
  • SPIRALSTAIR LISP — when the stair turns
  • RISERUN LISP — rise and run off any picked line
  • 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