Solved! Go to solution

Customize ribbon bar



I have to do an installer for my application working on Solid Edge (ST6)

The application is not AddIn, and i would like it to regular exe application

Manually i can add the Macro button in any environment, but i can't do so by API.


The goal is to add two buttons to the existing user's theme, to Home tab (not to AddIns)


I have found RibbonCustom.xml contains the definition of user ribbon theme, but it`s complicated to find a correct place to insert my values inside for adding new group with 2 buttons on Home tab.


The second way is to do so by API.

Here is my code (C#):


SolidEdgeFramework.RibbonBars Ribbon_Bars = SE_Application.Customization.RibbonBarThemes.Item("Customer 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);
SolidEdgeFramework.RibbonBarTab Home_Tab = Assembly_Ribbon.RibbonBarTabs.Item("Home");
SolidEdgeFramework.RibbonBarGroup Ribbon_Group = Home_Tab.RibbonBarGroups.Insert("My Group", null, SolidEdgeFramework.RibbonBarInsertMode.seRibbonBarInsertCreate);
Ribbon_Group.Name = "My Group";
Ribbon_Group.Visible = true;

SolidEdgeFramework.RibbonBarControl Split_Button;

Split_Button = Ribbon_Group.RibbonBarControls.Insert("900000", null, SolidEdgeFramework.RibbonBarInsertMode.seRibbonBarInsertCreateSplitButtonPopup);
Split_Button.Size = SolidEdgeFramework.RibbonBarControlSize.seRibbonBarControlSizeLarge;
Split_Button.Visible = true;
Split_Button.Name = "My Macro Button";
Split_Button.Text = SolidEdgeFramework.RibbonBarControlText.seRibbonBarControlTextDefault;


This code runs with no exceptions, but does nothing.

In the help documentation there is nothing written about the way to use the functions.


There is some example to do it right way?



Yevgeny Leibman

Accepted by topic author AddEx
‎08-26-2015 04:32 AM

Re: Customize ribbon bar



I just created and committed a new sample in the Solid Edge Community Samples on GitHub. You can download the latest set of samples or just look at RibbonCustomization/MainForm.cs. The code should cover everything you were struggling with (hopefully).



Jason Newell
Applications Architect