XSICollection

Object Hierarchy

Introduced

1.0

Description

A Collection is an object that stores a "list" or "grouping" of multiple objects. The XSICollection is normally used to create, and subsequently process, a temporary list of objects from within the scene. A typical use of XSICollection is demonstrated in one of the examples for the Shader object.

Instances of the XSICollection are not persisted and, unlike the Group object, are not part of the Scene. One way to persist the contents of an XSICollection is to store the return value of XSICollection.GetAsText inside a StringParameter in a CustomProperty.

The Object Model also contains many other collection objects, for example, the PropertyCollection and the ParameterCollection. Enumerating through all these objects is identical (using the Item and Count properties). However these other collections only contain objects of one single type and the script writer cannot add or remove objects in these collections. For this reason XSICollection is the most suitable choice for most scripts.

Each script language also provides its own Array support which can be similar to the XSICollection object. This "native" collection support can be useful inside the implementation of a script but cannot be easily understood by C++ or other scripting languages. For example, custom Commands cannot receive JScript arrays as arguments. These collection objects also do not have the same convenient capability that the XSICollection has for converting between the string representation of an object and the Object Model representation (see XSICollection.SetAsText).

The equivalent object in the C++ API is the CRefArray.

Methods

Add

AddItems

Expand

FindObjectsByMarkingAndCapabilities

GetAsText

Remove

RemoveAll

RemoveItems

SetAsText

 

 

 

Properties

Count

Item

Type

Unique

See Also

CollectionItem

siBranchFlag

ArgumentHandler

Shader

Group.AddMember

Array

 

 

Examples

• See XSICollection.1.vbs

• See XSICollection.2.js

• See XSICollection.3.vbs



Autodesk Softimage 2011