Click one piece of text, click another, and the wording moves across. WORDCOPY sends the first object’s text to the second; WORDSWAP exchanges the two.
What WordSwap does
What makes this worth having is the range of things it treats as “text”. Text and MText, block attributes, dimension text overrides, multileader text and multileader block attributes, and individual table cells — all interchangeable as sources and destinations.
So a room number can go straight from a table cell into a block attribute, or a dimension override can be copied into an MText note, without retyping anything and without any of the usual copy-paste hazards.
In WORDCOPY, typing M at the destination prompt switches to a window selection, so one source can be pushed into any number of destinations at once.
How to use it
- Load the routine with
APPLOAD, or put it on your support file search path. - Type
WORDCOPYorWORDSWAP. - Click the source, then the destination. Click directly on a table cell to address that cell.
- Type
Sat any prompt to change whether formatting is retained; the setting is remembered between sessions. - Type
MinWORDCOPYfor multiple destinations.
How it works
The hard part is not moving the characters, it is moving them between objects with different ideas about formatting. MText, multileaders, dimensions and table cells all understand inline formatting codes. Plain Text and ordinary attributes do not — give them a formatted string and the raw codes appear on screen as gibberish.
So both objects are inspected and the string converted appropriately. Formatted to formatted carries the codes across intact, if Retain is on, or strips them if not. Formatted to plain strips them. Plain to formatted escapes any characters MText would misread as codes, so a backslash or a brace in the source survives as itself rather than becoming a formatting instruction.
Picking uses a grread loop rather than entsel, for two reasons. First, table cells: entsel returns the table as a whole, so the loop uses the table’s own HitTest method to work out which row and column the click landed in. Second, keywords: the loop reads typed characters as well as picks, which is what allows Settings, Multiple and Exit to be typed at the same prompt that is waiting for a click.
Typed keywords are matched the way AutoCAD’s own initget does — the capital letters of each option form its abbreviation, and any unambiguous prefix is accepted.
Notes and limits
- Formatting conversion uses the Windows VBScript regular expression engine, present on every standard Windows installation. If it cannot be reached the command reports so and stops, rather than silently producing mangled text.
- The Retain setting persists between sessions.
- Each destination is converted on its own terms, so a multiple copy into mixed object types comes out correctly for each.
- Table cells are addressable individually, which
entselalone cannot do.
Download and details
| Name | WordSwap — copy or swap text content between any two objects |
| Download | WordSwap.lsp — 52.2 KB, plain AutoLISP source. Downloads directly; no zip to unpack. |
| Type | AutoCAD AutoLISP routine |
| Commands | WORDCOPY, WORDSWAP |
| Requires | the ActiveX layer (loaded automatically by the routine with vl-load-com); nothing extra — the dialog is written to a temporary file at run time and deleted again, so there is no .dcl to install. |
| Source size | 52.2 KB, 1,346 lines |
| Error handling | Yes — a *error* handler restores every system variable it changed, on cancel as well as on error. |
| Undo | Not needed — this routine only reads the drawing and changes nothing. |
| Compatibility | AutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer. |
| Author | YZ, August 2026 |
| Licence | Free to use, supplied “as is” with no warranty. |
References
- TEXTSWEEP LISP — batch find and replace across a whole folder
- TEXTWELD LISP — merging text objects into one MText
- STRINGTALLY LISP — count the text before you change it
- More free AutoLISP routines on this site
- Wisey’s Steel Shapes — free structural steel section drawing program