AddMenuItem for .Net

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

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);
    }

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:

image

Hello,

I would like to add a ContextMenuItem, that has Subitems. Does anybody knows how to do that?

I tried with a MenuItemAction but I wasn’t successfull…

image

Thank you in advance!