Issue
We tested with the SDK sample \api\net\examples\Automation\MessageClientServer\MessageClientPlugin. It has one EventWatcherPlugin which delegates some events of the application. In theory, these events are scribed when NW launches. Thus they will work in whole sessions of Navisworks. The events are fired when Navisworks is launching. But after it launches, no matter how you open/add/new/close document, these events are not fired any more!
Solution
Navisworks is currently an SDI Document. A single Document is created at start-up and destroyed at shut-down. The ‘ActiveDocument’ stays the same throughout the lifetime of the program, including when you load/unload a file.
What you need to be watching is: Autodesk.Navisworks.Api.Application.ActiveDocument.Models.CollectionChanged
Snippet of the required code here is as below:
void ActiveDocument_Models_CollectionChanged(object sender,
System.EventArgs e)
{
MessageBox.Show("ActiveDocument_Models_CollectionChanged");
}
void Application_ActiveDocumentChanged(object sender,
System.EventArgs e)
{
MessageBox.Show("ActiveDocumentChanged");
Autodesk.Navisworks.Api.Application.ActiveDocument.Models.
CollectionChanged+= ActiveDocument_Models_CollectionChanged;
}