Creates and adds a new primitive as a child of the current X3DObject. The term 'primitive' in this sense means the basic (implicit) shape without details of the geometry. This means that you can use this method to create Implicit Shapes, but X3DObject.AddGeometry is needed to create Geometric Shapes.
oReturn = X3DObject.AddPrimitive( Preset, [Name] ); |
Parameter | Type | Description |
---|---|---|
Preset | String | Any preset in the Alphabetical Listing of All Primitive Presets (for example, "Sphere", "Camera", "Wave", etc.) |
Name | String | Name of child |
NewScene( null, false ); var oRoot = Application.ActiveProject.ActiveScene.Root; var oCam = oRoot.AddPrimitive( "Camera" ); Application.LogMessage( Application.ClassName(oCam) ); var oArc = oRoot.AddPrimitive( "Arc" ); Application.LogMessage( Application.ClassName(oArc) ); var oSph = oRoot.AddPrimitive( "Sphere" ); Application.LogMessage( Application.ClassName(oSph) ); var oNull = oRoot.AddPrimitive( "Null" ); Application.LogMessage( Application.ClassName(oNull) ); // Expected results: //INFO : Camera //INFO : X3DObject //INFO : X3DObject //INFO : Null |
NewScene , false set oRoot = Application.ActiveProject.ActiveScene.Root set oNewPrim = oRoot.AddPrimitive( "Spot" ) Application.LogMessage Application.ClassName(oNewPrim) ' Expected results: 'INFO : Light |