## CreatePrim

### Description

Creates an implicit primitive and converts it to a given geometry type. Contrary to implicit primitives, converted primitives have explicit geometry elements that can be manipulated, ex.: control points, edges, polygons...
Note: The implicit primitives must be compatible with the geometry types. For more information, see the $cdname X3DObject.AddGeometry@cdname method.

### Scripting Syntax

    oReturn = CreatePrim( PresetObj, GeometryType, [Name], [Parent] );

### Return Value

Returns the primitive object (usually an X3DObject object).

### Parameters

Parameter | Type | Description
--- | --- | ---
PresetObj | String or a preset object (see SIGetPreset) | Geometry Primitives
GeometryType | String | Geometry type
Possible Values: | Description:
NurbsCurve | Convert primitive to a Nurbs curve
NurbsSurface | Convert primitive to a Nurbs surface
MeshSurface | Convert primitive to a Mesh surface
PointCloud | Convert primitive to a PointCloudGeometry
Name | String | Name of the new object.
Parent | String | Name of an existing object to use as the parent of the new primitive.

### Examples

#### VBScript Example

    'This example creates a new primitive

    newscene

    dim nurbssphere, meshsphere

    'Create a nurbs sphere and name it aSphere. Assign to variable nurbssphere

    set nurbssphere = CreatePrim( "Sphere", "NurbsSurface", "aSphere" )

    'Create a mesh sphere and name it bSphere. Assign to variable meshsphere.

    'Make bSphere child of aSphere

    set meshsphere = CreatePrim( "Sphere", "MeshSurface", "bSphere", "aSphere" )

    'Logged information:

    'INFO : "Sphere information: X3DObject polymsh"

    logmessage "Sphere information: " & typename( meshsphere) & " " & meshsphere.type

### See Also

GetPrim SIGetPrim