DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Collapse DG Kernel ControlsDG Kernel Controls
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse ViewsViews
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Go to DGKC docs Search Documentation


Two Dimensional Editor

At the time of writing this topic Two Dimensinal editor means only Overlay Editor, which may change in future releases.

2D Editors interact with end user to allow direct modification of a 2D Model

Access to a 2D editor is implemented via I2DEditor_DG. See Overlay topic about obtaining this interface.

Use I2DEditor_DG.EditableObject property to obtain IEntity_DG of the overlay. Query IModel_DG from IEntity_DG of the overlay to access its 2D geometry. Use methods of IModel_DG to modify structure of the 2D model and parametrs of its items and elements. More details.

Event Notifcations

To notify the application about different actions by the end user, 2D editors raise KernelCADEvent events with the eventType parameter set to eEvent2DEditor. The param0 parameter of KernelCADEvent is an integer with value one of EEditorEvent_KC:

ID Event Raised
eEditEventActivated The editor has been activated Always
eEditEventModelStructureChanged A new item aded to the 2D model or deleted If context boolean parameter 0 is true. See below
eEditEventItemStructureChanged Number of elements in an item has chanded. New element added or deleted If context boolean parameter 1 is true. See below
 eEditEventClosing The editor is about to be closed Always

For performance frequent events ModelStructureChanged and EventItemStructureChanged are not raised by default. They have to be requested with:

Use I2DEditor_DG.GetContext() or query IContext_DGt from I2DEditor_DG. Call IContext_DG.SetBool(0, true) to request ModelStructureChanged. Call IContext_DG.SetBool(1, true) to request ItemStructureChanged.