Showing results for 
Search instead for 
Do you mean 
Reply

Toggle Button for a VB in Ribbon Menu

Hi,

 

I´m searching for the Keywords in RTB-File or a function in VB, to toggle the status of the bitmap in the ribbon like this example here:

show_grid_off_on.jpg

So with this button I can see, if the raster is ON (dark background) or OFF (light background).

How can I do this in my own ribbons. I have written some VB´s which toogle some preferences in drafting. So it is usful to see the status by the button.

 

I found something like that in an other discussion:

Private Sub _button1_Click(ByVal control As RibbonControl)
	_button1.Checked = Not _button1.Checked
End Sub

But I do not no if this does what I want. Where do I have to set the button bitmap-filename in this solution?

 

Michael

 

 

Michael Eichelberg, CAD-Consultant, Dr. Wallner Engineering Nord GmbH
Production: NX10.0.3 MP16, NX11.0.1 MP4
Development: Batch and VB Testing: NX12
2 REPLIES

Re: Toggle Button for a VB in Ribbon Menu

Hi Michael,

 

Yesterday I asked a similar question for the NX Open Python API and today I discovered the solution myself. Although it is Python and not VB it may help you too:

https://community.plm.automation.siemens.com/t5/NX-Programming-Customization/Change-state-of-ribbon-...

 

Best regards,

 

Matthias 

Re: Toggle Button for a VB in Ribbon Menu

Hi Michael,

 

I just noticed that in the NX Open C++ API and in the NX Open Python API there is the class

NXOpen.MenuBar.MenuButton and this class has a method ToggleStatus which does the job according to the documentation.

I know that you asked for VB and not for Python or C++ but I guess that this class and this method exists also in VB.

 

Best regards,

 

Matthias