cancel
Showing results for
Did you mean:

Need help with Ribbon running executable programs

Creator

I have a NX7.5 TBR that I have been displaying in a ribbon enviroment in NX9 but the system command types (Exe files) will not run. I get the error "unknown Action Type: listing out the path and command". We are running NX9.0.3.4 and I can create icons within NX that works, but can't get the ribbon based icons to run without the error. What I am trying to do is to add the ribbon commands behind the TBR callout. See RBN file that I am using below.

!
! Crown Engineering Toolbar
!
!

TITLE Engineering tools
VERSION 170

GROUP engineering.tbr

SEPARATOR

BEGIN_DROPDOWN ENG_TOOLS
COLUMN_DROPDOWN 1

BUTTON Y145
LABEL ANSE Y14.5 Online
RIBBON_STYLE ALWAYS_LARGE_IMAGE
BITMAP asme.bmp
ACTION u:\standard-ease\standard.exe

BUTTON MY_CALC
LABEL Windows Calculator
RIBBON_STYLE ALWAYS_LARGE_IMAGE
BITMAP calculator.bmp
ACTION U:\nx9\default\site\tools\calc.exe

BUTTON MY_CONVERT
LABEL Conversion program
RIBBON_STYLE ALWAYS_LARGE_IMAGE
BITMAP convert.bmp
ACTION U:\nx9\default\site\tools\convert.exe

END_DROPDOWN

I am thinking that there needs to be some type of line that defines the button type, which should be set to system command.

I do get the commands to populated in the tab as expected, just not able to run the action for the icons.

Do anyone see what is not correct or know of a better way to create these 3 system command icons that I can tie in with the TBR and push across all engineers?

13 REPLIES

Re: Need help with Ribbon running executable programs

Phenom

Define the button in the .men file

BUTTON MY_CALC
LABEL Windows Calculator
ACTIONS "U:\nx9\default\site\tools\calc.exe"

Then reference it in your .tbr file

BUTTON MY_CALC
LABEL Windows Calculator
RIBBON_STYLE ALWAYS_LARGE_IMAGE
BITMAP calculator.bmp

Note the keyword ACTIONS (with an S) in the men file and the command surrounded by quotes.

Re: Need help with Ribbon running executable programs

Creator

Cowski,  Does it matter what men file that these buttons would be added to or should I create a new men for these three items only?  Also if i create a new file, what calls the men so that it is reconnized by NX when it loads.  as you can tell I am pretty new to the programing side of the program

Re: Need help with Ribbon running executable programs

Siemens Phenom

As long as you put the changes in a .men file that is in a valid "startup" folder, you can either make one for these three or add the changes to another one.

It is the presence of the .men vile in a "startup" folder that causes NX to try to load it during the initialization process.

Re: Need help with Ribbon running executable programs

Phenom

I would suggest creating a new .men file for your customizations as opposed to editing one of the default .men files. This will make it a bit easier to maintain your customizations.

If you copy & paste the text below into a text file with a .men extension, it should create an entry in your NX menu. There are commands to tell NX where you want the menu entry, but this simple example just tacks it on as the last entry.

!*=======================================================================
!
!
!=========================================================================
!
!=========================================================================
VERSION 120

BUTTON MY_CALCULATOR
LABEL Calculator
ACTIONS "U:\nx9\default\site\tools\calc.exe &"

END_OF_MENU

Change the menu and button names as you see fit. I only added the calculator button as an example, you will need to add the others to this file.

Re: Need help with Ribbon running executable programs

Siemens Phenom

It occurred to me that if you have never done this before, perhaps I should explain what I meant by a valid "startup" folder.

The simple way to define the correct "application" or "startup" directory is to
check and see if you have an environment variable called UGII_USER_DIR pointing
to some directory.

If you do, then create a directory called "application" in that directory, and
create one called "startup" in the same directory.

If you do not have UGII_USER_DIR defined, you can set it in the Windows Control
Panel, under System -> Advanced -> Environment Variables.

For example, you might have UGII_USER_DIR pointing to "D:\user_dir\".  Then you
would create a directory called "D:\user_dir\application" and put the .dlg or .dlx file in that directory.

You can also create a "startup" folder under "D:\user_dir\", for .DLLs that you want to run when NX starts, or for custom Menuscript files (*.men).

If you aren't sure about that environment variable, select Help->NX Log File from
the main menu, and then search for UGII_USER_DIR - it may be a case sensitive search.

That's the simple method.  There is a more complicated method described below.

/*--------------------------------------------------------------------------*/

Here is the other method, which adds one more layer of complexity, but also allows some additional flexibility.

You can create a simple text file with a list of directories in which you want NX
to look for "application" and "startup" directories.  This text file could contain only one directory, or as many directories as anybody would reasonably need.

The file just needs to have each directory on a separate line.

So the file could look like this:

D:\user_dir

Or it could look like this:

D:\user_dir
D:\designers
D:\checkers
D:\path\to\some\directory
M:\my\network\drive

(and so on)

And NX would look for "application" and "startup" directories UNDER each of the listed directories, in the order that they appear in the file.

You can call this file anything you want, but in our docs we usually call it
"custom_dirs.dat", so that it is easy to recognize.

Once you have the file created, you have to point at it with a particular environment variable called UGII_CUSTOM_DIRECTORY_FILE.  Be sure that the definition includes the complete path and file name, not just the name.  For example, UGII_CUSTOM_DIRECTORY_FILE could be set to "D:\my_data\custom_dirs.dat".

(You may see a similar variable called "UGII_UG_CUSTOM_DIRECTORY_FILE" - don't get them mixed up, and don't redefine the longer one.)

Re: Need help with Ribbon running executable programs

Phenom

In addition to what Steve wrote, you can use the UGII_GROUP_DIR and/or the UGII_SITE_DIR locations to push your customizations out to the entire group or site. I would suggest testing them out on your local folder first to get the bugs worked out before pushing it to everyone.

Re: Need help with Ribbon running executable programs

Creator

Thanks guys,  I have had to jump on some other hot fires at this time.  I will hopefully get back on the project this afternoon and will post an update on how it goes.

I like the idea of creating a new men file so that it is easier to keep track of.  I will look to see how the individual before me has everything set up with the start directories.  Right now I have put the custom files in the standard menu directories which I know are being pulled from.

Re: Need help with Ribbon running executable programs

Creator

Steve,

I have done what you recommended with double checking our custom dat file and it has the variable for the user directory.  Line item is below.

I have also created the application dir and put inside of it the startup directory with the .mem file in the start up folder.

Here is the Mem file that i am trying to get to load.

!****************************************************************
!
! Crown Tools for EXE programs
!
!
!****************************************************************
VERSION 120

LABEL &CrownTools

BUTTON Y145
LABEL ANSE Y14.5 Online
ACTIONS "u:\standard-ease\standard.exe &"

BUTTON MY_CALC
LABEL Windows Calculator
ACTIONS "u:\nx9\default\site\tools\calc.exe &"

BUTTON MY_CONVERT
LABEL Conversion Program
ACTIONS "U:\nx9\default\site\tools\convert.exe &"

When I lauch NX, it does not seem to be reading this file.  What do I have that is not correct as I really need to get these external program to start working.

Here is the directory layout that I have in place.

kking

application

STARTUP

Crown_tools.mem

Re: Need help with Ribbon running executable programs

Esteemed Contributor

.MEN or .MEM?

it should be .MEN (as in "MENuscript")

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled