Methods¶
Method | Description |
---|---|
AddMenuAction | Adds the action callback. |
ApplicationSwitchRequest | Registers a request to switch to specified application and open the corresponding user environment. |
GetButtonFromName | Finds the MenuButton associated with the given name |
RegisterApplication | Registers the application |
RegisterConfigureContextMenuCallback | Registers a callback that is called whenever a customizable context menu is about to be displayed. |
UnregisterConfigureContextMenuCallback | Unregisters a callback for customizing context menus. |
Enumerations¶
MenuBarManagerCallbackStatus Enumeration | Return values for action callbacks |
Method Detail¶
ApplicationSwitchRequest¶
-
MenuBarManager.
ApplicationSwitchRequest
¶ Registers a request to switch to specified application and open the corresponding user environment.
When the running journal or program finishes, the system will attempt to switch into the target application. The current application does not change immediately. The argument is an application button name as specified and registered in the ug_main.men file. For example specify UG_APP_MODELING to try to enter the modeling application. Button names registered for custom application as described in “Adding Custom Applications to NX” chapter of the NX Open Programmer’s Guide can also be used.
Signature
ApplicationSwitchRequest(applicationName)
Parameters: applicationName (str) – Button name of requested application New in version NX8.0.0.
Deprecated since version NX11.0.0: Use
NXOpen.Session.ApplicationSwitchImmediate()
instead.License requirements: None.
GetButtonFromName¶
-
MenuBarManager.
GetButtonFromName
¶ Finds the MenuButton associated with the given name
Signature
GetButtonFromName(name)
Parameters: name (str) – The name of the button. This name must match the button name used in the .men file. Returns: The button associated with the given name Return type: NXOpen.MenuBar.MenuButton
New in version NX6.0.0.
License requirements: None.
RegisterApplication¶
-
MenuBarManager.
RegisterApplication
¶ Registers the application
Signature
RegisterApplication(name, initializeCallback, enterCallback, exitCallback, supportsDrawings, supportsDesignInContext, supportsUndo)
Parameters: - name (str) – The name of the application. This name must match the string used in the .men file.
- initializeCallback (CallableObject) – The method used to initialize the application
- enterCallback (CallableObject) – The method called when entering the application
- exitCallback (CallableObject) – The method called when exiting the application
- supportsDrawings (bool) – Does this application support drawings?
- supportsDesignInContext (bool) – Does this application support design in context?
- supportsUndo (bool) – Does this application support undo?
Returns: Unique identifier for the registered application
Return type: int
New in version NX6.0.0.
License requirements: None.