XSICollection.Expand

説明

コレクションの各項目を次のように拡張します:

- 項目がグループの場合、このグループはグループのメンバーで置き換えられます。

- グループのメンバがブランチで追加されていた場合、メンバは、ブランチフラグが設定された状態でコレクション項目に追加されたように拡張されます。

- 項目がX3DObjectを含むでCollectionItemあり、項目のProjectItem.BranchFlagプロパティが設定されている場合は、ブランチ全体がチェックされ、ブランチ内の各X3DObjectがコレクションに追加されます。

スクリプト 構文

oReturn = XSICollection.Expand();

戻り値

XSICollection

VBScript の例

Dim oColl             ' object pointer for collection
Dim oExpColl            ' object pointer for expanded collection
' Create the new collection & populate it 
Set oColl = CreateObject( "XSI.Collection" )
oColl.Add ActiveSceneRoot
checkContents "oColl", oColl
' Expand the collection and save it as a new collection
LogMessage "----------------"
Set oRoot = oColl.Item(0)
oRoot.BranchFlag = siBranch
Set oExpColl = oColl.Expand
checkContents "oExpColl", oExpColl 
' Now start again but this time don't set the branch flag
LogMessage "----------------"
oExpColl.RemoveAll
oRoot.BranchFlag = siNode
Set oExpColl = oColl.Expand
checkContents "oExpColl", oExpColl 
'--------------------------------------------------
function checkContents( in_name, in_coll )
        If in_coll.Count > 0 Then
                LogMessage in_name & " collection now contains " & in_coll.GetAsText 
        Else
                LogMessage in_name & " collection is empty."
        End If
end function
'--------------------------------------------------
' Output of above script:
'INFO : "oColl collection now contains Scene_Root"
'INFO : "----------------"
'INFO : "oExpColl collection now contains Scene_Root,Camera_Root,Camera,Camera_Interest,light"
'INFO : "----------------"
'INFO : "oExpColl collection now contains Scene_Root"

関連項目

siBranchFlag SelectChildNodes