AutoCAD – Drawings

How to exit a command in AutoCAD: Esc, BCLOSE, PSPACE, CLOSE and QUIT — what you leave decides how

Exit a command in AutoCAD with Esc, the Block Editor with BCLOSE, a viewport with PSPACE, a drawing with CLOSE, and AutoCAD itself with QUIT, EXIT or Ctrl+Q.

  • TS. Đỗ Quốc Hoàng
  • 9 min read
Five levels of exiting in AutoCAD: a running command, the Block Editor, a layout viewport, a drawing and AutoCAD itself Photo: Diagram by the Institute of Information Technology in Civil Engineering

"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 leaveUseAlias / key
A running commandEsc key—
The Block EditorBCLOSEBC
A layout viewportPSPACEPS
The open drawingCLOSEFile → Close
AutoCAD itselfQUITEXIT, 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 selectingObjects in the drawing
Press Esc4 → 4, nothing erased
Press Enter4 → 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:

ButtonResult
Save the changes to KHSaves the changes into the block, then closes
Discard the changes and close the Block EditorDrops the changes and closes; block KH still has 1 object
CancelStays 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.

The box shown by BCLOSE after a line was added to block KH: save into the block, discard the changes, or Cancel to stay in the Block Editor Photo: AutoCAD 2027 screenshot

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 Layout1CVPORT
Layout just opened1 (paper space)
MSPACE2 (inside the viewport)
PSPACE1 (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.

The save prompt from CLOSE on a changed drawing; QUIT, EXIT and Ctrl+Q show exactly this box Photo: AutoCAD 2027 screenshot

Quit command in AutoCAD

To shut the program down there are several routes, and all give the same result:

RouteSource
QUITThe command itself
EXITAlias of QUIT in acad.pgp
Ctrl+QKey assigned to the Quit item in acad.cuix
File → ExitClassic 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:

ButtonOn a drawing never saved (Drawing123)Result
YesOpens the Save Drawing As box for a nameSaves, 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:

  1. Press Esc once to stop the running command. The command line should show an empty Command:.
  2. If you are editing a block, type BC. If the Changes Not Saved box appears, read it and choose Save or Discard.
  3. If you are in a layout and have stepped into a viewport, type PS to return to paper space.
  4. Save the drawing with Ctrl+S (assigned to the Save item in acad.cuix) before closing.
  5. CLOSE to close the drawing, or QUIT to shut AutoCAD down.
SituationType
Started the wrong commandEsc
Finished editing a blockBC
Finished editing through a viewportPS
Done with one drawing, moving to anotherCLOSE
End of the working dayQUIT or Ctrl+Q

Many more aliases are listed in command aliases in AutoCAD.

Three things often repeated that are not true

Often repeatedWhat holds on the 2027 release
Esc in the middle of LINE loses every segment just drawnSegments already picked stay; Esc only drops the one in progress
QUIT shuts AutoCAD at once and loses unsaved workA changed drawing always gets a save prompt; Cancel keeps you in
Closing a drawing always shows a save promptAn 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.

About the author

TS. Đỗ Quốc Hoàng — Vice Director of the Institute of Information Technology in Civil Engineering, Hanoi University of Civil Engineering, and a specialist in software development for construction