VBA or C# to control Inventor tabs

VBA or C# to control Inventor tabs

Anonymous
Not applicable
367 Views
1 Reply
Message 1 of 2

VBA or C# to control Inventor tabs

Anonymous
Not applicable

Hi, I am using Inventor with Factory design utilities ( FDU) package.... I need to automate the layer assigning process to the individual .ipt files inside assembly file... Can anyone please provide some code in VB or C# "to change the layers for objects inside assembly "or t

way to control the " Factory Tab " in inventor

 

Thanks in Advance

Vinay

 

0 Likes
368 Views
1 Reply
Reply (1)
Message 2 of 2

richard.joseph.pollak
Advocate
Advocate

I'm not familiar with FDU, but I can give you some c# to access the tabs in the ribbon panel. Hopefully that gets you closer to your goal.

 

UserInterfaceManager userInterfaceManager = _inventorApplication.UserInterfaceManager;

Ribbons ribbons = userInterfaceManager.Ribbons;
Ribbon ribbon = ribbons["{ribbon internal name}"];

RibbonTabs ribbonTabs = ribbon.RibbonTabs;
RibbonTab ribbonTab = ribbonTabs["{ribbon tab internal name}"];

RibbonPanels ribbonPanels = ribbonTab.RibbonPanels
RibbonPanel ribbonPanel = ribbonPanels["{ribbon panel internal name}"]

You can check the internal names in the debugger to get to what you're looking for. My quick, lazy way of doing it is using a loop like

foreach (Ribbon ribbon in ribbons)
{
     System.Windows.Forms.MessageBox.Show(ribbon.InternalName);
}

The buttons in the ribbon panels are found in the CommandControls property. When they're grouped together, the command control will have a ChildControls property to access the command controls it contains.