- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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 Drawing
In Drawing
In Part
In Assembly
Autodesk Inventor Professional Certified 2014