子オブジェクトと名前のリストが設定された新しいモデルを作成します。新しいモデルは、この X3DObject の子として関連付けられます。
Model X3DObject.AddModel( Object in_inputObjects, Object in_strName ); |
oReturn = X3DObject.AddModel( [Items], [Name] ); |
パラメータ | タイプ | 説明 |
---|---|---|
Items | XSICollectionまたはX3DObject | X3DObjectCollection または単一の X3DObject |
Name | String | 新しいの名前 Model |
NewScene( null, false ); var oRoot = Application.ActiveSceneRoot; var oNull = oRoot.AddNull( "MyNull" ); // Put the Null in a model oRoot.AddModel( oNull, "ModelForNull" ); // Create 3 objects and put them in an XSICollection var oCollection = XSIFactory.CreateActiveXObject( "XSI.Collection" ); oCollection.Add( oRoot.AddNull("AnotherNull") ); oCollection.Add( oRoot.AddPrimitive("Camera") ); oCollection.Add( oRoot.AddGeometry("Sphere", "MeshSurface") ); // Put all of these objects into another Model oRoot.AddModel( oCollection, "ModelForOtherStuff" ); // Create a model with nothing in it oCollection.RemoveAll(); oRoot.AddModel( oCollection, "EmptyModel" ); |
Option Explicit NewScene , false main() sub main() dim oRoot set oRoot = Application.ActiveProject.ActiveScene.Root oRoot.AddModel oRoot.Children, "Sally" WriteModels oRoot end sub function WriteModels( in_obj ) dim list, n, i, mdls set mdls = in_obj.Models(0) n = mdls.Count if n = 0 then exit function end if for i=0 to n-1 Application.LogMessage mdls(i).Name WriteModels mdls(i) next end function ' Expected results: 'INFO : Sally |