NX Open Programmer's Guide > Execution Methods > Automatically at NX Start up
Automatically at NX Start up
NX automatically loads all application libraries in the startup directory (see Application Directory Structure) when NX loads: first internal libraries, then custom libraries in startup, then immediately executes the standard startup entry point.
Startup Entry Point by Language
| Language | Signature |
|---|---|
| C/C++ | int ufsta( void ) |
| VB.NET | Function Startup() As Integer |
| Java | int startup(void) |
| Python | def startup(argc, args): return <number> |
Custom code in the startup entry point should be restricted to methods on session objects — e.g. registering part/UDO callbacks, registering dialog boxes, etc. Startup is the recommended place to load/execute an application in these situations:
- Registering dialogs for menu bar/toolbar: register custom UI Styler or Block Styler dialogs at startup.
- Registering UDO callbacks: User Defined Objects have their own callbacks (display, edit, update, delete, etc.), specific to a UDO class — register them at startup (see "User Defined Objects").
- Registering part callbacks: NX Open provides callbacks for part actions (Part Open, Part Close, Part Save, Part New, etc. — see "Part Callbacks"); register these at startup so NX invokes the custom callback module whenever the user performs part actions.
Unloading the Application
Applications loaded at startup can be terminated normally. If the application registers part or UDO callbacks, it must use the "At Termination" unload option (see "Unload Options") rather than unloading earlier.
Related Topics
- Journals with the Journal Manager
- Interactive NX (File → Execute → NX Open...)
- Approaches for running custom programs in NX
- User Exits
- Remote Processes
- Executing Applications from GRIP
- UFMENU
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/executing_at_startup · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)