I wanted a full-screen shortcut like Internet Exploder, Firefox and other web browsers, just for having a good look at a drawing on the whole screen with no distractions.
The Cleanscreen command is a good start but it didn’t go far enough for me, so I hacked it and added a few things to it. Now my full-screen has only the Top window bar with the quick-access menu and nothing else. Just this …
… the thin edge of the window itself and wall-to wall CAD.
- F11 –> Absolutely everything disappears. Full-on full screen
- F11 again –> all the toolbars, status bar, menus come back to their rightful place
Open the CUI Editor and follow the instructions in AutoCAD’s help system – F1 –> search for “To create or modify a shortcut key”. Their well-illustrated explanation saves me cobbling one together. The only thing I’ll add to their instructions is that you can narrow your search of commands by typing any (that’s cool) part of the command’s name in the search box in the Command List section of the CUI window (bottom-left).
I dragged the “Clean Window” command onto the Shortcut Keys node. This is the command I started with before I broke perfected it. Click on the Macro line of the command section on the right in the CUI window (highlighted in red), then click on the […] box that appears on the right (trust me, it appears).
… then paste this code in the Long String Editor (actually, read to the end of this post because there is a better version below. I left this here for history’s sake)
$M=$(if,$(and,$(getvar,CleanScreenState),1),^C^C_CleanScreenOFF _commandline _MenuBar 1 statusbar 1,^C^C_CleanScreenON _commandlinehide _MenuBar 0 statusbar 0)
It is important to note that the spaces in the command list are significant so make sure you select all of it at once. The spaces (and commas, as it turns out) are the same as pressing the enter-key to execute the command. The observant amongst you will notice there are a few more characters in the screenshot. My original code needed a bit of a tidy-up.
If you haven’t already, assign a key to the shortcut, as per Help’s instructions. I used F11. Why? It is the same shortcut for most Internet browsers to go full-screen. For once, I’d like AutoCAD’s User eXperience to match something from the real world. Don’t get me started on that. Find. Replace. 3 Tab stops. Why?
That’s the practical part, done.
How it Works
For those of you who love to know how it works, here it is in its 3 parts. It is a Diesel (see AutoCAD –> F1) Macro. Notice that there are 3x commas in the if command which wraps the macro. The format of this macro is basically [Test], [Do if True], [Do if False]. Here is the same macro on 3 lines
^C^C_CleanScreenOFF _commandline _MenuBar 1 statusbar 1,
^C^C_CleanScreenON _commandlinehide _MenuBar 0 statusbar 0)
Working through the macro, this is what it does
- the first part checks to see whether you’re in Cleanscreen mode or not.
- the rest of the macro is in two halves, Cleanscreen on, Cleanscreen off
- wherever you see ^C^C_ that means Ctrl-C, twice. This exits any lingering previous commands. My original code had a few superfluous Ctrl-C's.
- CleanScreenOFF returns the menus etc. that the CleanScreenON command in the 2nd half of the macro hides
- commandline restores the command line which is hidden by commandlinehide
- MenuBar 1 and MenuBar 0 restore / hides the file-menu bar at the top for old farts like me who have grown attached to it.
- statusbar 1 and statusbar 0 show and hide the status bar which is right at the bottom of the AutoCAD window.
- as yet I haven't figured out how to show and hide the Model / Paper Space tabs.
Remove any of the above combinations if they don’t suit you. Don't forget the ^C^C_ at the start and the trailing space. Feel free to add anything to the macro and also please add it here to the comments.
**Update** I figured out how to show & hide the Model / Paper Space tabs.
Add the code below to the bottom of your acadXXXXdoc.lsp (XXXX is the version of AutoCAD you are using). I found it in C: - Program Files - Autodesk - AutoCAD 2011 - Support. **Update** My bad - you are not meant to modify these files. Find (or if it doesn't exist, create) a file called acaddoc.lsp. See the link in the previous sentence for where to create this, depending on how specific you want it to be. By default AutoCAD will walk the support paths list looking for it. Basically, just put it somewhere in your support path, perhaps in the same place as the one you're not meant to modify.
The following LISP code sets up the commands to show and hide the Model / Paper Space tabs. You can actually use the commands anytime you want. Use Notepad or a similar plain text editor. DO NOT USE WORD !! Make a backup first, just in case. Watch out you don't miss any brackets - they are annoyingly important)
(DEFUN C:MLTABSON ()
(setenv "ShowTabs" "1") () (PRINC)
(DEFUN C:MLTABSOff ()
(setenv "ShowTabs" "0") () (PRINC)
Before these lines at the end of the acaddoc.lsp file (or add them if they don't exist):
;; Silent load.
The new macro to paste in the Long String Editor is:
$M=$(if,$(and,$(getvar,CleanScreenState),1),^C^C_CleanScreenOFF _commandline _MenuBar 1 statusbar 1 MLTABSON,^C^C_CleanScreenON _commandlinehide _MenuBar 0 statusbar 0 MLTABSOFF)
Here’s a tip conveniently placed at the end to see who dived in and who read the whole post before tinkering … Open a text editor and copy-paste your macro code at various crucial stages. This will give you an easy way to go back if you miss a space, comma or just generally mess it up.