eplisp

Slope Between Two Points

eplisp, the free multilingual LISP library

Slope Between Two Points
Openly licensed; the original file is hosted here together with its license.
…
Rate this tool:
CommandsSLP
CategoryMeasuring and Totals
AuthorMichael Flynn
Sourcemf4633/C3D-AutoCAD
LicenseMIT
Version1.1
Updated2026-05-20
RequirementsAutoCAD (full version, not LT), Civil 3D, BricsCAD.
Prompt languageEnglish
Filesslope.lsp (2 KB), _utils.lsp (5 KB)
Added2026-10-26
Download the original fileSource repository

SLP computes the slope between two picked 3D points from their elevation difference over horizontal distance and labels it at the midpoint.

SLP is one of Michael Flynn's Civil 3D routines, used to measure the slope between two points and write it into the drawing. It reports the slope between points snapped with OSNAP on contours with elevation, profile vertices or surface points, which is handy for grading and drainage checks.

Overview

The elevation difference (dv) is the second point's Z minus the first point's Z, and the horizontal distance (dh) uses only X and Y. The slope is calculated as a percentage and as a horizontal:vertical ratio and written as a centered TEXT at the exact midpoint of the two points; dv and dh are also shown at the command line. The text height comes from the TEXTSIZE variable.

How to use it

  1. Load _utils.lsp first, then slope.lsp, with APPLOAD.
  2. Type SLP at the command line.
  3. Pick the first point, snapping to an object that carries elevation.
  4. Pick the second point; the slope label is placed at the midpoint.

Notes and limitations

  • SLP calls the c3d:txth function from _utils.lsp; without _utils.lsp loaded the command fails.
  • The result is meaningful only if the picked points have real Z values; in a flat 2D drawing it reports 0% and 'flat'.
  • The sign depends on pick order: if the second point is lower, the percentage is negative, while the ratio has no sign.
  • The label is added on the current layer and is not rotated.
  • Version 1.1 (2026-05-20) according to the file header. The repository was published in 2026 and the amount of testing is not stated; try it on a copy of the drawing first.

Source and license

This tool is not made by eplisp. The file is published unchanged under its author's license; copyright stays with the author.

References

  1. Source repository: mf4633/C3D-AutoCAD – https://github.com/mf4633/C3D-AutoCAD
  2. Author: Michael Flynn – https://github.com/mf4633
  3. License: MIT – https://github.com/mf4633/C3D-AutoCAD/blob/eeeda7b7b3ffe98917d4b2b3d329d6b84a966035/LICENSE

Found a mistake, or are you the author of this tool? Request a correction or removal