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: 

How to add a Ribbon Tab on more Ribbons?

1 REPLY 1
Reply
Message 1 of 2
Frederik_Mussler
440 Views, 1 Reply

How to add a Ribbon Tab on more Ribbons?

            Dim icon_Main As IPictureDisp
            icon_Main = PictureDispConverter.ToIPictureDisp(My.Resources.Garant)

            Dim controlDefs As ControlDefinitions = m_inventorApplication.CommandManager.ControlDefinitions
            bt_main = controlDefs.AddButtonDefinition("Projektmanager", "int_projekt", CommandTypesEnum.kFilePropertyEditCmdType, app_guid, "beschreibung blabla", "tooltip", icon_Main, icon_Main, ButtonDisplayEnum.kAlwaysDisplayText)

            Dim uiManager As Inventor.UserInterfaceManager = m_inventorApplication.UserInterfaceManager

            Dim g_RibbonAssy, g_RibbonPart As Inventor.Ribbon
            Dim g_TabAssy As Inventor.RibbonTab
            Dim g_panel As Inventor.RibbonPanel

            g_RibbonAssy = uiManager.Ribbons.Item("Assembly")
            g_TabAssy = g_RibbonAssy.RibbonTabs.Add("TEST", "test_int", app_guid)
            g_panel = g_TabAssy.RibbonPanels.Add("test_panel", "test_pan_int", app_guid)
            g_panel.CommandControls.AddButton(bt_main)


            g_RibbonPart = uiManager.Ribbons.Item("Part")

 

 

 

When i start this code, a nice tab shows up when i open an assembly, good!

But Now i want to show the same tab with the same button in Part Ribbon.

How can i do that?

1 REPLY 1
Message 2 of 2

Hi,

 

You do exactly the same but using "Part" Ribbon instaed of "Assembly". It seems you where already on the right track...

 

If you want to display the same button in the Part, you can just reuse the same ButtonDefinition, so you don't need to recreate that.

 

Hope it helps.

 



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report