ilogic- move a button from its tab to the panel below it (expanded panel)

ilogic- move a button from its tab to the panel below it (expanded panel)

nagihan.bostan
Enthusiast Enthusiast
360 Views
2 Replies
Message 1 of 3

ilogic- move a button from its tab to the panel below it (expanded panel)

nagihan.bostan
Enthusiast
Enthusiast

I want to move the button that created to the expanded panel. For example, how do I move the "Draw Slot" button to the expanded panel? Thanks in advance.

 

ExapandedPanel.png

nagihanbostan_0-1677766686736.png

 

 

 

 
				if (firstTime == true)
				{
					//access user interface manager
					UserInterfaceManager userInterfaceManager;
                    userInterfaceManager = m_inventorApplication.UserInterfaceManager;

                    InterfaceStyleEnum interfaceStyle;
                    interfaceStyle = userInterfaceManager.InterfaceStyle;

                    //create the UI for classic interface
                    if (interfaceStyle == InterfaceStyleEnum.kClassicInterface)
                    {
                        //create toolbar
                        CommandBar slotCommandBar;
                        slotCommandBar = userInterfaceManager.CommandBars.Add("Slot", "Autodesk:SimpleAddIn:SlotToolbar", CommandBarTypeEnum.kRegularCommandBar, addInCLSIDString);

                        //add comboboxes to toolbar
                        slotCommandBar.Controls.AddComboBox(m_slotWidthComboBoxDefinition, 0);
                        slotCommandBar.Controls.AddComboBox(m_slotHeightComboBoxDefinition, 0);

                        //add buttons to toolbar
                        slotCommandBar.Controls.AddButton(m_addSlotOptionButton.ButtonDefinition, 0);
                        slotCommandBar.Controls.AddButton(m_drawSlotButton.ButtonDefinition, 0);
                        slotCommandBar.Controls.AddButton(m_toggleSlotStateButton.ButtonDefinition, 0);

                        //Get the 2d sketch environment base object
                        Inventor.Environment partSketchEnvironment;
                        partSketchEnvironment = userInterfaceManager.Environments["PMxPartSketchEnvironment"];

                        //make this command bar accessible in the panel menu for the 2d sketch environment.
                        partSketchEnvironment.PanelBar.CommandBarList.Add(slotCommandBar);
                    }
                    //create the UI for ribbon interface
                    else
                    {
                        //get the ribbon associated with part document
                        Inventor.Ribbons ribbons;
                        ribbons = userInterfaceManager.Ribbons;

                        Inventor.Ribbon partRibbon;
                        partRibbon = ribbons["Part"];

                        //get the tabls associated with part ribbon
                        RibbonTabs ribbonTabs;
                        ribbonTabs = partRibbon.RibbonTabs;

                        RibbonTab partSketchRibbonTab;
                        partSketchRibbonTab = ribbonTabs["id_TabSketch"];

                        //create a new panel with the tab
                        RibbonPanels ribbonPanels;
                        ribbonPanels = partSketchRibbonTab.RibbonPanels;

                        m_partSketchSlotRibbonPanel = ribbonPanels.Add("Slot", "Autodesk:SimpleAddIn:SlotRibbonPanel", "{DB59D9A7-EE4C-434A-BB5A-F93E8866E872}", "",  false);

                        //add controls to the slot panel
                        CommandControls partSketchSlotRibbonPanelCtrls;
                        partSketchSlotRibbonPanelCtrls = m_partSketchSlotRibbonPanel.CommandControls;

                        //add the combo boxes to the ribbon panel  
                        CommandControl slotWidthCmdCboBoxCmdCtrl;
                        slotWidthCmdCboBoxCmdCtrl = partSketchSlotRibbonPanelCtrls.AddComboBox(m_slotWidthComboBoxDefinition, "", false);

                        CommandControl slotHeightCmdCboBoxCmdCtrl;
                        slotHeightCmdCboBoxCmdCtrl = partSketchSlotRibbonPanelCtrls.AddComboBox(m_slotHeightComboBoxDefinition, "", false);

                        //add the buttons to the ribbon panel
                        CommandControl drawSlotCmdBtnCmdCtrl;
                        drawSlotCmdBtnCmdCtrl = partSketchSlotRibbonPanelCtrls.AddButton(m_drawSlotButton.ButtonDefinition, false, true, "", false);


                        CommandControl slotOptionCmdBtnCmdCtrl;
                        slotOptionCmdBtnCmdCtrl = partSketchSlotRibbonPanelCtrls.AddButton(m_addSlotOptionButton.ButtonDefinition, false, true, "", false);

                        CommandControl toggleSlotStateCmdBtnCmdCtrl;
                        toggleSlotStateCmdBtnCmdCtrl = partSketchSlotRibbonPanelCtrls.AddButton(m_toggleSlotStateButton.ButtonDefinition, false,true, "", false);
                    }
				}

 

 

0 Likes
Accepted solutions (1)
361 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

The Panel object has a property SlideoutControls. You need that and add your ComboBox to it. something like this:

 

//get the ribbon associated with part document
Inventor.Ribbons ribbons;
ribbons = userInterfaceManager.Ribbons;

Inventor.Ribbon partRibbon;
partRibbon = ribbons["Part"];

//get the tabls associated with part ribbon
RibbonTabs ribbonTabs;
ribbonTabs = partRibbon.RibbonTabs;

RibbonTab partSketchRibbonTab;
partSketchRibbonTab = ribbonTabs["id_TabSketch"];

//create a new panel with the tab
RibbonPanels ribbonPanels;
ribbonPanels = partSketchRibbonTab.RibbonPanels;

var m_partSketchSlotRibbonPanel = ribbonPanels.Add("Slot", "Autodesk:SimpleAddIn:SlotRibbonPanel", "{DB59D9A7-EE4C-434A-BB5A-F93E8866E872}", "", false);

//add the combo boxes to the ribbon panel  
CommandControl slotWidthCmdCboBoxCmdCtrl;
slotWidthCmdCboBoxCmdCtrl = m_partSketchSlotRibbonPanel.SlideoutControls.AddComboBox(m_slotWidthComboBoxDefinition, "", false);

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 3

nagihan.bostan
Enthusiast
Enthusiast

Thanks for Help, thanks for Solution.

0 Likes