"Exit" means five different things in AutoCAD. It can mean abandoning a running command. It can also mean leaving the Block Editor, leaving a viewport in a layout, closing a drawing, or shutting the program down. Each level has its own way out, and using the wrong one either raises an error or does nothing.
This article walks through all five in AutoCAD 2027 with the acadiso.dwt template: how to exit a command in AutoCAD with Esc, leave the Block Editor with BCLOSE, leave a viewport with PSPACE, close a drawing with CLOSE, and quit AutoCAD with QUIT. Typing commands in general is covered in how to enter commands in AutoCAD. For drafting taught properly, the Institute runs an AutoCAD course for construction.
Five levels and the way out of each
| To leave | Use | Alias / key |
|---|---|---|
| A running command | Esc key | — |
| The Block Editor | BCLOSE | BC |
| A layout viewport | PSPACE | PS |
| The open drawing | CLOSE | File → Close |
| AutoCAD itself | QUIT | EXIT, Ctrl+Q, File → Exit |
Aliases come from the 2027 acad.pgp file; menu locations and the Ctrl+Q key come from acad.cuix. In acad.pgp, EXIT is an alias of QUIT, so the two words are one command. The Autodesk documentation on QUIT describes it as exiting the program.
All five levels share one rule: if nothing has changed, AutoCAD leaves at once without asking. A save prompt appears only after you have changed something.
Exit a command in AutoCAD with Esc
In the middle of a command, press Esc. The command line prints *Cancel* and returns to Command:. The CMDNAMES variable, which holds the name of the running command, goes back to empty.
The key point is that Esc cancels the step in progress, not what the command has already finished. Draw a LINE through 0,0, 100,0, 100,100, then press Esc:
Specify next point or [Close/Undo]: *Cancel*
The two segments already drawn stay in the drawing. Repeat exactly, but press Enter instead of Esc, and you also get two segments. In a drawing command like LINE, each segment is created the moment you pick its point, so Esc and Enter both end the command and keep the segments.
Editing commands behave quite differently. Start ERASE, pick one line, and AutoCAD reports 1 found:
| After selecting | Objects in the drawing |
|---|---|
Press Esc | 4 → 4, nothing erased |
Press Enter | 4 → 3, erased |
In an editing command, the edit happens only after Enter confirms the selection. Esc before that abandons the whole command. That is the safe move when you have picked the wrong objects in ERASE: press Esc before Enter. Erasing is covered in the erase command.
Close Block Editor: BCLOSE
While editing a block in the Block Editor, the drawing area shows only the block's contents. To return to the drawing, type BCLOSE or its alias BC.
Open block KH (one circle) with -BEDIT; the BLOCKEDITOR variable goes to 1. Type BCLOSE without changing anything: the Block Editor closes at once, BLOCKEDITOR returns to 0, and no box appears.
Open it again, draw one extra line, then BCLOSE. This time the Block - Changes Not Saved box appears with three buttons:
| Button | Result |
|---|---|
| Save the changes to KH | Saves the changes into the block, then closes |
| Discard the changes and close the Block Editor | Drops the changes and closes; block KH still has 1 object |
| Cancel | Stays in the Block Editor; BLOCKEDITOR is still 1 |
Inside the Block Editor, commands from other levels are blocked. Type PSPACE there and AutoCAD says:
** PSPACE command not allowed in block editor. **
So to do anything else you must BCLOSE first. Opening and editing blocks is covered in editing a block.
Exit viewport: PSPACE
In a layout you can step inside a viewport and edit model-space geometry through it. To return to paper space, type PSPACE or its alias PS.
The CVPORT variable tells you where you are:
| Action in Layout1 | CVPORT |
|---|---|
| Layout just opened | 1 (paper space) |
MSPACE | 2 (inside the viewport) |
PSPACE | 1 (back on paper) |
Typing PSPACE when you are already in paper space only prints Already in paper space. and does nothing. The opposite command, MSPACE (alias MS), is how you step into a viewport.
Leave the viewport before editing the title block or notes on the sheet, so you are sure you are working on paper and not through the viewport. Creating and clipping viewports is covered in clipping a viewport, and layouts in general in layouts in AutoCAD.
Close a drawing: CLOSE and CLOSEALL
CLOSE closes the current drawing while AutoCAD keeps running. Menu: File → Close.
On a freshly opened drawing with no changes (DBMOD = 0), CLOSE closes it at once without asking. The number of open drawings drops from 2 to 1.
On a changed drawing, a box titled AutoCAD appears:
Save changes to Drawing123.dwg?
Its three buttons, Yes, No and Cancel, are covered in a later section.
With several drawings open, CLOSEALL closes them all in one command. It sits in the Express menu, under File tools. With two changed drawings, AutoCAD asks twice, one box per drawing, and the drawing opened last is asked about first. Answer No both times and both drawings close; the number of open drawings drops to 0 while AutoCAD keeps running.
Quit command in AutoCAD
To shut the program down there are several routes, and all give the same result:
| Route | Source |
|---|---|
QUIT | The command itself |
EXIT | Alias of QUIT in acad.pgp |
Ctrl+Q | Key assigned to the Quit item in acad.cuix |
| File → Exit | Classic menu |
With one changed drawing open, QUIT, EXIT and Ctrl+Q each show exactly the same box: Save changes to Drawing123.dwg? with Yes, No and Cancel. Press Cancel in each case and AutoCAD stays open, the drawing is intact, and no command is left hanging.
In other words, the quit command in AutoCAD never throws away a changed drawing without asking. The save prompt is the last stop; changes are dropped only when you press No.
Yes, No, Cancel: which button
The save prompt from CLOSE, CLOSEALL and QUIT is the same box, so it only needs learning once:
| Button | On a drawing never saved (Drawing123) | Result |
|---|---|---|
Yes | Opens the Save Drawing As box for a name | Saves, then closes; Cancel in that box leaves the drawing open |
No | — | Closes, dropping every unsaved change |
Cancel | — | Closes nothing; back to work |
Pressing Yes on a drawing that has never been saved does not close it straight away: AutoCAD opens Save Drawing As. Press Cancel in that box and the number of open drawings is still 1; the drawing is intact and still open.
No is the only button that loses work. CLOSE then No on a scratch drawing closed it, and the number of open drawings dropped to 0. When in doubt, press Cancel and save by hand to be sure.
Leaving the right level: a safe order
When the screen is confusing and you are not sure where you are, work from the smallest level outwards:
- Press
Esconce to stop the running command. The command line should show an emptyCommand:. - If you are editing a block, type
BC. If the Changes Not Saved box appears, read it and choose Save or Discard. - If you are in a layout and have stepped into a viewport, type
PSto return to paper space. - Save the drawing with
Ctrl+S(assigned to the Save item inacad.cuix) before closing. CLOSEto close the drawing, orQUITto shut AutoCAD down.
| Situation | Type |
|---|---|
| Started the wrong command | Esc |
| Finished editing a block | BC |
| Finished editing through a viewport | PS |
| Done with one drawing, moving to another | CLOSE |
| End of the working day | QUIT or Ctrl+Q |
Many more aliases are listed in command aliases in AutoCAD.
Three things often repeated that are not true
| Often repeated | What holds on the 2027 release |
|---|---|
| Esc in the middle of LINE loses every segment just drawn | Segments already picked stay; Esc only drops the one in progress |
| QUIT shuts AutoCAD at once and loses unsaved work | A changed drawing always gets a save prompt; Cancel keeps you in |
| Closing a drawing always shows a save prompt | An unchanged drawing closes at once without asking |
Frequently asked questions
Which key exits a command in AutoCAD?
Esc. The command line prints *Cancel* and returns to Command:. In a drawing command the finished part stays; in an editing command like ERASE, nothing is changed until you press Enter.
How do I close the Block Editor?
Type BCLOSE or BC. If you changed the block, the Block - Changes Not Saved box asks whether to save or discard.
How do I exit a viewport in a layout?
Type PSPACE or PS. CVPORT returns to 1, meaning you are back in paper space.
Are EXIT and QUIT different?
No. In acad.pgp, EXIT is an alias of QUIT, and both show the same save prompt as Ctrl+Q.
I pressed QUIT by mistake. How do I keep AutoCAD open?
If the drawing has changes, press Cancel in the save prompt: AutoCAD stays open and the drawing is intact.
Can I close several drawings at once?
Yes, with CLOSEALL. It asks about each changed drawing separately, then closes them all while AutoCAD keeps running.