Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Show Ad-In Ribbon-Tab+Button when Part OR Assembly opened

2 REPLIES 2
Reply
Message 1 of 3
j_schweigert
544 Views, 2 Replies

Show Ad-In Ribbon-Tab+Button when Part OR Assembly opened

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

2 REPLIES 2
Message 2 of 3

Create seperate tab and panel on each ribbons (Zero doc, Part, Assembly and drawing) and add the same control to all your panels.

Message 3 of 3

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

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report