Hello guys,
I've created a Ad-In for Inventor 2012 which adds a Button to the "Tools"-Tab.
With:
<code>Dim ribbon As Inventor.Ribbon = uiMan.Ribbons("Part")</code>
I choose the ribbon-environment in which the button should appear.
But is there an easy way to show the button not only in ONE environment? The Ad-in (reading out custom iProperties) can be used with parts, drawings or assemblies.
So how can I show the button if a part OR an assembly OR a drawing is the actual document? It also would be okay to show it always, because my Ad-in checks what sort of doc is opened.
Thanks, Julian
Create seperate tab and panel on each ribbons (Zero doc, Part, Assembly and drawing) and add the same control to all your panels.
saseendrankombath is correct. Here is some code demo:
Private Sub AddRibbonUI() Dim ribNames() As String = _ {"Drawing", "Part", "Assembly", "Presentation"} For Each ribName In ribNames Dim oRibbon As Object = _ m_inventorApplication.UserInterfaceManager.Ribbons(ribName) Dim oTab As Object = oRibbon.RibbonTabs("id_TabTools") Dim oScreenShotPanel As Object Try oScreenShotPanel = _ oTab.RibbonPanels("InventorScreenshot:RibbonPanel") Catch ex As Exception oScreenShotPanel = _ oTab.RibbonPanels.Add( _ "Screenshot", "InventorScreenshot:RibbonPanel", m_ClientId) End Try oScreenShotPanel.CommandControls.AddButton(oSSButtonDef, True) Next End Sub