vb.net- adding ribbon panel to existing tab

vb.net- adding ribbon panel to existing tab

Eyal.Admon
Contributor Contributor
896 Views
2 Replies
Message 1 of 3

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
Accepted solutions (1)
897 Views
2 Replies
Replies (2)
Message 2 of 3

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 & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 3 of 3

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