DGKC Control Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Licensing
Expand ModelsModels
Collapse DG Kernel ControlDG Kernel Control
Expand API ReferenceAPI Reference
Expand ViewsViews
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Support
Skip Navigation LinksHome Page > DG Kernel Control > Interactive Functionality > Selection Overview > Selection Event Go to ActiveX docs Search Documentation


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;
}

ItemType Interface to Query
BRepVertex IBRepVertex_DG
BRepEdge IBRepEdge_DG
BRepFace IBRepFace_DG
Entity IEntity_DG
MeshVertex IVertex_DG
MeshSegment IVertexSegment_DG
MeshSimplex ISimplex_DG

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.