Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Eng-Tips
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

sumBuddy (Mechanical)
6 Oct 11 9:39
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."

MarckyMON (Computer)
13 Oct 11 8:50
Can you attach your toolbar so I can take a look at it?

Marc
NX Software Developer
 

sumBuddy (Mechanical)
13 Oct 11 9:00
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."

MarckyMON (Computer)
13 Oct 11 9:39
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
 

sumBuddy (Mechanical)
13 Oct 11 9:52
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."

MarckyMON (Computer)
13 Oct 11 9:58
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
 

MarckyMON (Computer)
13 Oct 11 10:03

Quote (GTAC):


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
 

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!

Back To Forum

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close