SetAsText (XSICollection)

Description

Sets the collection using the string path names for objects as is shown in the scripting history window. The string list is comma-separated. You may use wildcards in the string to match many object for example "light*". Compare this method to XSICollection.Add, which only adds a single item at a time or XSICollection.AddItems, which adds one or more items at a time.

Scripting Syntax

    XSICollection.SetAsText( [Text] )

C# Syntax

    XSICollection.SetAsText( String );

Parameters

Parameter | Type | Description
Text | String | (see list of items)

Examples

VBScript Example

    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

See Also

XSICollection.Add | XSICollection.AddItems | XSICollection.GetAsText

Autodesk Softimage v7.5