- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Does this help?
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 !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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...