NX Open Programmer's Guide > Execution Methods > Programs, Journals, or Callbacks from Existing Menu Items > Executing Programs
Executing Programs
Any program can be linked to a menu button — including applications unrelated to NX (e.g. a web browser) or custom NX applications written with the Common API.
Executing Programs Unrelated to NX
Example (go_to_siemens.men, placed in the startup directory) launches the Siemens website via Internet Explorer before showing the Open Part dialog when File tab → Open is activated:
VERSION 120
EDIT UG_GATEWAY_MAIN_MENUBAR
AFTER UG_FILE_OPEN
BUTTON SAMPLE_GO_TO_SIEMENS
LABEL Go to Siemens.com
ACTIONS/REPLACE "start iexplore http://www.siemens.com" STANDARD
END_OF_AFTER
Executing Common API Programs
To run a custom Common API program from a menu item, it must include a valid entry point: ufusr (C/C++), Main (C#/VB), or main (Java). Once compiled, only the library name is needed on the ACTIONS line — except Java class/jar files, which need their file extension specified. Since library extensions aren't referenced for compiled binaries and Java extensions are identical across platforms, the same menu file works on both Windows and non-Windows.
Example (my_programs.men) invokes a C# then a VB program before the standard Open File dialog, followed by a C++ then a Java program, all triggered by File tab → Open...:
VERSION 120
EDIT UG_GATEWAY_MAIN_MENUBAR
AFTER UG_FILE_NEW
BUTTON UG_FILE_OPEN
LABEL Open...
ACTIONS/REPLACE c_sharp_program vb_program STANDARD cpp_program java_program
END_OF_AFTER
Note: VB and C# are unavailable on non-Windows systems — omit references to VB/C# programs from menu files intended to run there.
The compiled files (c_sharp_program.dll, vb_program.dll, cpp_program.dll, java_program.class) should all be placed in the application folder.
Related Topics
- Programs, Journals, or Callbacks from Existing Menu Items
- Example Menu File with Actions
- Executing Journals
- Executing Callbacks (Menu Event Handlers)
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/existing_menu_executing_programs · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)