Selection Event
When WantSelectionEvent
property of DGKC Context is true (false
is the default) the application receives SelectionEvent notification
when the user makes multile selection in Direct User Access mode
The SelectionEventArgs parameter of the selection event contains information about the selected items.
The ItemType member of the parameter (type SelectionItemType_DG) indicates
kind of items selected. The Items member is the list of the lements stored as IUnk. For an example,
if the ItemType was BRepVertex use the code below or similar, to access the elements.
foreach(IUnk iUnk in e.Items)
{
IBRepVertex_DG iVtx = iUnk.As();
// Use iVtx;
}
When selection is cleared by the end user the component raises a SelectionEvent, passing an empty list.
If selection type is not SelectionItemType_DG.Entity there should be a single visible object under the selection rectangle, otherwise the event is not raised.
See Selection sample for an example.
|