Imports System.Runtime.InteropServices
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim objApp As SolidEdgeFramework.Application = Nothing
Dim objRBTabs As SolidEdgeFramework.RibbonBarTabs = Nothing
Dim objRBTab As SolidEdgeFramework.RibbonBarTab = Nothing
Dim objCust As SolidEdgeFramework.Customization = Nothing
Dim objThemes As SolidEdgeFramework.RibbonBarThemes = Nothing
Dim objTheme As SolidEdgeFramework.RibbonBarTheme = Nothing
Dim objGroups As SolidEdgeFramework.RibbonBarGroups = Nothing
Dim objGroup As SolidEdgeFramework.RibbonBarGroup = Nothing
Try
objApp = Marshal.GetActiveObject("SolidEdge.Application")
objCust = objApp.Customization
objCust.BeginCustomization()
objThemes = objCust.RibbonBarThemes
'User may change the name of the theme ("New Theme 1") in below stmt.
objRBTab = objThemes.Item("New Theme 1").RibbonBars.Item(0).RibbonBarTabs.Insert("CustomTab", -1, SolidEdgeFramework.RibbonBarInsertMode.seRibbonBarInsertCreate)
objGroups = objRBTab.RibbonBarGroups
objGroup = objGroups.Insert("CustomGroup1", -1, SolidEdgeFramework.RibbonBarInsertMode.seRibbonBarInsertCreate)
objThemes.Commit()
objCust.EndCustomization()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class