Custom Panel and Button placement

Custom Panel and Button placement

mowag
Enthusiast Enthusiast
316 Views
2 Replies
Message 1 of 3

Custom Panel and Button placement

mowag
Enthusiast
Enthusiast

I'm trying to add a panel with one button in the Part environement under the Scetch tab and the same under the Assemble environment under the Assemble tab.

 

The panel and button in the Part environment is placed at the end in the ribbon, what's normal !

But the panel and bitton in the Assembly environment is placed at the beginning of the ribbon !!  Why ??

 

button1 = inventor.CommandManager.ControlDefinitions.AddButtonDefinition(
                    "Client Name", "InternalClient Name",
                    CommandTypesEnum.kSchemaChangeCmdType, GUID,
                    "DescriptionText", "Sets the ClientName in the\nCompany Property", largeicon1);
            button1.OnExecute += onClickButton1;



Ribbon partribbon = inventor.UserInterfaceManager.Ribbons["Part"];
RibbonTab toolsTab1 = partribbon.RibbonTabs["id_TabSketch"];
RibbonPanel newScetchPanel = toolsTab1.RibbonPanels.Add("Drawing Properties", "button1", GUID);
newScetchPanel.CommandControls.AddButton(button1);


Ribbon assemblyribbon = inventor.UserInterfaceManager.Ribbons["Assembly"];
RibbonTab toolsTab2 = assemblyribbon.RibbonTabs["id_TabAssemble"];
RibbonPanel newAssemblyPanel = toolsTab2.RibbonPanels.Add("Drawing Properties", "button2", GUID);
newAssemblyPanel.CommandControls.AddButton(button1);

 

This is in the Part environment : OK 

 

mowag_0-1647853737980.png

 

In the Assembly environment the panel is set at the beginning ????

 

mowag_1-1647853801948.png

 

 

 

0 Likes
317 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor

I can't tell you why Inventor chose this place. But according to help you could tell where it needs to go.

JelteDeJong_0-1647895305747.png

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 3

mowag
Enthusiast
Enthusiast

Hi Jelte,

 

Yes, i've used these optional parameters already with success in other addin's !

Now i wanted the same panel(with button) at the end of the ribbons.

Unfortunately one is placed at the start of the ribbon for no apparent reason.

Initally this panel was between two other panels with the use of those optional parameters.

Then i deleted those optional parameter in order to place teh panel with the button at the end of the ribbon, but for some reason it's placed at the beginning.

I'll know were it will end ......... start all over and rebuild the AddIn from scrath !

Thanks anyway for pointing me to the RibbonPanels.Add Merthod !!

 

Johan

 

 

0 Likes