ClusterElementCollection.FindIndex

Description

Searches the collection for the specified item.

C# Syntax

Int32 ClusterElementCollection.FindIndex( Object vItem );

Scripting Syntax

oReturn = ClusterElementCollection.FindIndex( Item );

Return Value

Returns the index of the item, or returns -1 if the item is not found.

Parameters

Parameter Type Description
Item Integer or Array Integer for cluster elements and Array for clusterproperty elements

Examples

VBScript Example

dim oRoot, oGrid, oCluster, indice
set oRoot = Application.ActiveProject.ActiveScene.Root
set oGrid = oRoot.AddGeometry("Grid","MeshSurface")
set oCluster = oGrid.ActivePrimitive.Geometry.AddCluster(	siPolygonCluster, "PolygonClusterOnGrid", _
										array(59,60,61))
indice = oCluster.Elements.FindIndex (59)
LogMessage "indice for 59 : " & indice
indice = oCluster.Elements.FindIndex (60)
LogMessage "indice for 60 : " & indice
indice = oCluster.Elements.FindIndex (61)
LogMessage "indice for 61 : " & indice
indice = oCluster.Elements.FindIndex (40)
LogMessage "indice for 40 : " & indice