Code:
' This property is provided to allow the AddIn to expose an API of its own to other
' programs. Typically, this would be done by implementing the AddIn's API
' interface in a class and returning that class object through this property.
' Typically it's not used, like in this case, and returns Nothing.
Public ReadOnly Property Automation() As Object Implements Inventor.ApplicationAddInServer.Automation
Get
Return Nothing
End Get
End Property ' Note:this method is now obsolete, you should use the
' ControlDefinition functionality for implementing commands.
Public Sub ExecuteCommand(ByVal commandID As Integer) Implements Inventor.ApplicationAddInServer.ExecuteCommand
' Not used.
End Sub
#End Region
#Region "User interface definition"
' Adds whatever is needed by this add-in to the user-interface. This is
' called when the add-in loaded and also if the user interface is reset.
Private Sub AddToUserInterface()
' This sample code illustrates creating a button on a new panel of the Tools tab of
' the Part ribbon. You'll need to change this to create the UI that your add-in needs.
' Toolbox als RibbonTabs deklarieren
Dim Tab_TB_Drw As RibbonTab
Dim Tab_TB_ZroDoc As RibbonTab
' Get the drawing ribbon.
Dim drwRibbon As Ribbon = g_inventorApplication.UserInterfaceManager.Ribbons.Item("Drawing")
' Get the ZeroDoc ribbon.
Dim ZeroDocRibbon As Ribbon = g_inventorApplication.UserInterfaceManager.Ribbons.Item("ZeroDoc")
'Create New RibbonTab in DrawingRibbon
Tab_TB_Drw = drwRibbon.RibbonTabs.Add(" Toolbox", "_TB", g_addInClientID) '"PROCAD:Profile:RibbonTab", False, False)
'Create New RibbonTab in ZeroDocRibbon
Tab_TB_ZroDoc = ZeroDocRibbon.RibbonTabs.Add(" Toolbox", "_TB", g_addInClientID) '"PROCAD:Profile:RibbonTab", False, False)
' Get the "Tools" tab.
'Dim toolsTab As RibbonTab = drwRibbon.RibbonTabs.Item("id_TabTools")
' Check to see if the panel already exists and create it if it doesn't.
Dim DrwToolsAnsicht_01 As RibbonPanel = Nothing
Dim DrwToolsBOM_01 As RibbonPanel = Nothing
Dim DrwToolsDIM_01 As RibbonPanel = Nothing
Dim ZeroDocTools_01 As RibbonPanel = Nothing
Try
DrwToolsAnsicht_01 = Tab_TB_Drw.RibbonPanels.Item("DrwToolsAnsicht_01")
Catch ex1 As Exception
End Try
Try
DrwToolsBOM_01 = Tab_TB_Drw.RibbonPanels.Item("DrwToolsBOM_01")
Catch ex2 As Exception
End Try
Try
DrwToolsDIM_01 = Tab_TB_Drw.RibbonPanels.Item("DrwToolsDIM_01")
Catch ex3 As Exception
End Try
Try
ZeroDocTools_01 = Tab_TB_ZroDoc.RibbonPanels.Item("ZeroDocTools_01")
Catch ex4 As Exception
End Try
#Region "Create a new panels"
'********************************
'* Create a new panels
'********************************
'in DrawingTools
If DrwToolsAnsicht_01 Is Nothing Then
DrwToolsAnsicht_01 = Tab_TB_Drw.RibbonPanels.Add("Ansichten", "DrwToolsAnsicht_01", g_addInClientID)
End If
If DrwToolsBOM_01 Is Nothing Then
DrwToolsBOM_01 = Tab_TB_Drw.RibbonPanels.Add("Stuecklisten", "DrwToolsBOM_01", g_addInClientID) ', "DrwToolsAnsicht_01", False)
End If
If DrwToolsDIM_01 Is Nothing Then
DrwToolsDIM_01 = Tab_TB_Drw.RibbonPanels.Add("Maße", "DrwToolsDIM_01", g_addInClientID)
End If
'in ZeroDocTools
If ZeroDocTools_01 Is Nothing Then
ZeroDocTools_01 = Tab_TB_ZroDoc.RibbonPanels.Add("Verschiedene Tools", "ZeroDocTools_01", g_addInClientID)
End If
'********************************
#End Region
#Region "Add buttons to Drawíng Tools"
'********************************
'* Add buttons to Drawing Tools
'********************************
' Drawing Tools
If Not m_Iso_Ansicht_ausrichten_btn Is Nothing Then
DrwToolsAnsicht_01.CommandControls.AddButton(m_Iso_Ansicht_ausrichten_btn, True)
End If
If Not m_BOM_Ueber_Schriftfeld_positionieren_btn Is Nothing Then
DrwToolsBOM_01.CommandControls.AddButton(m_BOM_Ueber_Schriftfeld_positionieren_btn, True)
End If
If Not m_Klammermasz_umschalten_btn Is Nothing Then
DrwToolsDIM_01.CommandControls.AddButton(m_Klammermasz_umschalten_btn, True)
End If
'********************************
#End Region
End Sub