Reply

Add Macro button

Hi

I develop an installer for some application (application uses SE API)

So, i have the installer to be able to create new Group in the Ribbon Bar (in different environments) , and add Split Button with 2 button inside to this group.

 

In my case, the application is not Add-in.

Manually i just add a Macro button to the Ribbon bar.

I need the buttons to be in the Home tab. Not in Add-ins tab.

 

I tried to do so by connectiong to Application.Customization.. RibbonBarThemes.. select the active one, get the needed environment, the needed Ribbon and try to add the button.

Nothing happens.

 

The code i used:

SE_Application.Customization.BeginCustomization();
SolidEdgeFramework.RibbonBars Ribbon_Bars = SE_Application.Customization.RibbonBarThemes.Item("My Theme").RibbonBars;
SolidEdgeFramework.RibbonBar Assembly_Ribbon = null;
for (int a = 0; a < Ribbon_Bars.Count;a++ )
{
if (Ribbon_Bars.Item(a).Environment == "Assembly")
{
Assembly_Ribbon = Ribbon_Bars.Item(a);
break;
}
}
SolidEdgeFramework.RibbonBarTab Home_Tab = Assembly_Ribbon.RibbonBarTabs.Item("Home");
SolidEdgeFramework.RibbonBarGroup Auto_Flat_Group = Home_Tab.RibbonBarGroups.Insert("Auto Flat", null, SolidEdgeFramework.RibbonBarInsertMode.seRibbonBarInsertCreate);
Auto_Flat_Group.Name = "Auto Flat";
Auto_Flat_Group.Visible = true;
SolidEdgeFramework.RibbonBarControl Split_Button;

Split_Button = Auto_Flat_Group.RibbonBarControls.Insert("900000", null, SolidEdgeFramework.RibbonBarInsertMode.seRibbonBarInsertCreateSplitButtonPopup);
Split_Button.Size = SolidEdgeFramework.RibbonBarControlSize.seRibbonBarControlSizeLarge;
Split_Button.Visible = true;
Split_Button.Name = "Auto Flat - Assembly";
Split_Button.Text = SolidEdgeFramework.RibbonBarControlText.seRibbonBarControlTextDefault;

SE_Application.Customization.EndCustomization();

 

The Insert function have some help documentation, but i don't know wich objects have to be passed to this function in the 2 first arguments..

 

The second way i thought, is to change the Customization file (it's XML file contains some changes User can do in the User Interface and save it as Theme).

But this way is a little bit complicated.

 

The goal is to add few buttons of my application to the active user theme (it maybe different themes on different computers) to the Home tab.

 

Someone have an idea how can i do it?

I think this have to be possible to add some buttons not only to Add-ins tab.