Erasing is the first thing anyone learns in CAD. Yet two situations still catch experienced users out: a selection window that takes lines you meant to keep, and an accidental erase noticed only after drawing several new lines, when undoing feels too risky. The erase command in AutoCAD has an answer to both, and few people use it.
This article works through five examples, each with a concrete result. For the whole editing toolkit, the Institute runs an AutoCAD course for construction.
What ERASE does, and where to start it
Autodesk sums it up in one line: "Removes objects from a drawing."
Read straight from the 2027 configuration files, there are four ways in.
| Entry point | What to use |
|---|---|
| Full command | ERASE |
| Alias | E, and also DELETE |
| Ribbon | Home → Modify → Erase |
| Classic menu | Edit → Delete |
The quickest route of all is to select objects first and press the Delete key.
The PICKFIRST variable
Selecting first and then giving the command works because of the PICKFIRST variable. In a new drawing it is 1, which allows selection before the command.
If one day you select objects, type E, and AutoCAD asks you to select again as though nothing were selected, check PICKFIRST. At 0 AutoCAD accepts only command-first, select-second. Set it back to 1 and the select-first habit works again.
The prompts, step by step
| Step | The prompt | What you do |
|---|---|---|
| 1 | Select objects: | Select what to erase |
| 2 | Select objects: | Enter to erase |
At the Select objects: prompt, three letters are worth knowing. According to Autodesk's ERASE page, you can type "L to erase the last object drawn, p to erase the previous selection set, or ALL to erase all objects".
| Type | What gets erased |
|---|---|
L | The last object drawn |
P | The set selected by the previous command |
ALL | Everything in the drawing, including what is off screen |
Be careful with ALL: it takes things you cannot see. There is almost never a reason to use it on a real drawing.
Example 1: erasing one object
Draw three parallel lines 1000 long, 200 apart, at y = 0, y = 200 and y = 400. Type E, pick the middle one, Enter.
Two lines remain; the middle one is gone. This is the basic method, fine when only a few objects need to go. You can keep picking before pressing Enter, and every object you pick is added to the set that will be erased together.
Where several objects overlap at the spot you want to click, hover first and watch which one highlights. Picking the one underneath by mistake is the most common slip when erasing one at a time.
Example 2: window and crossing selection
This is where people lose lines they meant to keep. Set up three lines as follows.
| Line | From | To | Relation to the box |
|---|---|---|---|
| A | 100,0 | 400,0 | Wholly inside |
| B | 300,300 | 900,300 | Partly inside, partly outside |
| C | 1200,600 | 1500,600 | Wholly outside |
Use a selection box from 0,-100 to 600,400.
Window, dragged left to right. Type E, drag that box from the left corner to the right, Enter. Only line A is erased, because only A lies wholly inside. Line B merely touches the box and survives.
Crossing, dragged right to left. Set up the same lines again and drag the box from right to left. Both A and B go, because a crossing box also takes objects that merely touch it. Line C remains.
| How you drag | What remains |
|---|---|
| Left to right | B and C |
| Right to left | C only |
This matters most on a crowded floor plan. Suppose you want to clear the furniture from one room. A crossing box dragged right to left over the room will also catch the walls, doors and dimension lines that cross its edge. A window dragged left to right, drawn just inside the walls, takes only the furniture that sits wholly within the room and leaves everything else alone.
To avoid ever getting this wrong, watch the fill colour of the box. Both box types and every other way of selecting are covered in our article on selecting objects in AutoCAD.
Example 3: OOPS versus U
This is the example most worth trying. The situation is familiar: you erase the wrong line, carry on drawing a few more without noticing, and now want the erased line back without losing the new ones.
Follow three steps, twice, restoring a different way each time.
| Step | Run 1 | Run 2 |
|---|---|---|
| 1 | Draw line A, then E to erase it | Draw line A, then E to erase it |
| 2 | Type L and draw a new line C | Type L and draw a new line C |
| 3 | Type OOPS | Type U |
| Result | A comes back, C stays | C disappears, A stays erased |
Run 2 shows what U really does: it steps back exactly one operation, and the last operation was drawing line C. To get A back with U you would have to step back again, losing C.
Run 1 is the right way. The oops command in AutoCAD is described by Autodesk as follows: "OOPS restores objects erased by the last ERASE command." It remembers only the most recent erase, but it does not care what you have done since.
That is how to recover an erased object without sacrificing the work you have done since.
The same page mentions a second, less obvious use: "You can also use OOPS after BLOCK or WBLOCK because these commands have options that can erase the selected objects after creating a block." If you turned some geometry into a block, chose to delete the originals, and then realised you still needed them in place, this is the command that Autodesk points to for bringing the originals back. Stepping back and forward through many operations is covered in our article on UNDO in AutoCAD.
Example 4: erase the last object
Draw two lines, the first at y = 0 and the second at y = 300. Type E, then L, and press Enter twice.
The last one drawn, the line at y = 300, is erased. The other stays.
This is handy when you have just drawn a wrong line on top of several others and it is hard to pick. No picking needed: L finds the newest object for you, wherever it happens to be.
Example 5: "was on a locked layer"
Draw a line on a layer and lock that layer. Type E, pick the line, Enter.
The line stays, and the command line reports 1 was on a locked layer. Objects on locked layers are skipped, and AutoCAD tells you how many it skipped.
That is a feature, not a fault. Locking the title-block layer, the grid layer and reference layers is the surest way to stop a hasty selection window from taking them. To erase such an object, unlock the layer first. Locking and unlocking layers is covered in our article on layers in AutoCAD.
ERASE versus other clean-up commands
ERASE removes only what you select. Three other clean-up jobs sound similar but are different commands.
| Job | Use |
|---|---|
| Remove what you select | ERASE |
| Remove duplicate, overlapping lines | the OVERKILL command |
| Remove a layer and everything on it | deleting layers |
Autodesk notes one limit of OOPS: "You cannot use OOPS to restore objects on a layer that has been removed with the PURGE command." Once a layer has been purged, this route no longer works.
Three things often repeated that are not true
| Often heard | What the 2027 release actually does |
|---|---|
Erased by mistake? Just press U | U undoes the last operation; if you have drawn since, you lose that too |
OOPS works only straight after erasing | You can draw more first and still OOPS; the new lines stay |
| Every selection box erases the same things | Left to right takes only what lies wholly inside; right to left also takes what touches |
Frequently asked questions
What is the alias for the erase command in AutoCAD?
E. Or select objects first and press the Delete key.
I erased something by mistake and then drew more. How do I get it back?
Type OOPS. It restores the most recent erase without touching what you drew afterwards.
Why did my selection box erase lines I wanted to keep?
You dragged right to left. That crossing box also takes objects that only touch it. Drag left to right to take only what lies wholly inside.
What does "was on a locked layer" mean?
The object is on a locked layer, so it was not erased. Unlock the layer and erase again.
How do I erase something I have just drawn but cannot pick?
Type E, then L to select the last object drawn.