Python Example: Working with the ISIVTCollection returned from a Command
 
 
 

This example uses the AddProp command to demonstrate using the ISIVTCollection with Python. The AddProp command has no return value but uses two output arguments, PropertyName and Value, which are returned as the return value as an ISIVTCollection object.

Application.SelectObj( "Scene_Root" )
rtn = Application.AddProp("Custom_parameter_list", "", "", "MyPSet", "")

# The second return value is the XSICollection of the newly created 
# properties (in this case 1)

for i in range(rtn(1).Count):
	o = rtn(1)(i)
	Application.LogMessage(o.FullName)

# You can also retrieve the output arguments by name
o = rtn( "Value" )(0)
Application.LogMessage(o.FullName)


# Output:
#INFO : MyPSet
#INFO : MyPSet