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 > Initialisation Context
Initialisation Context

Initialisation Context of KernelCAD Components

KernelCAD controls can be created dynamically at runtime. The Initialisation Context facilitates the process of runtime control creation. It addresses the problem that controls are created using generic methods of a particular language or IDE. The method is not aware of properties of KernelCAD. KernelCAD creation process on the other hand can work quite differently depending on the environment and requested properties.

The Initialisation Context is a single global set of properties, slightly different from the normal properties of KernelCAD. This set of properties is not dependent on any particular instance of a control and is always accessible even if no control have been created yet.

The main property of the context is the Active property. It is false by default. If it was set to true any KernelCAD controls will use the context to during creation to determine the type of the control requisted and its initial properties.

Properties of Initialisation Context

Property Description Type Default
Active If true any control created at runtime will copy or use the properties below before its creation Boolean false
ModelPath Will be copied to ModelPath of the control String Empty
ShowGlobalAxes Will be copied to ShowGlobalAxes Boolean False
BackgroundColor Components of background color to be used in DIBackColor property Color rgba(0.8, 1.0, 0.8, 1.0)
RenderSolid Will be copied to RenderSolid Boolean True
TransparBackgrEnabled Will be copied to TransparBackgrEnabled Boolean False
Visible If false and supported by the IDE the control will be created invisible. It is recommended to set it to false to avoid flicker on start Boolean True
HandleComposited If true and the KernelCAD control is being created as child of a window, which (or any of its ancestors) has WS_EX_COMPOSITED extended window style on, the control will be created in Dual Mode. In the case, if this property is false, the control might not work properly Boolean True

Extended properties

There is a single ForceDual extended property. This property should be used as the last resort for cases of complex and unusual views, hosting a runtime created KernelCAD control, which do not provide full support for 3D rendering. After this property was set to true (false is the default) any controls will be created in Dual Mode regardless of runtime properties of the container.

To access the property call IControlInitialisationContext_KC.GetExtendedProperties() (See below) and use IKCContext.SetBoolParam(0, value) and IKCContext.GetBoolParam(0)

Using Initialisation Context

The context is accessed via IControlInitialisationContext_KC interface.

To obtain IControlInitialisationContext_KC interface obtain IGlobalAPI_KC and use IGlobalAPI_KC.LockInitialisationContext() method.

Call IControlInitialisationContext_KC.Activate(true) for context to be used during control instantiation

Release the context as soon as possible with IControlInitialisationContext_KC.ReleaseContext to make it available for other threads. It is recommended to call IControlInitialisationContext_KC.Activate(false) prior to that.