What I've learn from various posts in this forum the Bentley.Interop.MicroStationDGN.dll is a wrapper around the COM Object for easier use in .NET environment. But how can I implement events for "OnDesignFileOpened" while using the wrapper. Using the COM object there are events for this.
With COM I used a delegate to clear all of my extracted element data (extracted from DGN) when the user opens a design file.
/Lars
In .NET you can use Addin's events - NewDesignFileEvent in your case.
Bentley.MicroStation.AddIn addin = ...; addin.NewDesignFileEvent += ...; addin.ModelChangedEvent += ...;
HTH
Answer Verified By: Lars Karlsson
Hi Lars,
I have no personal experience with this sitution, because I use C# if NET Framework is chosen platform for the application (and C# doesn't support WithEvent construction), but if you use VB.NET, the usage would be pretty the same as in MicroStation VBA.
So I guess you should try to combine example code from MicroStation VBA help file (Open, Close, and Idle Events Handler Example) and some example of VB.NET code (e.g. this one).
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
One more note: The solution mentioned by Dušan is better, it's based on standard events implemented in API.
Thank's
I will try to use the Addin's events