M2TX LISP: Convert MText to Single-Line Text (Free AutoLISP Download)
M2TX converts selected MTEXT entities into equivalent single-line TEXT entities. Unlike AutoCAD's native EXPLODE, which splits multi-line MText into multiple separate TEXT entities (one per line), M2TX flattens all lines into a single continuous TEXT entity, easier to select, move, and process with the other TEXT-only routines in this collection.
MT2TX-bgol (Convert MText to Single-Line Text)
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 MText-to-Text flattening utilities used in 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
M2TX converts selected MTEXT entities into equivalent single-line TEXT entities. Unlike AutoCAD's native EXPLODE, which splits multi-line MText into multiple separate TEXT entities (one per line), M2TX flattens all lines into a single continuous TEXT entity, easier to select, move, and process with the other TEXT-only routines in this collection.
How to Use
- Load
MT2TX-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
M2TXat the command line and press Enter. - Select the MTEXT entities you want to convert, then press Enter to confirm.
- Each selected MText's full content is flattened (line breaks and basic formatting codes removed/collapsed to spaces) and recreated as a new single-line TEXT entity, on layer
BGOL-M2TX(colour green), at the original MText's insertion point, height, and rotation. The original MText entity is deleted.
Why Use It
- Compatibility, converts content into plain Text so it becomes usable by other LISP routines and commands that only recognize the TEXT entity type.
- Avoids Fragmentation, unlike native
EXPLODE, keeps multi-line content as one single-line Text entity instead of splitting it into several. - Performance, reduces drawing complexity/slowdown associated with MText entities, especially in drawings with many MText objects.
Where to Use It
- Preparing a drawing for processing by other LISP tools in this collection (or any Text-specific AutoLISP routine) that cannot operate on MText.
- Simplifying drawings with many MText labels into lighter-weight, more easily editable single-line Text entities.
- Cleanup/standardization pass before running text-based QA, export, or batch-editing routines that expect plain Text.
Notes
- Formatting codes such as
\P(paragraph break) and simple{...}grouping braces are stripped; complex nested formatting (stacked fractions, field codes) is not specially reconstructed, the flattened plain text content is preserved. - The original MText is deleted after conversion; keep a backup copy of the drawing if you want to retain both forms.
- 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
M2TX is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Formatting codes such as \P (paragraph break) and simple {...} grouping braces are stripped; complex nested formatting (stacked fractions, field codes) is not specially reconstructed, the flattened plain text content is preserved.
Compatibility, converts content into plain Text so it becomes usable by other LISP routines and commands that only recognize the TEXT entity type.
Yes. M2TX 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 MT2TX-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type M2TX 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.