10-18-2021
01:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-18-2021
01:20 PM
Something like this?
public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime)
{
var cmdMgr = m_inventorApplication.CommandManager;
Icon BigIcon = new Icon("Icon1.ico");
Icon SmallIcon = new Icon("Icon1.ico");
ButtonDefinition buttonDef = cmdMgr.ControlDefinitions.AddButtonDefinition(
"Command 1",
"Command 1",
CommandTypesEnum.kFilePropertyEditCmdType,
Guid.NewGuid().ToString(),
"Command 1 description",
"Command 1 Tooltip",
BigIcon, SmallIcon);
buttonDef.OnExecute += ButtonDef_OnExecute;
Ribbon partRibbon = m_inventorApplication.UserInterfaceManager.Ribbons["Part"];
RibbonTab toolsTab = partRibbon.RibbonTabs["id_TabTools"];
RibbonPanel customPanel = toolsTab.RibbonPanels.Add("Sample", "MysSample", Guid.NewGuid().ToString());
customPanel.CommandControls.AddButton(buttonDef);
}
private void ButtonDef_OnExecute(NameValueMap Context)
{
m_inventorApplication.CommandManager.ControlDefinitions["AppZoomallCmd"].Execute();
}somethin
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.
Blog: hjalte.nl - github.com