Message 1 of 1
Drag Event Behavior
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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;
}
}