UI Class¶
-
class
NXOpen.
UI
¶ Bases:
NXOpen.TaggedObject
This class contains the various elements that represent the NX User Interface.
There is a single instance of this class per session. To obtain a reference to the current UI, call the static method
UI.GetUI
.For language bindings that support remoting, the server must export it for this class to be obtained by a client.
Use the static method in this class to obtain an instance.
New in version NX3.0.0.
Methods¶
Method | Description |
---|---|
AddUtilityFunctionVisibilityHandler | Registers a user defined method that is called whenever an utility function state changes. |
AskLockStatus | Query NX lock status. |
CanOpenPart | Returns a flag indicating whether the NX user interface is in a state where opening a part and making it the display part is supported. |
CreateCustomPopupMenuHandler | Create a custom menu. |
CreateDialog | Creates a block dialog. |
JournalPause | Pauses execution of a journal. |
LockAccess | Locks access to the NX User Interface. |
RemoveUtilityFunctionVisibilityHandler | Unregisters a user defined method that is called whenever an utility function state changes. |
UnlockAccess | Unlocks access for a UI that has been locked by a call to LockAccess . |
Enumerations¶
UIStatus Enumeration | Indicates the Lock, Unlock status of NX functions. |
Method Detail¶
AddUtilityFunctionVisibilityHandler¶
-
UI.
AddUtilityFunctionVisibilityHandler
¶ Registers a user defined method that is called whenever an utility function state changes.
Signature
AddUtilityFunctionVisibilityHandler(utilityFunctionVisibilityHandler)
Parameters: utilityFunctionVisibilityHandler (CallableObject) – Returns: identifier of registered method (used to unregister the method) Return type: int New in version NX5.0.5.
License requirements: None.
AskLockStatus¶
-
UI.
AskLockStatus
¶ Query NX lock status.
This function is useful when dismissing a custom dialog and you want to determine whether or not a lock has been set. Returns :py:class:` UIStatus.Lock < UIStatus>`, when NX is in lock status. Returns :py:class:` UIStatus.Unlock < UIStatus>`, when NX is in unlock status.
Signature
AskLockStatus()
Returns: Return type: NXOpen.UIStatus
New in version NX5.0.0.
License requirements: None.
CanOpenPart¶
-
UI.
CanOpenPart
¶ Returns a flag indicating whether the NX user interface is in a state where opening a part and making it the display part is supported.
For example if certain dialogs are displayed or the system is in a task environment it is not supported
Signature
CanOpenPart()
Returns: Return type: bool New in version NX8.5.0.
License requirements: None.
CreateDialog¶
-
UI.
CreateDialog
¶ Creates a block dialog.
Use <code>#undef CreateDialog</code> in C++ programs to avoid confusion with Windows API
Signature
CreateDialog(dialogName)
Parameters: dialogName (str) – Dialog name NOTE: The full Unicode character set is not supported for this parameter. Returns: Return type: NXOpen.BlockStyler.BlockDialog
New in version NX6.0.0.
License requirements: None.
JournalPause¶
-
UI.
JournalPause
¶ Pauses execution of a journal.
Signature
JournalPause()
New in version NX4.0.0.
License requirements: None.
LockAccess¶
-
UI.
LockAccess
¶ Locks access to the NX User Interface.
This method may be used for a custom dialog that requires the session to remain in a known state. When this method is called, all menu items that would allow the user to edit the model are grayed out.
Note that until
UnlockAccess
is called, the user will not be able to interact with the session. You must ensure that the UI is unlocked when the custom dialog terminates.This method will throw an exception if the UI cannot be locked. Note that if the UI has already been locked, then it is safe to call this method again.
Signature
LockAccess()
New in version NX3.0.0.
License requirements: None.
RemoveUtilityFunctionVisibilityHandler¶
-
UI.
RemoveUtilityFunctionVisibilityHandler
¶ Unregisters a user defined method that is called whenever an utility function state changes.
Signature
RemoveUtilityFunctionVisibilityHandler(id)
Parameters: id (int) – identifier for method to unregister New in version NX5.0.5.
License requirements: None.
UnlockAccess¶
-
UI.
UnlockAccess
¶ Unlocks access for a UI that has been locked by a call to
LockAccess
. If the UI is already unlocked, this method has no effect.Signature
UnlockAccess()
New in version NX3.0.0.
License requirements: None.