2 Replies Latest reply on Dec 30, 2013 9:31 AM by Massimiliano Marenghi

    Problem with AddContextMenu

    Massimiliano Marenghi



      I've create a CommandGroup by the method AddContextMenu, I set the property SelectType = (int)(swSelectType_e.swSelCOMPONENTS), everything works ok but i see the icons of my commands menu (by right click over the components ) only when I open a sldprt document, otherwise I dont's see the icons but only the command names.


      Any ideas ?



        • Re: Problem with AddContextMenu
          Chaz Carny



          How did you get the AddContextMenu command to work? Can you please show me a sample of your code? I am having trouble with this.


          contextcmdgroup = iCmdMgr.CreateCommandGroup2(87, "Context", "RMB MENU", "", -1, False, cmdGroupErr)


          ContextIndex1 = contextcmdgroup.AddCommandItem2("New Button", -1, "Hint", "New button", 2, "Test", "", 88, swCommandItemType_e.swToolbarItem)


          contextcmdgroup.AddSpacer2(-1, swCommandItemType_e.swToolbarItem)


          contextcmdgroup.SelectType = swSelectType_e.swSelCOMPONENTS


          contextcmdgroup = iCmdMgr.AddContextMenu(87, "Context Added")




          I dont have trouble adding it as a normal menu, but I can't get it to pop up while right clicking a component.