X3DObject.AddGeometry

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"'.

C# Syntax

X3DObject X3DObject.AddGeometry( Object in_geomPreset, Object in_convPreset, String in_name );

Scripting Syntax

oReturn = X3DObject.AddGeometry( Preset, [Type], [Name] );

Return Value

X3DObject

Parameters

Parameter Type Description
Preset String 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 String Type of geometry.

Default Value: Implicit object created

Possible Values:

Description:

Implicit only, no geometry. Supports all Primitive Presets.
NurbsCurve NURBS curve geometry. Supports only Circle, Spiral, Square, and Text primitives.
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.
PointCloud PointCloudGeometry. Supports only Cone, Cube, Cylinder, Disc, Grid, Sphere, and Torus primitives.
Name String Name of child

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

CreatePrim X3DObject.AddPrimitive