SICreateModel

詳細

Scene に新しい Model を作成します。新しいモデルに含まれるオブジェクト(他のモデルを含む)を特別に指定しない限り(InputObj パラメータを介して)、現在選択されているオブジェクトすべてが、作成されたノードの子になります。

新しいモデルの親になるノードを指定することもできます(InputObj パラメータを介して)。

このコマンドは、構文と動作が CreateModel コマンドと似ていますが、選択内容を変更しない点が異なります。

注: このコマンドは、出力引数を使用します。C# および一部のスクリプト言語(JScript、PerlScript、Python など)は、リファレンスによって渡される引数をサポートしていません。このため、状況に応じた適切な回避策を実行する必要があります。

スクリプト言語の場合、このコマンドは出力引数を取得するために使用できる ISIVTCollection を戻します。

C# の場合は、XSIApplication.ExecuteCommand メソッドを使用してこのコマンドを呼び出すことができます。ExecuteCommand は、出力引数を C# の System.Object (出力引数の Array を含む)にパック化します(詳細については、「C# からのコマンドの呼び出し」を参照)。

スクリプト構文

SICreateModel( [InputObj], [Name], [Parent], [Value] );

パラメータ

パラメータ タイプ 説明
InputObj 文字列 再び新しいモデルの子となるオブジェクト(他のモデルを含む)のリスト

デフォルト値: 現在選択されている値

Name 文字列 モデル名
Parent 文字列 新しいモデルの親として使用するオブジェクトまたはモデル
Value Model モデルを戻します。

Python の例

#---------------------------------------------------------

# This example demonstrates how to use the SICreateModel 

# command in Python.

#---------------------------------------------------------

app = Application

app.NewScene( "", 0 )

# First create a node off of the scene root.

ivtInfo = app.SICreateModel( "", "Root_Node" )

Root_NodeObj = ivtInfo.Value( "Value" )

app.LogMessage( "Created " + Root_NodeObj.Name )

# Now create a sub-node, and make it the child of a 

# third node. Notice that since "Sub-node" is selected 

# when "Another_Root" is created, it becomes a child.

ivtInfo = app.SICreateModel( "", "Sub-node" )

Sub_NodeObj = ivtInfo.Value( "Value" )

app.LogMessage( "Created " + Sub_NodeObj.Name )

app.SelectObj( "Sub-node" )

ivtInfo = app.SICreateModel( "", "Another_Root" )

Another_RootObj = ivtInfo.Value( "Value" )

app.LogMessage( "Created " + Another_RootObj.Name )

app.DeselectAll()

# Now make another node, with parent "Another_Root", 

# and child "Root_Node". Notice that now, "Another_Root" 

# is the only top-level model, with children "Mid_Root" 

# and "Sub-node", and "Mid_Root" has child "Root_Node"

ivtInfo = app.SICreateModel( "Root_Node", "Mid_Root", "Another_Root" )

Mid_RootObj = ivtInfo.Value( "Value" )

app.LogMessage( "Created " + Mid_RootObj.Name )

app.DeselectAll()

#---------------------------------------------------------

# Output from this script:

#---------------------------------------------------------

#INFO : Created Root_Node

#INFO : Created Sub-node

#INFO : Created Another_Root

#INFO : Created Mid_Root

関連項目

SICreateModel