Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Eyal.Admon
754 Views, 2 Replies

vb.net- adding ribbon panel to existing tab

Hi Everyone,

I'm trying to add a costume panel to the tools tab in drawing document ribbon for my add-inand keep getting and error.

 

The line that throws the error is marked below with an arrow

note: I have used the same lines to add a panel to part and assembly document ribbons and it worked just fine.

 

Thanks

 

 

 

' Get the ribbon.

Dim drawingRibbon As Inventor.Ribbon = g_inventorApplication.UserInterfaceManager.Ribbons.Item("Drawing")


' Get the "Tools" tab.
Dim drawingtoolstab As Inventor.RibbonTab = partRibbon.RibbonTabs.Item("id_TabTools")

 

' Check to see if the "MySample" panel already exists and create it if it doesn't.
Dim customPanel_drawing As Inventor.RibbonPanel = Nothing

 

Try
customPanel_drawing = drawingRibbon.RibbonPanels.Item("MySample")

Catch ex As Exception
End Try

 

If customPanel_drawing Is Nothing Then
'Create a New panel.
customPanel_drawing = drawingtoolstab.RibbonPanels.Add("Sample", "MySample", g_addInClientID)  <-------

End If