Create Menu With x++

Hi,How can I create

Invent → Setup → Invent Parameters Sub Menu with x++ ???

Thanks For Help

try this…

treeNode = TreeNode::findNode(’\Menus\Invent\setup’);

treeNode.AOTaddSubNode(3);

thanks your help

I create menuıtem with x++,and now,I create ınvent-setup menu ,I must to add my MenuItem below it

I use treeNode.AOTaddSubNode function is 'n it?

My friend send me that code and it help me ,I want to share it for other beginner =)

static void createMenuItems(Args _args)
{
#AOT
TreeNode treeMenuItem;
TreeNode treeDisplayMenu;
TreeNode treeMenus;
Menu treeMenu, treeMenu1, treeMenu2;
str MenuName = “MyInventParameters”;
MenuFunction menuFunction;
;
treeMenuItem = TreeNode::findNode(#MenuItemsDisplayPath);
treeDisplayMenu = TreeNode::findNode(#MenuItemsDisplayPath + “\” + MenuName);
treeMenus = TreeNode::findNode(#MenusPath);
if(!treeDisplayMenu)
{
treeMenuItem.AOTadd(MenuName);
treeDisplayMenu = treeMenuItem.AOTfindChild(MenuName);
treeDisplayMenu.AOTsetProperties(“PROPERTIES\n Object #” + “InventParameters” + “\n Label #” + “My Invent Parameters” + “\n ENDPROPERTIES\n”);
treeDisplayMenu.AOTsave();
treeMenu = treeMenus.AOTfindChild(“Invent”);
treeMenu1 = treeMenu.AOTfindChild(“Setup”);
treeMenu2 = treeMenu1.AOTfindChild(“Parameters”);

menuFunction = new MenuFunction(MenuName, MenuItemType::Display);

treeMenu1.addMenuitem(menuFunction);

treeMenu1.AOTsave();
treeMenu.AOTsave();
print “New Menuitem is added under Invent menu”;
pause;
}
}