AnsweredAssumed Answered

MouseSelectNotify - Eventhandler gets lost after rotation/movement/selections

Question asked by Dennis Moll on Oct 12, 2015
Latest reply on Oct 12, 2015 by Dennis Moll



I am developing an Add-In and I have to handle userselections by mouse. For this purpose I want to use the MouseSelectionNotify events of IMouse.


I've implemented it as follows:


First try:

object[] modelViews = ModelDocExtension.GetModelViews();

    for(int i = 0; i < ModelDocExtension.GetModelViewCount(); i++)
        ModelView view = (ModelView) modelViews[i];
        Mouse mouse = (Mouse)view.GetMouse();
        mouse.MouseSelectNotify += this.updateSelectedFacesMouse;


Second try:


       ModelView view = ActiveDoc.GetFirstModelView();
       Mouse mouse = (Mouse)view.GetMouse();

mouse.MouseSelectNotify += this.updateSelectedFacesMouse;


ActiveDoc is  PartDoc

Both tries work well for the first selections and the updateSelectedFacesMouse-method is called every time. After some time/after some selection or a rotation the method is not called anymore. I think there must be a kind of "recalculation" of the ModelViews? Is there any event for it to get the correct mouse-object afterwards?


Thanks in advance!