Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

vb.net- adding ribbon panel to existing tab

Eyal.Admon
Contributor

vb.net- adding ribbon panel to existing tab

Eyal.Admon
Contributor
Contributor

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

0 Likes
Reply
Accepted solutions (1)
755 Views
2 Replies
Replies (2)

bradeneuropeArthur
Mentor
Mentor

Does this help?

https://forums.autodesk.com/t5/inventor-customization/adding-buttons-to-the-same-custom-ribbon-panel...

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

0 Likes

Eyal.Admon
Contributor
Contributor
Accepted solution

i figured it out.

i had a mistake in the line:

Dim drawingtoolstab As Inventor.RibbonTab = partRibbon.RibbonTabs.Item("id_TabTools")

the "partRibbon.RibbonTabs.Item("id_TabTools")" should have been :

drawingRibbon .RibbonTabs.Item("id_TabTools").

 

stupid mistake...

 

0 Likes