VXTX LISP: Build Polyline Through Text Positions (Free AutoLISP Download)
VXTX builds a brand-new LWPOLYLINE that passes exactly through the insertion points of a set of selected TEXT or MTEXT entities. It's designed for the common survey/drafting scenario where elevation, chainage, or other dummy text has already been placed at each point where a vertex is needed, instead of manually running PEDIT to insert a vertex at every one of those positions, select the text labels and let VXTX build the new line for you.
VXTXT-bgol (Build Polyline Through Text Positions)
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 building vertex-marked polylines from existing text label positions (e.g., elevation labels placed along a boundary), a technique used in survey/civil drafting workflows. 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
VXTX builds a brand-new LWPOLYLINE that passes exactly through the insertion points of a set of selected TEXT or MTEXT entities. It's designed for the common survey/drafting scenario where elevation, chainage, or other dummy text has already been placed at each point where a vertex is needed, instead of manually running PEDIT to insert a vertex at every one of those positions, select the text labels and let VXTX build the new line for you.
How to Use
- Load
VXTXT-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
VXTXat the command line and press Enter. - Select two or more TEXT/MTEXT entities marking the desired vertex positions (their insertion points become the new polyline's vertices).
- A new LWPOLYLINE is created on a dedicated layer,
BGOL-VXTX(colour green), running through every selected text's insertion point. - The order of vertices follows a nearest-neighbour chain starting from the first text you selected, so the texts don't need to be picked in perfect sequence.
- Any original polyline in the drawing is left completely untouched, the new line is a separate entity.
Why Use It
- One command instead of many
PEDITsteps, inserting a vertex at every text-marked point normally means runningPEDITrepeatedly; this routine builds the whole new line in a single pass. - Non-destructive, the source polyline (if any) is never modified, so you can compare the new and old geometry or delete the old one manually.
- Handles out-of-order selection, the nearest-neighbour ordering means you don't have to click the texts in perfect left-to-right sequence.
Where to Use It
- Preparing a polyline for a later "2D to 3D" style elevation-attachment step, by ensuring a vertex exists at every point with a known elevation label.
- Any workflow where text markers (elevation, chainage, or dummy labels) represent points that should become actual polyline vertices.
- Survey/design drafting tasks where a sequence of labeled points needs to become a connected line quickly.
Notes
- Requires at least 2 selected TEXT/MTEXT entities; fewer than that and the routine reports a message and exits without creating anything.
- Vertex order is computed automatically via nearest-neighbour chaining; for unusual/self-crossing arrangements, review the result and re-run with a more deliberate selection order if needed.
- 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
VXTX is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Requires at least 2 selected TEXT/MTEXT entities; fewer than that and the routine reports a message and exits without creating anything.
One command instead of many PEDIT steps, inserting a vertex at every text-marked point normally means running PEDIT repeatedly; this routine builds the whole new line in a single pass.
Yes. VXTX 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 VXTXT-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type VXTX 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.