Drag Event Behavior

Drag Event Behavior

manasi_patilESZTV
Contributor Contributor
163 Views
0 Replies
Message 1 of 1

Drag Event Behavior

manasi_patilESZTV
Contributor
Contributor

I am trying to handle a drag event to skip the method while a drag action is ongoing. However, I want Inventor to manage the default drag behavior. The goal is to track the drag state and skip the save operation during the drag, but my current implementation isn't working as expected.

In the code below, if I handle kEventHandled, the object does not move in the model space of Inventor. If I use kEventNotHandled, the code does not transition to any other drag state.

How can I improve my code to achieve the desired behavior?

 

 

 

private void UserInputEvents_OnDrag(DragStateEnum DragState, ShiftStateEnum ShiftKeys, Point ModelPosition, Point2d ViewPosition, Inventor.View View, NameValueMap AdditionalInfo, out HandlingCodeEnum HandlingCode)
 {
     HandlingCode = HandlingCodeEnum.kEventNotHandled;
     switch (DragState)
     {  
         case DragStateEnum.kDragStateDragHandlerSelection:
             idDragging = true;
             HandlingCode = HandlingCodeEnum.kEventHandled;
             break;
         case DragStateEnum.kDragStateOnDrag:
             idDragging = true;
            HandlingCode = HandlingCodeEnum.kEventNotHandled;
             break;
         case DragStateEnum.kDragStateEndDrag:
             idDragging = false;
           HandlingCode = HandlingCodeEnum.kEventHandled;
             break; 
     }
    
 }

 

 

 

 

0 Likes
164 Views
0 Replies
Replies (0)