AnsweredAssumed Answered

AddMenuItem doesn't  show item

Question asked by Uy Ha on Oct 26, 2019
Latest reply on Oct 30, 2019 by Artem Taturevych

I'm trying to write an add-in for SOLIDWORKS and get familiar with the API. I started by adding a menu item

public bool ConnectToSW(object ThisSW, int Cookie)
{
   
this.ThisSW = ThisSW as ISldWorks;
   
this.Cookie = Cookie;
   
this.ThisSW.SetAddinCallbackInfo2(0, this, this.Cookie);
   
this.SwEventPtr = (SldWorks)this.ThisSW;

   
this.ThisSW.AddMenuItem5(
      (
int)swDocumentTypes_e.swDocPART, this.Cookie, "Item@&File", 0, null, null, "My Menu Item", null);

   
return true;
}

I've successfully registered the program containing the above snippet. 

List of Add-Ins registered

However, when I open the File menu, there is no Item item. What am I doing wrong? 

No Item in File

Outcomes