TSNP LISP: Snap Text onto a Polyline (Free AutoLISP Download)
TSNP pulls a set of selected text entities onto the nearest position on a target polyline, like a magnet. It instantly cleans up elevation, chainage, or other labels that have drifted or were placed inconsistently relative to a reference line, giving a clean, professional presentation.
TXTSNAP-bgol (Snap Text onto a Polyline)
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 text-to-curve snapping 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
TSNP pulls a set of selected text entities onto the nearest position on a target polyline, like a magnet. It instantly cleans up elevation, chainage, or other labels that have drifted or were placed inconsistently relative to a reference line, giving a clean, professional presentation.
How to Use
- Load
TXTSNAP-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
TSNPat the command line and press Enter. - Select the text entities that are currently scattered/offset relative to the target line.
- Select the target polyline to align to.
- Each selected text's insertion point moves to the nearest point on that polyline. A small point marker is left at each new position on a dedicated layer,
BGOL-TSNP(colour magenta), for a quick visual audit trail of what moved.
Why Use It
- Instantly cleans up scattered or inconsistently placed text into a visually aligned, professional presentation.
- Combined with the offset trick, provides flexible control, align texts directly on a line, or at a controlled fixed distance from it, using the same underlying routine.
- Saves significant manual effort compared to individually dragging or repositioning each text entity by hand.
Where to Use It
- Cleaning up elevation, chainage, or label text that has drifted or was placed inconsistently relative to a reference polyline (e.g., a section line or alignment).
- Preparing presentation-quality drawings for client review, where visual consistency of label alignment matters.
- Any drafting task needing to snap many text entities onto (or at a fixed offset from) a line in a single operation.
Notes
- Works on TEXT and MTEXT entities; each text's insertion/anchor point is what gets moved, text rotation is left unchanged.
- The small point markers on
BGOL-TSNPare a visual log only; delete that layer's content freely once you've confirmed the alignment looks correct. - 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
TSNP is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Works on TEXT and MTEXT entities; each text's insertion/anchor point is what gets moved, text rotation is left unchanged.
Instantly cleans up scattered or inconsistently placed text into a visually aligned, professional presentation.
Yes. TSNP 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 TXTSNAP-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type TSNP 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.