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 Models > User Data > Model User Data
User Data

User Data

Objects in KernelCAD models can store a user-defined integer number and a user-defined variable length string. See details at Object User Data. The topic below describes how more complicated formatted data can be stored with the model.

Unformatted User Data Stream

KerrnelCAD models maintain a raw data buffer for usr-defined unformatted data. The data can be either binary or textual and can have any size.

Access to the stream is implemented via IBlob interface. To obtain the interface query IPropertyArray of the model via IModel > IPropertyArray and use IPropertyArray.GetProperty("RawUserData") to obtain an interface, which has actual type of (can be safely cast to) IBlob.

To embed a file into the model: Obtain IBlob as described above. Call IBlob.Load() to embed the file

To save the data to a file: Obtain IBlob as described above and call IBlob.Save()

To obtain or modify the data in memory obtain IBlob as described above and.use IBlob.Copy() or IBlob.CopyTo() methods which read or modify the data as an array of bytes.

To clear the data stream query IPropertyArray of the model via IModel > IPropertyArray and call IPropertyArray.SetProperty("RawUserData", NULL). In Visual Basic 6  use: iPropArray.SetProperty "RawUserData", Nothing.

See also: User Data Sample,

User Data Table

Independently of the above Unformatted User Data Stream, every KernelCAD model keeps a mini data base, which currently consist of a single data table. The data table can be used to store any application-specific  data relevant to the model or separate objects like model and object description and possibly some links or references to external data. The data table is stored into the .glm file with the rest of information about the model.

By default KernelCAD models do not have the table. It can be created with IDataSourceCreateTable and deleted with IDataSource.DropTable if not longer required to reduce the model size.

Currently records of the table can have double, long, unsigned integer or string type.

Record of the table can have arbitrary structure, which uses above types. The structure can be modified dynamically with the help of IDataTable interface.

IDataSource, which represents the data base itself, is the top-level interface in the user data hierarchy, from which all other interfaces can be queried. 

Object User Data value can be used to identify objects a records is related to.

Use

IDataSource - to create, delete or query existence of the data table.

IDataTable - to setup or modify structure of the table. To add or delete fields of different types.

IRecordSet - to add new or remove records.

IData - to query data from the table

IDataMods, - to modify data in existent records

See also: User Data Sample, Object User Data, IDataSource, IDataTable, IData,. IDataMods, IRecordSet