Two survey points with known levels, and a straight fall between them. INTERP works out where each whole contour crosses that line and marks it — the donkey work of drawing contours from spot levels.
What ContourInterp does
Run it along each side of a triangle of survey points and the contour crossings are all there to be joined up.
The arithmetic. The ground is taken as a straight slope between the two points, so a level L falls at
distance = span × (L - level1) ÷ (level2 - level1)
Contours at the interval you choose are stepped through between the two levels and marked wherever they land inside the span.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
INTERP. - Pick the two survey points and give their levels.
- Give the contour interval — whole or fractional.
- Repeat along each side of the triangle, then join the crossings up.
How it works
The interval can be fractional and the fall can go either way. Both matter more than they sound.
Labels that go through a whole-number conversion round every level down, so a site working in half metres gets labelled 12, 12, 13, 13 — two pairs of duplicates and no half-metre contours at all.
And a loop that only steps upward produces nothing whatsoever when the second point is lower than the first, which on real survey data is half the time.
Your running object snap is left alone. Setting it to NODe on entry and NONe on exit is convenient for the routine and throws away whatever the user had set.
Notes and limits
- It assumes a straight fall between the two points. That is the standard assumption for triangulated survey data, and it is an assumption.
- The interval may be fractional — 0.5, 0.25 and so on.
- Either point may be the higher one.
- CMDECHO and BLIPMODE are restored to what they were, not set to 1.
Download and details
| Name | ContourInterp — interpolate contour crossings between two spot levels |
| Download | ContourInterp.lsp — 8.8 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Command | INTERP |
| Requires | nothing beyond a CAD platform with AutoLISP. |
| Source size | 8.8 KB, 190 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
- GRIDSURF LISP — import a full grid of levels as a surface
- LEVELTAG LISP — place the level markers themselves
- BANKSLOPE LISP — hatching the slope once the contours are drawn
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program