DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Expand ModelsModels
Collapse DG Kernel ControlsDG Kernel Controls
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 Controls > Programmatic Functionality > Generator Go to DGKC docs Search Documentation


Object Generator

Object Generator is an object, which allow creation of other new objects. Object Generator is a sort of "new" operator similar to one of C#.

Using Object Generator

Object Generator implements IObjectGenerator_DG interface, which can be queried from IModel_DG, from IGlobalAPI_DG or from a standalone object as described in the Advanced section below.

IObjectGenerator_DG.Createethod can be used to create new instances of objects. See details for types of available objects.

Advanced

To create a standalone instance of the Object Generator construct and instance of public DgApi class from DGKC namespace. Its IObjectGenerator_DG can be obtained via call to IObjectGenerator_DG DgApi.GetGenerator() like:

         DgApi api = new DgApi();
        gen = api.GetGenerator();
        IModel_DG iModel = gen.Create();   // Use the generator

See Console.Init() in Console sample for a debuggable example.

See also Object Array sample.