- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I can't figure out what I've got wrong here, I'm trying to create a handler for the OnDocumentChange Application event.
private Inventor.Application m_inventorApplication;
Inventor.ApplicationEvents appEvents = null;
public StandardAddInServer()
{
}
public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime)
{
// Initialize AddIn members.
m_inventorApplication = addInSiteObject.Application;
appEvents = m_inventorApplication.ApplicationEvents;
appEvents.OnDocumentChange += appEvents_OnDocumentChange;
appEvents.OnSaveDocument += appEvents_OnSaveDocument;
}
void appEvents_OnSaveDocument(_Document DocumentObject, EventTimingEnum BeforeOrAfter, NameValueMap Context, out HandlingCodeEnum HandlingCode)
{
MessageBox.Show("On Save");
HandlingCode = Inventor.HandlingCodeEnum.kEventNotHandled;
}
void appEvents_OnDocumentChange(Inventor._Document DocumentObject, Inventor.EventTimingEnum BeforeOrAfter, Inventor.CommandTypesEnum ReasonsForChange, Inventor.NameValueMap Context, out Inventor.HandlingCodeEnum HandlingCode)
{
MessageBox.Show("On Document Change");
HandlingCode = Inventor.HandlingCodeEnum.kEventNotHandled;
}
My OnSaveDocument handler works just fine but the OnDocumentChange will not fire. I've been using the even watcher and have been using other handlers but cannot seem to get this one to work. Any ideas would be
appreciated.
Thanks
Solved! Go to Solution.