How to Create Context Menus in BricsCAD
Quick answer: SHORTCUTMENU controls whether context (shortcut) menus are available at all, across three distinct modes: Default, Edit, and Command.
The Three Context Menu Modes
- Default mode: shows the Default context menu when no command is running and nothing is selected.
- Edit mode: shows the Edit context menu when a selection exists. This is context-sensitive, if a specific shortcut menu exists for the selected entity type, its content gets appended to the Edit menu. Selecting an MText entity, for example, adds the Multiline Text Object menu’s content to it.
- Command mode: shows the Command context menu while a command is running.
Right-Click Behavior Nuances
This refines something covered more generally on this hub’s Right-Click Menus page: with bitcode 16 of SHORTCUTMENU set, a plain right-click repeats the previous command instead of opening a menu, you need a long right-click (holding the button down) to see shortcut menus at all. And with bitcode 4 of QUADDISPLAY set (Show Quad on right-click), shortcut menus only appear if bitcode 16 of SHORTCUTMENU is also set, the two settings interact directly.
Special Shortcut Menus
- Grips: appears on right-click while editing an entity with grips.
- Entity Snap: with
MBUTTONPANoff, appears on a middle mouse button click; with it on, appears on Shift+Right-Click instead, the same behaviour covered on the View Manipulation page in this hub.
Creating a Shortcut Menu
- In the Customize dialog, click the Menus tab.
- Either click the Context Menus subgroup, right-click, and choose Append context menu (adds it below the last existing one), or select an existing context menu, right-click, and choose Insert context menu (adds it above the selected one). The Add Context Menu dialog opens.
- Type a name in the Menu title field.
- For a regular context menu: choose As regular context menu, click Add Context…, and select a context alias, CMCOMMAND, CMDEFAULT, CMEDIT, GRIPS, or SNAP, corresponding to the modes and special menus above. Add more aliases if needed, then click OK.
- For an entity-specific context menu instead: choose As context menu on specific entities, click Add Entity Types…, tick One entity and/or Multiple entities, select the relevant entity types, and click OK. Optionally click Add Custom… to add a custom alias too, then click OK to finish.
- Add tools to the context menu.
Frequently Asked Questions
Why does right-clicking repeat my last command instead of showing a menu? Bitcode 16 of SHORTCUTMENU is likely set; hold the right mouse button down longer (a long right-click) to see the shortcut menu instead.
Why doesn’t the Quad appear on right-click even though I’ve enabled that option? Check that bitcode 16 of SHORTCUTMENU is also set, QUADDISPLAY‘s right-click option depends on it.
What’s the difference between a regular and an entity-specific context menu? A regular one is tied to a general context alias like CMEDIT or GRIPS. An entity-specific one only appears when particular entity types are selected.
Does selecting a specific entity type add anything to the general Edit context menu? Yes, if a dedicated shortcut menu exists for that entity type, its content gets appended to the Edit context menu automatically.