AddGeometry (X3DObject)
Description
Creates and adds a new geometry as child of the X3DObject. For example, you can add a new NURBS cube to the scene by using 'ActiveSceneRoot.AddGeometry "Cube", "NurbsSurface"'.
Scripting Syntax
X3DObject.AddGeometry( Preset, [Type], [Name] )
C# Syntax
X3DObject X3DObject.AddGeometry( Object in_geomPreset, Object in_convPreset, String in_name );
Parameters
|
Parameter |
Type |
Description |
|
Preset |
One of the presets for Geometry Primitives or Implicit Primitives (for example, "Sphere", "Torus", "Disc", etc.). Note: If you specify a geometry type in the Type argument, you can only use primitive presets that can support the specified geometry as listed below. |
|
|
Type |
Type of geometry. Default Value: Implicit object created Possible Values: • <empty>: Implicit only, no geometry. Supports all Primitive Presets. • MeshSurface: Polygon mesh geometry. Supports only Cone, Cube, Cylinder, Disc, Grid, Sphere, Torus, Dodecahedron, Icosahedron, Octahedron, and Tetrahedron primitives. • NurbsSurface: NURBS surface mesh geometry. Supports only Cone, Cube, Cylinder, Disc, Grid, Sphere, and Torus primitives. • NurbsCurve: NURBS curve geometry. Supports only Circle, Spiral, Square, and Text primitives. |
|
|
Name |
Name of child |
Return Value
Examples
1. JScript Example
oRoot = Application.ActiveSceneRoot; oMeshSphere = oRoot.AddGeometry( "Sphere", "MeshSurface" ); oNurbsSphere = oRoot.AddGeometry( "Sphere", "NurbsSurface" ); oNurbsArc = oRoot.AddGeometry( "Arc", "NurbsCurve" ); // Create an implicit object, which is the same as calling AddPrimitive() oGrid = oRoot.AddGeometry( "Arc" );
2. VBScript Example
set oRoot = Application.ActiveProject.ActiveScene.Root set oMeshSphere = oRoot.AddGeometry( "Sphere", "MeshSurface" ) set oNurbsSphere = oRoot.AddGeometry( "Sphere", "NurbsSurface" ) set oNurbsArc = oRoot.AddGeometry( "Arc", "NurbsCurve" ) ' Create an implicit object, which is the same as calling AddPrimitive() set oGrid = oRoot.AddGeometry( "Arc" )
See Also
SOFTIMAGE|XSI v6.01