#---------------------------------------------------------
# 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 |