Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using NXOpen .exe's in a .tbr File for NX6 1

Status
Not open for further replies.

sumBuddy

Mechanical
Jun 3, 2011
31
Hello everyone -

I am having difficulty creating a custom toolbar for NX6.0.4.3. I have a couple of executables created with NXOpen .NET and I have them signed and ready. When I create a custom user command in NX, I can choose the type of action that the button will perform, and I can successfully run the .exe action.

When I create a custom toolbar file (.tbr), and have the ACTION point to the file, I get the following error:

Error: Unknown action type.

Does anyone now how to define an action type in a .tbr file, or solve this problem.

Thanks in advance,


sumBuddy (Mechanical)

--------------------------------------------------------------------------------
"I would like to change the world, but I can't find the source code."
 
Replies continue below

Recommended for you

Can you attach your toolbar so I can take a look at it?

Marc
NX Software Developer
 
Here it is:

! Drafting Toolbar

TITLE Custom Drafting Toolbar

VERSION 170

BUTTON UPLOAD
LABEL UPLOAD TO DOC LIBRARY
BITMAP U:\NX6_UGCustom\bitmaps\upload.bmp
ACTION ${UGII_BASE_DIR}\ugii\managed\PRINT2DMS.exe

SEPARATOR

BUTTON TITLE_BLOCK
LABEL TITLE BLOCK
BITMAP U:\NX6_UGCustom\bitmaps\TB.bmp
ACTION ${UGII_BASE_DIR}\ugii\managed\titleBlock.dll

SEPARATOR

BUTTON REV_BLOCK
LABEL REV BLOCK
BITMAP U:\NX6_UGCustom\bitmaps\REV.bmp
ACTION ${UGII_BASE_DIR}\ugii\managed\RevisionCreator.exe


The two .exe's give the error, and the .dll works fine.

sumBuddy (Mechanical)

--------------------------------------------------------------------------------
"I would like to change the world, but I can't find the source code."
 
I think the keyowrd ACTION is only valid for DLLs. I am not sure, but I think you need the keyword EXECUTE to launch EXEs.

Marc
NX Software Developer
 
Nice Try Marc. I have tried to investigate this problem more, and found that the only keywords that work in a .tbr file is:

HIDE
ACTION
ON
OFF
BUTTON
SEPARATOR
EDIT
COMBOBOX
BEGIN_DROPDOWN
END_DROPDOWN
OPTIONMENU

The EXECUTE command you suggest is invalid.

Thanks

sumBuddy (Mechanical)

--------------------------------------------------------------------------------
"I would like to change the world, but I can't find the source code."
 
Have you also tried isolating only one button, e.g.

BUTTON REV_BLOCK
LABEL REV BLOCK
BITMAP U:\NX6_UGCustom\bitmaps\REV.bmp
ACTION ${UGII_BASE_DIR}\ugii\managed\RevisionCreator.exe

to ensure that there isn't some kind of syntax error?

Marc
NX Software Developer
 
GTAC said:
PRODUCT: NX
SUBJECT: How to run s System Command from a .tbr or .utd file

SUBMITTED BY: AMY WEBSTER SUBMITTED DATE: 10/07/2011
IR #: 6599226 DOCUMENT ID: 001-6599226
PLATFORM: INTEL OPERATING SYSTEM: WINDOW
OS VERSION: XP32_SP3 PRODUCT VERSION: V4.0.4

===============================================================================

HARDWARE/SOFTWARE CONFIGURATION
-------------------------------
Platform : INTEL
Family : NX

SYMPTOM/PROBLEM
---------------
Toolbar (.tbr) and User Tool (.utd) files do not support creating new buttons
to run operating system command such as .bat or .exe files.


SOLUTION/WORKAROUND
-------------------
In order to have a button on a toolbar or user tool palette run an operating
system command, the button must be defined using an add-on menuscript (.men)
file. Once the button has been defined using menuscript, it can be added to a
toolbar or user tool simply by using the name of the menuscript defined button.
For example, the menufile (.men) to define the button might look like this:

VERSION 120

EDIT UG_GATEWAY_MAIN_MENUBAR

AFTER UG_HELP_SYSTEM_LOG
BUTTON/TOOLBAR_ONLY GTAC_START_VS
LABEL Start Visual Studio
BITMAP msvs
ACTIONS "start devenv"
END_OF_AFTER

- Use the AFTER command to place the new button somewhere on the NX menus.
This prevents NX from creating a new main menu option "Orphans" to place it
under.

- The /TOOLBAR_ONLY modifier prevents the button from being displayed
on the menu. Leave this off if you do want the button to be on the menus as
well as the toolbar and/or user tool palette.

- The system command following the ACTIONS keyword can be any command that
works as desired when used from an NX Command Prompt window. It must be in
double quotes in order for NX to understand that it is a system command.

This button can now be added to a Toolbar (.tbr) using its name only, for
example:

TITLE GTAC Toolbar

VERSION 170

BUTTON GTAC_START_VS

It can also optionally be used from a User Tool (.utd) using the TYPE of
MENU_BUTTON, for example:

TITLE GTAC User Tools

VERSION 2

OPTION DISMISS OFF

BUTTONS

LABEL GTAC Tools

COLUMNS 1

NAME Start Visual Studio
TYPE MENU_BUTTON
ACTION GTAC_START_VS

- Here what follows ACTION is the name of the BUTTON as defined in the
menuscript file.

These files (.men, .tbr and/or .utd) should be placed in any "startup" folder
under any folder listed in the text file pointed to by the environment
variable UGII_CUSTOM_DIRECTORY_FILE (typically
UGII_ROOT_DIR\menus\custom_dirs.dat)

After starting NX, use <RMB>Customize from the Toolbar area to turn on the
custom Toolbar or make a new button to start the User Tool.

REFERENCES/NOTES
----------------

===============================================================================

COPYRIGHT (C) by Siemens Product Lifecycle Management Software Inc.
ALL RIGHTS RESERVED. No distribution except provided under contract

Marc
NX Software Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top