VXTH LISP: Reduce Vertex Count by Distance Sampling (Free AutoLISP Download)
VXTH reduces vertex count on a dense polyline (e.g., a breakline digitized from LiDAR or detailed survey data) by rebuilding it from points sampled at a fixed distance interval along the original path. The result is a much lighter-weight polyline that still closely follows the original geometry.
VXTHIN-bgol (Reduce Vertex Count by Distance Sampling)
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 vertex-reduction/curve-sampling utilities used in survey/civil 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
VXTH reduces vertex count on a dense polyline (e.g., a breakline digitized from LiDAR or detailed survey data) by rebuilding it from points sampled at a fixed distance interval along the original path. The result is a much lighter-weight polyline that still closely follows the original geometry.
How to Use
- Load
VXTHIN-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
VXTHat the command line and press Enter. - Enter the sampling distance at which new vertices should be introduced (default 30 drawing units).
- Select the polyline to reduce.
- A new, lighter LWPOLYLINE is created on a dedicated layer,
BGOL-VXTH(colour red). The command line reports the before/after vertex counts, e.g.No of Vertexes in Selected Line: 16→No of Vertexes in Created Line: 5.
Why Use It
- Reduces drawing file size and improves CAD performance on drawings containing many vertex-heavy polylines.
- Preserves the overall shape/path of the original polyline reasonably well, since the new vertices are sampled directly from the original curve rather than arbitrarily simplified.
- Simple, predictable control via a single distance parameter, larger intervals produce fewer vertices (more aggressive reduction), smaller intervals preserve more detail.
Where to Use It
- Simplifying dense breaklines, contour-derived polylines, or LiDAR-sourced survey lines carrying far more vertices than the drawing needs.
- General drawing file-size and performance optimization on projects with many complex polylines.
- Preparing polylines for export to systems/formats with vertex count limits or performance sensitivity to complex geometry.
Notes
- The original polyline's actual endpoint is always included as the final point of the new line, even if it doesn't land exactly on a multiple of the sampling distance.
- Elevation/Z data is not preserved by this routine (2D sampling only); for 3D breaklines, verify the result before using it downstream.
- 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
VXTH is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
The original polyline's actual endpoint is always included as the final point of the new line, even if it doesn't land exactly on a multiple of the sampling distance.
Reduces drawing file size and improves CAD performance on drawings containing many vertex-heavy polylines.
Yes. VXTH 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 VXTHIN-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type VXTH 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.