NX Open Programmer's Guide > Execution Methods > Programs, Journals, or Callbacks from Existing Menu Items > Example Menu File with Actions
Example Menu File with Actions
Example .men file adding pre/post actions to the existing File tab → Open menu item:
VERSION 120
EDIT UG_GATEWAY_MAIN_MENUBAR
MODIFY
BUTTON UG_FILE_OPEN
LABEL Open...
ACTIONS/REPLACE my_app_hello STANDARD my_app_goodbye
END_OF_MODIFY
my_app_hello and my_app_goodbye can each be an entire program, the name of a journal file, or a callback registered via AddMenuAction (C++, VB, or C#), addMenuAction (Java), or UF_MB_add_actions (Open C). This menu file causes my_app_hello to execute before the standard NX File Open dialog, and my_app_goodbye to execute after. For sample callback implementations, see the language-specific sections under "Executing Programs, Journals, and Callbacks from New Menu Items".
Note: The MODIFY command is used (rather than adding a new item) to preserve the existing position of the button within the File menu.
Related Topics
- Programs, Journals, or Callbacks from Existing Menu Items
- Executing Programs
- Executing Journals
- Executing Callbacks (Menu Event Handlers)
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.nxopen_prog_guide/existing_menu_example_menu_file_w_actions · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)