• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

DELMTEXT LISP: Erase All Mtext in an AutoCAD Drawing

September 18, 2020

Last updated July 28, 2026

This erases every piece of multiline text in the drawing. One command, no selection step, no confirmation.

It is the companion to the single-line text stripper on this site, and between them they cover both kinds of text AutoCAD draws. That pairing is the point — neither one alone will clear a modern drawing.

Why two routines and not one

AutoCAD has two text objects and they are unrelated as far as a selection filter is concerned. Single-line text, made with the TEXT command, is one entity per line. Multiline text, made with MTEXT, is a paragraph object that holds its own formatting.

A filter that asks for one will never return the other. So a drawing that mixes them — which is to say almost any drawing produced this century — needs both commands run to be properly stripped. Run only this one and every dimension label and title block line drawn as plain text stays put; run only the other and every paragraph note survives.

Worth knowing that on a modern drawing this is likely to be the busier of the two. MTEXT has been the default for annotation for a long time.

A message inherited from its sibling

A small thing that tells you how the file came about. If there is no mtext in the drawing, the routine reports “No text in this drawing!” — not “no mtext”. That message was copied straight from the single-line text version along with the rest of the file, and only the entity name in the filter was changed.

It is harmless, but it can mislead. Getting that message does not mean the drawing has no text; it means it has no mtext. There may be plenty of the other kind still sitting there.

What it catches

The search runs against the whole drawing database rather than what is on screen, so mtext on frozen layers, on switched-off layers and in layouts is all included. That is the behaviour you want when stripping a drawing you did not produce, and the reason to save first.

It uses AutoCAD’s own ERASE command, so an immediate U puts everything back — if you notice straight away. Save, run it, close the file, and the text is gone for good.

Command reference

The command is DELMTEXT. The file is called “Delete mtext.lsp” and the listing calls it Delete All Mtext, but DELMTEXT is what you type.

How to load it

Unzip the download and load the .lsp file with APPLOAD. Keep it out of the Startup Suite — a command that clears every note in the drawing is not one you want a keystroke away by accident. Our AutoLISP guide covers loading.

Step-by-step usage

  1. Save, or work on a copy.
  2. Type DELMTEXT. All multiline text is erased at once.
  3. Run the single-line text stripper as well if you want the drawing properly cleared.
  4. Check your layouts and frozen layers, since those were included.
  5. If it was a mistake, type U immediately.

Compatibility notes

Six lines of very basic AutoLISP driving ERASE. There is nothing in it that can age.

No dialog boxes and no Express Tools calls, so nothing requires the full product; LT users on LT 2024 or later, the release that brought AutoLISP to LT, should be able to run it. See what runs on AutoCAD LT. If you would rather have one command that clears both text types, merging the two files is a two-line job — the filter accepts a list.

Download

Name: Delete All Mtext
Description: Erase all Mtext in a drawing.
Type: AutoCAD AutoLISP Routine
Author: Anon
File Size: 1 Kb
Cost: Free
Worked on: AutoCAD
Download File: Delete mtext.zip

Related routines

  • Delete All Text — the other half of the pair.
  • Delete All Leaders — strips leaders the same way.
  • Delete All Dimensions — and dimensions.

References

  • AutoLISP: the complete guide
  • Free LISP routines library
  • AutoLISP on AutoCAD LT

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in