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 > Dynamic model restructuring
Dynamic model structure

Dynamically changing structure of a model

This topic describes how to modify hierarchy of objects in the model by deleting or adding new objects to the model.

Array of objects in the model and arrays of child objects of a parent object (section) can be manipulated programmatically with IArray interface. When IArray obtained from IModel interface it manages top level objects of the model. When IArray is obtained from an ISection interface it manages array of child objects of the object, which implements the ISection interface.

To delete an object call RemoveAt() method of the IArray. To add a new object the object has to be created using correspondent Object Generator. See Dynamic object creation topic for details. Output of the object creation procedure is a reference to ISection interface, which can be supplied to Add() or InsertAt() methods of IArray.

For example to add new top level 3DO object to the model:

  1. Obtain  I3DSectionGenerator (See Dynamic object creation).
  2. Create new 3DO object using Create method of I3DSectionGenerator. 
  3. Query IArray interface from IModel
  4. Call Add() method of IArray, supplying the interface obtained in the step 2.

To add a new child object to an existing section in step 3 query IArray form the correspondent ISection instead of IModel.

See also Object Array programming sample.