DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Expand ModelsModels
Collapse DG Kernel ComponentsDG Kernel Components
Expand API ReferenceAPI Reference
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation LinksHome Page > DG Kernel Components > Interactive Functionality > Selection Overview > Selection Event Search Documentation


Selection Event

When WantSelectionEvent property of DG Kernel Context is true (false is the default) the application receives KernelCAD Event notification when the user makes multile selection in Direct User Access mode

The eventType parameter of the selection event is the EDIEvent.eEventSelection member of EDIEvent enumeration

The param0 parameter of the event is an integer which indicates kind of items selected. Possible values are enumerated in EElemTypeKC enumeration.

When selection is cleared by the end user the component raises KernelCAD Event, passing an empty list. The eventType parameter in the case is EDIEvent.eEventSelection and param0 is an integer with value EElemTypeKC.eElTypeUnknown.

Surface Element Selection

When the selection type is vertex, edge or face and there was a single entity of "BRep" or "Mesh" type under the selection rectangle, the param1 parameter of the event is a IList interface passed out as IUnkknown type. The parent entity can be accessed by quering IEntity_DG from the list. Use IEntity_DG.GetGeometryType() to identity the type.

Elements of the list have actual type:

Geometry type Vertex Edge Face
BRep IBRepVertex_DG IBRepEdge_DG IBRepFace_DG
Mesh IVertex IEdge_KC(64) ISimplex

C# example:

var p = iList.GetAt(pos); IBRepVertex_DG iVtx = Marshal.GetObjectForIUnknown(p) as IBRepVertex_DG;

See Selection sample for an example.

Multiple Object Selection

When the selection type is objects, the param1 parameter of the event is an IList interface passed out as IUnkknown type. Elements of the list have IEntity_DG type.

In .NET language use convertion similar to:

var p = iList.GetAt(pos); IEntity_DG iEntity = Marshal.GetObjectForIUnknown(p) as IEntity_DG;

to convert items of the list to IEntity_DG type

See Selection sample for an example.