TXSW LISP: Interchange Text Content (Free AutoLISP Download)
TXSW swaps the string content of two selected TEXT or MTEXT entities in a single command. Position, height, layer, and rotation of each entity stay exactly where they are, only the text content trades places. Handy for title blocks and tabular headers where a label and its value (or two adjacent cells) were typed into the wrong spot.
TXTSWAP-bgol (Interchange Text Content)
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-content-swap utilities used in CAD title-block and table editing. 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
TXSW swaps the string content of two selected TEXT or MTEXT entities in a single command. Position, height, layer, and rotation of each entity stay exactly where they are, only the text content trades places. Handy for title blocks and tabular headers where a label and its value (or two adjacent cells) were typed into the wrong spot.
How to Use
- Load
TXTSWAP-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
TXSWat the command line and press Enter. - Select the first text entity when prompted.
- Select the second text entity when prompted.
- The two entities' string content is interchanged immediately, the first now shows what the second used to say, and vice versa.
Why Use It
- One-command fix, replaces the multi-step copy/paste/overwrite process normally needed to swap two text values.
- No data loss risk, removes the chance of mistyping or losing one value mid-swap, a common risk with manual copy-paste.
- Table-friendly, ideal for title blocks and drawing header tables where a label and its value (or two data cells) end up in swapped positions.
Where to Use It
- Correcting title block or drawing header tables where two text values were entered in the wrong cells.
- Any quick two-way exchange of text content between two specific TEXT or MTEXT entities in a drawing.
- Cleaning up tabular annotation where fields have drifted or were transposed during data entry.
Notes
- Both entities' original position, text height, style, layer, and rotation are left completely unchanged, only the string content moves.
- Works with TEXT and MTEXT; if you mix the two entity types the routine still swaps their raw text values.
- Selecting the same entity twice is detected and reported, nothing is changed in that case.
- 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
TXSW is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Both entities' original position, text height, style, layer, and rotation are left completely unchanged, only the string content moves.
One-command fix, replaces the multi-step copy/paste/overwrite process normally needed to swap two text values.
Yes. TXSW 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 TXTSWAP-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type TXSW 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.