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 > Interfaces > General > Collections Interfaces > IArray
IArray Interface

IArray Interface

GetCount
GetAt
InsertAt
RemoveAt
Add
Find
RemoveAll

IArray manages access to arrays of different types of objects present during the software execution. Type of object is determined by the way the IArray is obtained. For example IArray representing the array of object textures  is obtained with a call to GetProperty("TextureArray", (IUnknown**)&pIArray) method of IPropertyArray interface.

Some arrays like arrays of object property  are constant arrays, meaning that only GetCount() and GetAt() methods are available. All other methods will return DISP_E_PARAMNOTOPTIONAL error code.

Note that array of objects in the model and array of child objects are Pro level interfaces, and are not available in the standard KernelCAD or KernelCAD .NET.

Note: Obtaining IArray managing Axial Base knots of a 3DS object via ISection->IAxiBase->IArray is a context-dependent query. It means that between two steps ISection->IAxiBase and IAxiBase->IArray there must not be any other queries from the ISection interface.

See also Object Array Sample, Interface List


HRESULT GetCount(int * pnCount)

Parameters

pnCount- [out, retval] Pointer to an integer variable which will be set to number of valid members in the array

Returns

S_OK in case of success.

HRESULT GetAt(int index, IUnknown **ppIUnkn)

Parameters

index - [in] index of the object to retrieve.

ppIUnkn - [out, retval] pointer to a IUnknown* variable, which will be assigned an appropriate  interface pointer, implemented by index-th object in the array.

Return Values

S_OK in case of success.

DISP_E_BADINDEX - if the index is out of the range

DISP_E_PARAMNOTOPTIONAL - if the object is not available.

Remarks:
 
This method gives access to index-th object in the array. Most often actual type of the interface is different from IUnknown and can be cast to the specific type, which is described for each specific use of the IArray interface. 

HRESULT InsertAt(int index, IUnknown * pIUnkn)

Parameters

index - [in] index of the newly added object.

pIUnkn - [in] Pointer to an IUnknown interface to be inserted in the array. Depending on the specific type of objects in the array if pIUnkn is NULL a new default object is inserted at the position. 

Returns

S_OK in case of success.

Remarks:

This method will insert pIUnkn at position index. All other members will be shifted up. Size of the array will be incremented by 1.


HRESULT RemoveAt(int index)

Parameters

index - [in] index of the object to be removed..

Returns

S_OK in case of success.

Remarks:

Will remove the object at index position. 


HRESULT Add(IUnknown * pIUnkn)

Parameters

pIUnkn - [in] Pointer to an IUnknown interface to be added to the array. Depending on the specific type of objects in the array if pIUnkn is NULL a new default object added in the end of array. 

Returns

S_OK in case of success.

The method will insert pIUnkn at the end of the array

 


HRESULT Find(IUnknown * pIUnkn, int* pnIndex)

Parameters

pIUnkn - [in] Pointer to an interface to be found in the array. Note that any interface of any type can be supplied for this parameter.

pnIndex - [out] Pointer to an integer variable, which will receive 0-based index of the object in the array or -1 if not found.

Returns

S_OK. - Always.

If the array contains the object implementing the pIUnkn its 0- based index will be returned in pnIndex. Otherwise pnIndex will be set to -1.


HRESULT RemoveAll()

Returns

S_OK. - Always.

  • Empties the array by removing all elements