Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Disable button in menu and ribbon file

Status
Not open for further replies.

basenxuser

Mechanical
Sep 27, 2007
69
Dear all,

I have developed a custom ribbon toolbar and menu file. They are loading fine during launch of NX.
I want disable few buttons during launch of NX.

Kindly explain if you have ideas.

Thanks in advance,
basenxuser
 
Replies continue below

Recommended for you

Disabling buttons you can do by editing the Ribbon toolbars (RTB). Find in there the button you want to disable and place an Exclamation mark in front of the lines used for that button.
the same principle applies for the Menu files (.men)


In below example the first button has been disabled in the RTB

Code:
BEGIN_GROUP Usability Tools
LABEL Usability Tools

	[COLOR=#CC0000]![/color]BUTTON OPEN_R_DRAWING
	[COLOR=#CC0000]![/color]LABEL Open Related Drawing
	[COLOR=#CC0000]![/color]BITMAP rd.bmp
	[COLOR=#CC0000]![/color]ACTION $SITE_PREF_PATH\2D3DSwitch\OpenRelatedDrawing.dll

	BUTTON  SWITCH_TO_3D
	LABEL   Switch to Related Drawing 
	BITMAP	t3d.bmp
	ACTION $SITE_PREF_PATH\2D3DSwitch\3D2Dswitch.dll

And for the Menu file

Code:
!
!  NX main menu file
!
! 
!
VERSION 121

CREATE UG_GATEWAY_MAIN_MENUBAR
TITLE

TOP_MENU

  [COLOR=#CC0000]![/color]CASCADE_BUTTON UG_FILE
  [COLOR=#CC0000]![/color]LABEL &File

  CASCADE_BUTTON UG_EDIT
  LABEL &Edit


Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
Hello Ronald,

Thank you for the solution!

I am looking for something like this:

BUTTON SWITCH_TO_3D
LABEL Switch to Related Drawing
BITMAP t3d.bmp
ACTION $SITE_PREF_PATH\2D3DSwitch\3D2Dswitch.dll
SENSITIVITY OFF

I want to load the button but to control the sensitivity.
Can you help on this?

Thanks,
basenxuser
 
I am not aware of such a function in the toolbars, or even if it is possible to add it.

How to configure toolbars, ribbons and menu's you can find in attached document.


Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
 https://files.engineering.com/getfile.aspx?folder=34167b9a-0cdb-4ab1-ba2c-aa623b4e1fe4&file=RibbonToolbar__Customization.pdf
What would be the logic that would enable or disable the button ?
If application = Modeling , enable
If application = Drafting, disable ?


- This is example text for this thread , right ? :)
"
BUTTON SWITCH_TO_3D
LABEL Switch to Related Drawing
"

Regards
Tomas

 
Toost said:
What would be the logic that would enable or disable the button ?
If application = Modeling , enable
If application = Drafting, disable ?

For above question,

Wherever you have placed your custom toolbars / Ribbons you create a folder "application".
In this folder you can create for each application in NX a subfolder like below.

Toolbars_xw3kt1.png


For each application you create a toolbar showing only the buttons which apply to this application and you place them in the subfolders.
appli_ub5a9b.png


In your NX installation folder you can find such a folder structure already. You could also use this one.

NX11\UGII\menus\profiles



Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
Dear all,

Thanks for all the replies.

I found the solution (Courtesy: Siemens forum).
Please find below the explanation:
---------------------------------------
There are two ways to launch a program while NX is starting up, and they do this at different points in the initialization process.
Try taking your .DLL out of the startup folder - leave the .MEN and .rtb files there.
Now define an environment variable called USER_STARTUP to point to the full path and file name of your .DLL.
This will cause it to launch much later in the process, and NX might be ready at that point to allow you to manipulate your button.
-----------------------------------------
Solution:
I created a NXOpen DLL that finds the button using ID and controls the sensitivity. This DLL is pointed in the USER_STARTUP environment variable.

Thanks,
basenxuser
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor