Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
dgreatice
in reply to: TA.Fehr

Hi,

 

basic to ADD ribbon as I know is, because I use VS this my example, and you can find this Code in Inventor Addin Template :

 

Imports Inventor
Imports System.Runtime.InteropServices

-------------------------------------------------------------------------------------------------

Namespace MyCustomAddin

<ProgIdAttribute("MyCustomAddIn.StandardAddInServer"),
GuidAttribute("36568e3e-5cb8-468a-95f3-cdc8a6658a7e")>

 

Public Class StandardAddInServer
Implements ApplicationAddInServer

 

Private m_IA As Inventor.Application

Private m_UIEvents As UserInterfaceEvents

Private m_clientID As String

 

Public Sub Activate(ByVal AddInSiteObject As ApplicationAddInSite, ByVal FirstTime As Boolean) Implements ApplicationAddInServer.Activate

 

Try

m_IA = AddInSiteObject.Application

m_UIEvents = m_IA.UserInterfaceManager.UserInterfaceEvents

 

 

Dim addInCLSID As GuidAttribute
addInCLSID = CType(System.Attribute.GetCustomAttribute(GetType(StandardAddInServer), GetType(GuidAttribute)), GuidAttribute)

 

m_clientID = "{" & addInCLSID.Value & "}"

 

       If FirstTime = True Then
               AddOrUpdateUserInterface()

       End If
Catch ex As Exception
        MessageBox.Show(ex.ToString)
End Try

 

Private Sub AddOrUpdateUserInterface()

Dim oUIM As UserInterfaceManager = m_IA.UserInterfaceManager

Dim oIFS As InterfaceStyleEnum = oUIM.InterfaceStyle

 

If oIFS = InterfaceStyleEnum.kRibbonInterface Then

     Dim oRibs As Ribbons = oUIM.Ribbons

     Dim oAssyRib As Ribbon = oRibs.Item("Assembly")

     Dim oAssyRibTabs As RibbonTabs = oAssyRib.RibbonTabs
     Dim oAssyRibTab As RibbonTab = oAssyRibTabs.Add("MyRibbon", "id_MyCustomRibbon", m_clientID, "id_TabVault", True)

     'Next Command Control

end sub

 

End Class

End Namespace

 

 

In DrawingIn Drawing

In DrawingIn DrawingIn PartIn PartIn AssemblyIn Assembly

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014