Homeโ€บ Blogโ€บ MIDL LISP: Create Centre Line Between Two Edges Free Download
๐Ÿ“ LISP

MIDL LISP: Create Centre Line Between Two Edges Free Download

๐Ÿงฎ 2  |  ๐ŸŸข 2
12 Mar 2026 Trishunya Team
MIDL LISP: Create Centre Line Between Two Edges Free Download
๐Ÿ“ LISP · CAD UTILITIES

MIDL LISP: Create Centre Line Between Two Edges (Free AutoLISP Download)

๐Ÿ“… 12 Mar 2026 ๐Ÿท๏ธ CAD BGBgol Global
MIDL AutoLISP routine, Create Centre Line Between Two Edges, shown inside a CAD window

MIDL computes a genuine centerline between two selected edge polylines (for example, the two surveyed edges of a road) by sampling both curves at matching parametric positions and connecting the midpoints. Unlike the native OFFSET command, this works correctly even when the two edges are not perfectly parallel along their length.

MIDALIGN-bgol (Create Centre Line Between Two Edges)

CATEGORY
Polyline Lisps
COMMAND NAME
MIDL
LISP FILE
MIDALIGN-bgol.lsp
LICENSE
Open-source, free

Command Type: AutoLISP routine (works in AutoCAD, BricsCAD, ZWCAD and most AutoLISP-compatible CAD platforms)
Developed by: BGol Community, bgol.in

Inspired by the general concept of edge-to-centerline derivation utilities used in CAD/survey drafting. This is an original, independently written routine, new file name, new command name, new source code, created so the CAD community has a free, editable, open-source alternative.

Overview

MIDL computes a genuine centerline between two selected edge polylines (for example, the two surveyed edges of a road) by sampling both curves at matching parametric positions and connecting the midpoints. Unlike the native OFFSET command, this works correctly even when the two edges are not perfectly parallel along their length.

How to Use

  1. Load MIDALIGN-bgol.lsp into your CAD session (drag-and-drop the file onto the drawing window, or use the APPLOAD command).
  2. Type MIDL at the command line and press Enter.
  3. Select the first edge polyline.
  4. Select the second edge polyline.
  5. A new centerline polyline is drawn between the two edges on a dedicated layer, BGOL-MIDL (colour yellow). The original edge polylines are left untouched.

Why Use It

  • Accurate on non-parallel edges, produces a geometrically correct centerline even where corridor width varies, something OFFSET cannot do.
  • Saves manual construction, no need to hand-place and average points along a long, irregular alignment.
  • Ready for further design, directly usable as the reference alignment for chainage marking, curve design, or cross-sections.

Where to Use It

  • Deriving a road, channel, or corridor centerline from two surveyed edge lines, especially where the width varies.
  • Preparing an alignment polyline for further design work (e.g. feeding into a chainage-marking or curve-design routine).
  • Any land-survey or road-design task requiring a true geometric centerline between two boundary lines.

Notes

  • Sampling density defaults to 24 midpoints; edit the *bgol-midl-samples* constant near the top of the .lsp file for a smoother result on highly irregular edges.
  • Both edges are sampled at matching normalized parametric positions (0 to 1 along each curve), so the pairing stays sensible even if the two edges have a different number of original vertices.
  • Works on LWPOLYLINE, LINE and ARC edges (or a mix), since it samples using the ActiveX curve interface rather than raw vertex lists.
  • Source code is fully open, feel free to study, modify, and redistribute it under the same open, free-for-all spirit.

Credits

Developed and shared for the CAD community by BGol Community. Website: https://bgol.in/ Free and open-source, use it, modify it, share it, for personal or commercial work alike.

Frequently Asked Questions

What CAD platforms does MIDL work on?

MIDL is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.

What should I know before using MIDL?

Sampling density defaults to 24 midpoints; edit the *bgol-midl-samples* constant near the top of the .lsp file for a smoother result on highly irregular edges.

What is the main benefit of using MIDL?

Accurate on non-parallel edges, produces a geometrically correct centerline even where corridor width varies, something OFFSET cannot do.

Is MIDL free to use for commercial projects?

Yes. MIDL is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.

How do I load the MIDL command into my drawing?

Drag and drop MIDALIGN-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type MIDL at the command line to run it.

๐Ÿค About BGol Community

BGol Community of Advanced Surveying builds and shares free, open-source tools for the survey and CAD drafting community.

๐Ÿ™Œ Made with โค๏ธ by BGol Community of Advanced Surveying

Free, open-source, and built for the CAD community, for personal or commercial use, always.

Back to all articles