ATXP LISP: Align Text to Nearest Alignment Line (Free AutoLISP Download)
ATXP rotates a selection of TEXT entities so each one follows the local direction of the nearest reference LINE or LWPOLYLINE. Scattered-angle labels next to curved roads, boundaries or alignments are instantly straightened up to read cleanly along the geometry they describe.
ALTX-bgol (Align Text to Nearest Alignment Line)
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 "align text parallel to nearest line" utilities used in survey/CAD 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
ATXP rotates a selection of TEXT entities so each one follows the local direction of the nearest reference LINE or LWPOLYLINE. Scattered-angle labels next to curved roads, boundaries or alignments are instantly straightened up to read cleanly along the geometry they describe.
How to Use
- Load
ALTX-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
ATXPat the command line and press Enter. - Select the TEXT entities you want to realign, then press Enter to confirm the selection.
- Select the LINE/LWPOLYLINE entities to use as reference alignment geometry, then press Enter to confirm.
- Each selected text is rotated in place to match the tangent angle of the nearest point on the nearest reference line. A small point marker is placed at each text's original insertion location on layer
BGOL-ATXP(colour blue) so the prior position can be reviewed.
Why Use It
- Improved Readability, text parallel to nearby reference geometry is far easier to read at a glance.
- Professional Appearance, produces polished, presentation-ready drawings with minimal manual effort.
- Time-Saving, realigns many text entities in one pass instead of rotating each one by hand to match its nearest line segment.
Where to Use It
- Aligning house/plot/feature labels along winding roads or curved parcel boundaries in city maps or site layout drawings.
- Aligning elevation or chainage values along a curving alignment so each value follows the local direction of the line at that point.
- Any drawing finalization pass where scattered-angle text needs to follow nearby geometry automatically.
Notes
- The routine searches only the reference lines you explicitly select, not the whole drawing, this keeps behaviour predictable on dense drawings.
- Works on TEXT entities; MText should be converted first (see
MT2TX-bgol.lsp) 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
ATXP is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
The routine searches only the reference lines you explicitly select, not the whole drawing, this keeps behaviour predictable on dense drawings.
Improved Readability, text parallel to nearby reference geometry is far easier to read at a glance.
Yes. ATXP 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 ALTX-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type ATXP 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.