CollectionItem.SubElements

Description

Returns or sets the object's internal array of indices.

NOTE: If you use the function to return, it will force an ascending order. Use CollectionItem.SubElements2 if you want the elements to be returned in their current order.

C# Syntax

// get accessor
Object rtn = CollectionItem.SubElements;
// set accessor
CollectionItem.SubElements = Object;

Examples

VBScript Example

set oRoot = Application.ActiveProject.ActiveScene.Root
set oObject = oRoot.AddGeometry("Cube", "MeshSurface")
set oItem = CreateObject("XSI.CollectionItem")
oItem.Value = oObject.FullName & "." & siVertexCluster & "[*]"
logmessage "all components selected"
aIndices = oItem.SubElements
for i = LBound( aIndices, 1 ) to UBound( aIndices, 1 )
LogMessage "SubComponent[" & i & "] : " & aIndices(i)
next
logmessage "subset of components selected"
oItem.SubElements = Array(0,1,2,4,6)
aNewIndices = oItem.SubElements
for i = LBound( aNewIndices, 1 ) to UBound( aNewIndices, 1 )
LogMessage "SubComponent[" & i & "] : " & aNewIndices (i)
next