ECHD LISP: Create Polyline by Joining First and Last Point (Free AutoLISP Download)
ECHD creates a brand-new, two-point polyline by connecting only the first and last vertex of each selected polyline, discarding every intermediate vertex. It's a deliberately extreme simplification, useful when only the overall start-to-end direction of a polyline matters, not its intermediate path.
ENDCHORD-bgol (Create Polyline by Joining First and Last Point)
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 endpoint-chord simplification 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
ECHD creates a brand-new, two-point polyline by connecting only the first and last vertex of each selected polyline, discarding every intermediate vertex. It's a deliberately extreme simplification, useful when only the overall start-to-end direction of a polyline matters, not its intermediate path.
How to Use
- Load
ENDCHORD-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
ECHDat the command line and press Enter. - Select one or more polylines.
- Press Enter to finish the selection.
- For each selected polyline, a new straight two-point polyline joining its start and end points is created on a dedicated layer,
BGOL-ECHD(colour red). The original polylines are left untouched.
Why Use It
- One-step simplification, removes all unwanted intermediate vertices without manual grip-editing or
PEDIT. - Accuracy, automates the endpoint-connection process, minimizing errors from manual editing.
- Time savings, quickly reduces a noisy or over-complicated polyline down to its essential start/end geometry.
Where to Use It
- Reducing a noisy, multi-vertex polyline (e.g., a traced or auto-generated line) down to a simple straight reference line.
- Creating a quick chord line from an existing complex alignment or boundary without manually redrawing a line.
- Any cleanup task where only overall direction matters, not the intermediate path.
Notes
- This is a more extreme simplification than a tolerance-based vertex-reduction algorithm, it discards ALL intermediate vertices regardless of shape, keeping only the first and last points.
- Works on LWPOLYLINE entities; the original selected polylines are not deleted, so you can compare or remove them manually afterward.
- Polylines whose start and end point coincide (closed loops collapsed to a point) are skipped since no meaningful chord can be drawn.
- 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
ECHD is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
This is a more extreme simplification than a tolerance-based vertex-reduction algorithm, it discards ALL intermediate vertices regardless of shape, keeping only the first and last points.
One-step simplification, removes all unwanted intermediate vertices without manual grip-editing or PEDIT.
Yes. ECHD is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.
Drag and drop ENDCHORD-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type ECHD 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.