The Inventor API has provided the Ribbon API for some time. We can use the Ribbon API to access to those existing Ribbon UI elements such as Ribbon Environments, Ribbon Tabs, Ribbon Panels, Ribbon Buttons, various Ribbon Controls, and so on.
In this post, let’s see how to create a new Ribbon Button into existing Ribbon Panel and Tab using the Inventor API and VB.NET. Here we go.
Public Sub CreateNewRibbonButton()
Dim uiMan As UserInterfaceManager = AddinGlobal.InventorApp.UserInterfaceManager
If uiMan.InterfaceStyle = InterfaceStyleEnum.kRibbonInterface Then
Dim tab As RibbonTab = GetSetRibbonTab("Presentation", "N/A", "id_TabTools")
Dim panel As RibbonPanel = GetSetRibbonPanel(tab, "N/A", "id_PanelPn_ToolsManage")
Dim icon As New Icon(Me.GetType(), "addin.ico")
Dim button1 As New InventorButton("Button 1", "INAW.InventorAddin.Presentation_Tools_Manage_Button1", "Button 1 description", "Button 1 tooltip", icon, icon, _
button1.Execute = Function() MessageBox.Show("Hello!")
Dim cmdCtrls As CommandControls = panel.CommandControls
cmdCtrls.AddButton(button1.ButtonDef, True, True, "", False)
The leading edge Inventor .NET Addin Wizard Professional (InventorNetAddinWizardPro) can help programmers promptly and reliably create addins for all popular Inventor versions and flavors either using C# or VB.NET from inside various editions and versions of Visual Studio IDEs. InventorNetAddinWizardPro can be found and downloaded from the A Wizard for Inventor .NET Addin page.