NX Open Programmer's Guide > Execution Methods > Approaches for running custom programs in NX
Approaches for running custom programs in NX
Three approaches for automatically running custom plug-ins/programs when a specific NX event happens:
- User exits — invoked right after launching the command. See the User Exit table for the desired exit and its environment variable name.
- Part event callbacks / UF wrapper callbacks — independent of the UI, usually called toward the end of the internal process (exception: close-part callback fires before the part closes). Register/unregister via a generated ID. Details:
UF_add_callback_function(Open C Reference Guide); NX Open API equivalents live on thePartCollectionclass. Can be triggered by automation programs instead of invoking user exits. - Menuscript — PRE and POST actions run independently before/after a menu command.
Example: Hooking File → Save → Save
| Approach | How |
|---|---|
| User exits | Set the USER_FILE environment variable to a .dll defining the ufput entry point. |
| Part event callback | Register the method at startup using NXOpen::PartCollection::AddPartSavedHandler. |
| Menuscript PRE/POST action | Add a PRE or POST action to the UG_FILE_SAVE_PART button. |
Related Topics
- Journals with the Journal Manager
- Interactive NX (File → Execute → NX Open...)
- Automatically at NX Start up
- User Exits
- Remote Processes
- Executing Applications from GRIP
- UFMENU
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/xid1761976 · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)