[Search tip detail and code files using keywords, tip number, author name, etc ]
 
A LISP Routine to Toggle the Menu Bar On and Off
Tip# 4063 By Leonid Nemirovsky On 04-Feb-2013
0
Rated By 0 users
Categories : CUI (Customize User Interface)
Software type : AutoCAD 2013
Rename File To : No Files to download.
If you turn the menu bar on or off frequently, this command will help you out.

Master tipster Leonid Nemirovsky has created a small LISP routine that will toggle the AutoCAD menu bar on and off in a simple way.

“Simply add this code to acad.lsp or acaddoc.lsp, or any MNL file, or whatever you use to load your AutoLISP automatically:

   (defun c:mb()
   (setq mb1 (getvar "menubar"))
      (cond
         ((= mb1 0)(setvar "menubar" 1))
         ((= mb1 1)(setvar "menubar" 0))
   )
   (princ)
   )

“Type MB at the Command prompt to toggle the menu bar on/off.”

Notes from Cadalyst Tip Reviewer Brian Benton: The menu bar in AutoCAD is that bar across the top of your screen that holds the command menus in it. Many users like to have it on so they can access commands and tools without going through the ribbon or toolbars. This routine makes it really easy to turn it off or on.

Load the routine and type MB on the Command line. It will toggle the menu bar on or off, depending on its current state. If you turn the menu bar on or off frequently, this command will help you out. Set it up to load automatically into AutoCAD, create a custom command from it, and add an icon for it to the quick access toolbar, or any toolbar, palette, panel, etc., to make it an easy and quick on/off toggle. This routine uses the system variable Menubar. This variable has two settings: 0 (for off) and 1 (for on). If you don’t want to use this command, you can type Menubar on the Command line and enter the setting you want.

 

Average Rating:
0


User comments
Comment by Edge,Soft
Posted on 2013-04-27 13:00:57
Thanks Leonid and Cadalyst, I have been using this one for years. Over time in the releases of software we have seen a progressive reduction in work space. More of the display is taken up with the mechanics of the software and less is available for doing the work the software was purchased for. I have seen users with 3/4 of their display occupied by menus and palettes. This means more time panning and zooming and less time actually creating designs. Yes, we have larger and higher resolution monitors, but they are generally used to get back the workspace we lost, not enlarge it. And yes we have more tools at hand with them on the display, but the need for large menus and palettes, exhibits a weakness in the software developer. As with operating systems, the mechanics of the software should be virtually invisible; this clears the screen, and hence the mind, for creation. This is a step in the right direction. I can already feel the backlash from this one. Regards, arthur
Comment by Aubin,Marcel
Posted on 2018-02-27 20:29:41
This routine is great but can be shorten to the following expression. (setvar "MENUBAR" (if (= (getvar "menubar") 0) 1 0))