SIGetPrim
 
 
 

SIGetPrim

Description

Creates raw primitives. For geometrical objects it creates implicit geometrical objects. It is also possible to create other types of primitives: cameras, lights, nulls, control objects, lattices, geometry shaders. The created primitive will not be selected.

SIGetPrim creates a primitive. The name SIGetPrim comes from the Softimage menu Get-Primitive-.

Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference so you need to use the best workaround for your situation:

For scripting languages this command returns an ISIVTCollection which you can use to get the output arguments.

For C# you can use the XSIApplication.ExecuteCommand method to call this command. ExecuteCommand packs the output arguments into a C# System.Object containing an Array of the output arguments (see Calling Commands from C#).

Scripting Syntax

SIGetPrim( PresetObj, [Name], [Parent], [AddToScene], [Value], [Primitive] );

Parameters

Parameter Type Description
PresetObj String or a preset object (see SIGetPreset) The name of a primitive preset. See Implicit Primitives and Geometry Primitives for a list of supported preset names.
Name String Name of the new primitive.
Parent String Name of an existing object to use as the parent of the new primitive.
AddToScene Boolean True to create the object in the scene.

Default Value: True

Value X3DObject Returns the 3D object created for the primitive.
Primitive Primitive Returns the implicit primitive object.

Examples

VBScript Example

' This examples shows how to create an implicit primitive
' and convert it to a NURBS surface.
newscene
dim MyGrid, MyCamera
'Create implicit primitive.  It will be named and nested under the scene root.  
'We consult the returned list instead of the output parameters because 
'it is better supported by other scripting languages.
set MyGrid = SIGetPrim( "Grid",  "aGrid", , True)
'Logged information:
'INFO : "ISIVTCollection contains 2 elements."
'INFO : "First object is: Primitive"
'INFO : "Second object is: X3DObject"
logmessage typename(MyGrid) & " contains " & MyGrid.count & " elements."
logmessage "First object is: " & typename( MyGrid(0) )
logmessage "Second object is: " & typename( MyGrid(1) )
' It is possible to convert the implicit to a Nurbs Surface
SIConvert "NurbsSurface", MyGrid(1)
'Create a camera without an interest. It uses default values.
set MyCamera = SIGetPrim( "Camera" )
'Logged information:
'INFO : "ISIVTCollection contains 2 elements."
'INFO : "First object is: Primitive"
'INFO : "Second object is: Camera"
logmessage typename(MyCamera) & " contains " & MyCamera.count & " elements."
logmessage "First object is: " & typename( MyCamera(0) )
logmessage "Second object is: " & typename( MyCamera(1) )

See Also

GetPrim CreatePrim SIConvert