KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Advanced functionality > Generator of 3D Sections
Sect3DGenerator class

Sect3DGenerator class

This topic describes how to create new 3DO objects in the model programmatically at runtime using Sect3DGenerator COM class. See also Object Array sample

Sect3DGenerator is an Object Generator, which allows creation of new Generic 3D Objectss. In COM terminology Sect3DGenerator  is a Class Factory. It can be instantiated in COM-enabled development environments by using either its Class ID or Program ID (see below). Note that KernelCAD control does not have to be created in the application before creation of the object. 

In .NET environment Sect3DGenerator can be created using standard new operator as (C# example):

       KernCADnet.Sect3DGeneratorClass sect = new KernCADnet.Sect3DGeneratorClass();

Actual name of the wrapper class might be different in different versions of the development environment. Refer to Object Browser in the project after adding a reference to the KernelCADnet component (See Patch Tutorial).

In C++ the Sect3DGenerator can be instantiated by using its Class ID and call to CoGetClassObject() COM function. See CObjArrayDlg::Create3DS() method of Object Array sample for details of implementation.

In native Visual Basic an instance of the class can be created using the Program ID and CreateObject() API as follows:

            Dim gener3D As Object

            gener3D = CreateObject("KERNELCAD.Section3D.1")

Sect3DGenerator implements a single interface I3DSectionGenerator, which can be obtained via call to CreateInstance() COM API in C/C++ or a cast in other languages.

Actual 3D Section objects can be created using Create() method of I3DSectionGenerator interface. The method returns ISection interface, which can be used in a call to Add() method of IArray interface to insert the new object in the model or make it a child section of another object.

Using Create method of IDIObjGenerator with eType parameter set to eObjType3DSGenerator provides another method of obtaining I3DSectionGenerator interface.

IDs of Sect3DGenerator 

Class ID:

// {44886EA6-F4FC-420a-A27B-BF095946D608}
static const GUID CLSID_Sect3DGenerator = 
{ 0x44886ea6, 0xf4fc, 0x420a, { 0xa2, 0x7b, 0xbf, 0x9, 0x59, 0x46, 0xd6, 0x8 } };

Program ID:  

KERNELCAD.Section3D.1

These definitions can also be found in Samples\VC\Inclide\DIInterface.h file of the installation directory.