Hi folks,
How to await for the window gets displayed before the ActiveModelDocChangeNotify
triggers an action (method)?
When I change the displayed document (Ctrl + Tab) the graphics got frozen showing the current document. Only after action completition the other document will be displayed.
I got an working solution: call the time consuming method as an asynchronous task.
I’ve figured out the SolidWorks will get “frozen” if there is a lot of action to process. Only after tasks are finished then SolidWorks will refresh the displaying graphics.
ActiveModelDocChangeNotify
posts a notification to the user program when the active IModelDoc2
object has changed, according to the documentation.
It seems that this triggers before the UI controls are fully rendered, which is understandable.
Is this a significant issue for you? A potential solution would be to monitor the windows rather than the SW process, triggering your logic once the window of the active document becomes activated.
Take a look at the frame. There may be some events there.