CreateSubComponent (Geometry)
Description
Creates a SubComponent object containing the subelements of the Geometry matching the specified indices. If you don't specify indices, an empty SubComponent object is created.
Scripting Syntax
Geometry.CreateSubComponent( Type, [Indices] )
C# Syntax
SubComponent Geometry.CreateSubComponent( String in_Type, Object in_Indices );
Parameters
|
Parameter |
Type |
Description |
|
Type |
The cluster type is used to identify the SubComponent type. |
|
|
Indices |
A 1D array containing indices to the subcomponent of the geometry. |
Return Value
Examples
VBScript Example
set oObject = Application.ActiveProject.ActiveScene.root.AddGeometry("Cube","MeshSurface","MyCube")
myVertexArray = Array(2,3,34,56)
FindInvalidSubComponentIndex siVertexCluster, myVertexArray, oObject
' Procedure that, given an object, an array of indices and a cluster type, displays invalid
' indices in the array.
Sub FindInvalidSubComponentIndex( in_ClusterType, in_IndexArray, in_Object)
Dim l_invalidIndexArray, l_validArray, l_subComponent, l_bNotFound
set l_subComponent = oObject.ActivePrimitive.Geometry.CreateSubComponent(in_ClusterType, in_IndexArray)
l_validArray = l_subComponent.ElementArray
for i = lbound(in_IndexArray) to ubound(in_IndexArray)
l_bNotFound = TRUE
for j = lbound(l_validArray) to ubound(l_validArray)
if in_IndexArray(i) = l_validArray(j) then
l_bNotFound = FALSE
Exit For
end if
next
if l_bNotFound then
Application.LogMessage in_IndexArray(i)
end if
next
End Sub
See Also
SOFTIMAGE|XSI v6.01