Is there a way to add MenuItems in .Net similar to this Python code?
addMenuItem('VcConfigure3DContextMenu', title, -1, cmdName, r'Gallery\Tools\rMergeFaces')
I couldn’t find anything in the .Net API
Thank you in advance and best regards,
Manuel
Este
2
You could try something like this with the IUXConfiguration.
private void addActionItemToUI()
{
ICommandRegistry cmd = IoC.Get<ICommandRegistry>();
IUXConfiguration uxConfig = IoC.Get<IUXConfiguration>();
var uxSite = new UXSiteSetup
{
UXSiteIdPath = "VcTabHome/VcRibbonTools",
UXSiteType = UXSiteType.RibbonGroup
};
uxConfig.RegisterSite(uxSite);
IActionItem item = cmd.FindItem("MyCoolCommand");
var uxSiteSetup = new UXSiteSetup()
{
UXSiteIdPath = "VcTabHome/VcRibbonTools",
EntryId = item.Id
};
cmd.RegisterActionItem(item, uxSiteSetup);
}
TSy
3
How to create ActionItems is covered in this webinar.
Thank you for your responses!
That’s how I solved it at the end:
private void addActionItemToUI()
{
ICommandRegistry cmd = IoC.Get<ICommandRegistry>();
IActionItem item = new ActionItem("1", "Center Graph", "FindNext", () => CenterGraph());
var uxSiteSetup = new UXSiteSetup()
{
UXSiteIdPath = "VcConfigure3DContextMenu",
EntryId = item.Id
};
cmd.RegisterActionItem(item, uxSiteSetup,-1);
}
And here the result:
