I created a project using the SwCSharpAddin template. I've overridden the events FileDropNotify, FileDropPreNotify and FileDropPostNotify in the AssembleEventHandler class.Why is only the FileDropNotify and FileDropPreNotify event responding and the FileDropPostNotify event not when I drag a part from explorer into assembly.
override public bool AttachEventHandlers()
{
doc.FileDropNotify += new DAssemblyDocEvents_FileDropNotifyEventHandler(OnFileDropNotify);
doc.FileDropPostNotify += new DAssemblyDocEvents_FileDropPostNotifyEventHandler(OnFileDropPostNotify);
doc.FileDropPreNotify += new DAssemblyDocEvents_FileDropPreNotifyEventHandler(OnFileDropPreNotify);
ConnectModelViews();
return true;
}
override public bool DetachEventHandlers()
{
doc.FileDropNotify -= new DAssemblyDocEvents_FileDropNotifyEventHandler(OnFileDropNotify);
doc.FileDropPostNotify -= new DAssemblyDocEvents_FileDropPostNotifyEventHandler(OnFileDropPostNotify);
doc.FileDropPreNotify -= new DAssemblyDocEvents_FileDropPreNotifyEventHandler(OnFileDropPreNotify);
DisconnectModelViews();
userAddin.DetachModelEventHandler(document);
return true;
}
//Event Handlers
int OnFileDropPreNotify(string file)
{
System.Windows.Forms.MessageBox.Show("FileDropPre");
return 0;
}
int OnFileDropNotify(string file)
{
System.Windows.Forms.MessageBox.Show("FileDrop");
return 0;
}
int OnFileDropPostNotify()
{
System.Windows.Forms.MessageBox.Show("FileDrop Post Notify");
return 0;
}
SolidworksApi/macros