• 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

DELTEXT LISP: Erase All Text in an AutoCAD Drawing

September 18, 2020

Last updated July 28, 2026

This routine erases every piece of text in the drawing. Not the text you select — all of it, everywhere, in one keystroke, with no confirmation and no chance to change your mind before it happens.

That is exactly what it says on the tin, and there are real jobs where it is what you want. But it is worth being blunt about the behaviour up front, because the command is short, easy to type by accident, and gives you no warning.

What it actually does

The routine builds a selection of every TEXT entity in the drawing database and erases the lot. Three consequences follow from how that selection is made, and none of them is obvious from the description.

  • Frozen and switched-off layers are included. The selection works on the drawing database rather than on what you can see, so text you have deliberately hidden is erased along with everything else.
  • Layouts are included. Text in paper space goes as well as text in model space. Title block annotation that is plain text rather than attributes will disappear.
  • Mtext survives. The filter asks for TEXT specifically, and multiline text is a different object type. So you get a drawing stripped of single-line text with all its paragraph text still in place — which is either exactly what you wanted or a confusing half-result, depending on the job.

If there is no text at all it tells you so and stops. That is the only message it produces.

When this is the right tool

Stripping a drawing you have been given so you can reuse the geometry without inheriting somebody else’s annotation. Preparing a background drawing for xref use where you want the linework and none of the labelling. Clearing out a drawing before re-annotating it to a new standard.

In each of those cases the alternative is a crossing window over the whole drawing plus a filter, which is more clicks for the same result. That is the value here.

What it is not is a general cleanup tool. Because it uses AutoCAD’s ERASE command rather than a lower-level delete, an immediate U will bring everything back — but only if you notice straight away. Run it, save, close, and the text is gone.

Command reference

The command is DELTEXT, which is worth noting because neither the file name nor the listing title says so. The file is called “Delete text.lsp” and the listing calls it Delete All Text, but what you type is DELTEXT.

Given what it does, the name is arguably too close to something you might type meaning to delete one piece of text. If you keep it loaded, consider renaming the command in the file to something you could not reach by accident.

How to load it

Unzip the download and load the .lsp file with APPLOAD. Our advice would be to load it when you need it rather than putting it in the Startup Suite — a command that erases every label in the drawing is not one you want quietly available in every session. Our AutoLISP guide covers loading.

Step-by-step usage

  1. Save your drawing, or work on a copy. This is not a step to skip.
  2. Type DELTEXT.
  3. All single-line text is erased immediately. There is no selection step and no confirmation.
  4. Check your layouts and your frozen layers, since those were included too.
  5. If it was a mistake, type U straight away.

Compatibility notes

Six lines of the most basic AutoLISP there is, driving AutoCAD’s own ERASE command. Nothing in it is version-specific and there is nothing to break.

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 want it to catch mtext as well, the filter is a single word in the file and adding a second entity type is a small edit.

Download

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

Related routines

  • Delete Layer — the same idea aimed at a layer rather than an object type.
  • CHT — restyle text rather than removing it.
  • Best of LISP collection — more drawing clean-up utilities.

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