Description
C# Syntax
XSICollection.Add( Object in_newVal );
|
Scripting Syntax
XSICollection.Add( Item );
|
Parameters
Examples
VBScript Example
Dim oColl ' object pointer for collection
Dim oMember ' object pointer for members
Dim oNull ' object pointer for null object
Dim oCollItem ' object pointer for collection item
Dim sLightName ' string variable for the camera name
' Create the stuff we will populate the collection with
Set oNull = ActiveSceneRoot.AddNull
checkType oNull ' = project item
Set oCollItem = CreateObject( "XSI.CollectionItem" )
oCollItem.Value = "Camera"
checkType oCollItem ' = collection item
sLightName = "light*"
checkType sLightName ' = string expression
' Create the new collection
Set oColl = CreateObject( "XSI.Collection" )
' Add each item
oColl.Add oNull
oColl.Add oCollItem
oColl.Add sLightName
' What do we have now?
LogMessage "----------------"
For Each oMember In oColl
checkType oMember
Next
'--------------------------------------------------
function checkType( in_object )
LogMessage in_object & " is a " & TypeName( in_object )
end function
'--------------------------------------------------
' Output of above script:
'INFO : "null is a Null"
'INFO : "Camera is a CollectionItem"
'INFO : "light* is a String"
'INFO : "----------------"
'INFO : "null is a Null"
'INFO : "Camera is a Camera"
'INFO : "light is a Light"
|
See Also