Dim oColl ' object pointer for collection
Dim oMember ' object pointer for members
' Create a bunch of grids
NewScene , false
CreatePrim "Grid", "MeshSurface"
CreatePrim "Grid", "MeshSurface"
CreatePrim "Grid", "MeshSurface"
' Use wildcards to add everything starting with 'grid' to the new collection
Set oColl = CreateObject("XSI.Collection")
oColl.SetAsText "grid*"
For Each oMember In oColl
Application.LogMessage oMember & " is in the collection list: " & oColl.GetAsText
Next
'--------------------------------------------------
' Output of above script:
' INFO : grid is in the collection list: grid,grid1,grid2
' INFO : grid1 is in the collection list: grid,grid1,grid2
' INFO : grid2 is in the collection list: grid,grid1,grid2
|