NXKnowledge

Community Knowledge > Best Practices

MenuScript and Custom Menus/Ribbons: Practical Deployment Advice

Community guidance on adding custom menu items, ribbon groups, and toolbar buttons to NX — an area where the mechanics (RTB/MEN files, custom_dirs.dat) are thinly documented officially but well covered by forum practitioners.

Don't edit NX's own menu/ribbon files directly

The single most important piece of deployment advice from community discussion: NX does not like you modifying its own core menu/ribbon files — it will tend to overwrite your changes on the next update. The recommended pattern instead is to maintain your custom menus/ribbons as separate files and "patch them in" via the custom_dirs.dat mechanism, which is described as meaningfully easier to maintain across NX updates than editing NX's shipped menu definitions in place.

RTB and MEN files share the same pseudo-language

Both .RTB (ribbon) and .MEN (menu) files use the same MenuScript pseudo-language. A practical consequence called out in community discussion: you can define a custom button once in a .MEN file and then reference/reuse it from an .RTB file, rather than duplicating the button definition in both places.

No runtime ribbon-tab merging

A specific limitation raised on the Siemens community ("MENUSCRIPT: how to add new group to existing tab"): there is no way to merge ribbon tabs at runtime. If you need a custom group to appear alongside existing groups in a shared ribbon tab, the practical workaround is to maintain a global ribbon tab file that is aware of all the group files that should appear in it — i.e., you own and regenerate the whole tab definition, rather than trying to inject a group into a tab NX (or another customization) already owns.

Where to find the official MenuScript reference

Buried inside NX's own help rather than being a standalone web page: Help → "programming tools" → "menuscript user's guide." Community discussion notes that NX 8 and later don't install these programming help files by default — they may need to be installed separately as part of the NX help documentation setup, which is a common reason developers can't find this guide when they first go looking for it.

The zero-code path: adding a journal to a toolbar button

For simpler cases that don't need full MenuScript/ribbon customization, NX Journaling documents a purely UI-driven path to bind a journal to a button:

  1. Open Tools → Customize (or Ctrl-1, or right-click in the menu/toolbar area).
  2. In the Customize dialog's Commands tab, drag a New Button command onto the target toolbar.
  3. Right-click the new button to rename it / assign an icon, then choose Edit Action.
  4. In the Action dialog, set Type to Journal File and browse to the journal.

Caveat worth flagging to users of this approach: these customizations are machine-specific, stored under the user's local AppData (Siemens/Unigraphics Solutions folder), and only persist across sessions if "save layout at exit" is enabled and NX is closed properly. For enterprise-wide deployment (same button available to every user), MenuScript + .NET samples and proper deployment via custom_dirs.dat is the documented path instead of relying on this per-user Customize dialog approach.

Practical takeaway

  • Never edit NX's shipped menu/ribbon files directly — maintain your own files and register them via custom_dirs.dat.
  • For enterprise deployment of a custom ribbon group, own a global ribbon tab file rather than trying to merge into an existing tab at runtime.
  • For personal/one-off journal buttons, the Tools → Customize → New Button → Edit Action → Journal File path is the fastest route and needs no MenuScript at all — but it's per-machine, not something you can roll out fleet-wide.

Source: https://community.sw.siemens.com/s/question/0D54O00007bO6nmSAC/how-to-add-the-custom-menu-in-nx-ribbon ; https://community.plm.automation.siemens.com/t5/NX-Programming-Customization-Forum/MENUSCRIPT-how-to-add-new-group-to-exsiting-tab/td-p/321909 ; https://www.nxjournaling.com/content/start-journal-custom-button ; https://nxjournaling.com/content/menuscript-users-guide · retrieved 2026-07-08