## X3DObject.AddLattice

### Description

Creates a new lattice given a preset name/object and a name, the input object(s) are connected to the new lattice object. A lattice object is used to control lattice deformations.

### C# Syntax

    X3DObject X3DObject.AddLattice( Object in_lattPreset, Object in_inputObjects, String in_name );

### Scripting Syntax

    oReturn = X3DObject.AddLattice( Preset, [Items], [Name] );

### Return Value

X3DObject

### Parameters

Parameter | Type | Description
--- | --- | ---
Preset | Lattice Primitive Preset | Preset for the lattice
Possible Values: | Description:
Lattice | Lattice (only supported preset for this method)
Items | XSICollection or X3DObject | An X3DObjectCollection or a single X3DObject
Name | String | Name of the new lattice

### Examples

#### 1. JScript Example

    NewScene( null, false );

    var oCube = Application.ActiveSceneRoot.AddGeometry( "Cube", "NurbsSurface" );

    var oCone = Application.ActiveSceneRoot.AddGeometry( "Cone", "NurbsSurface" );

    var oList = new ActiveXObject( "XSI.Collection" );

    oList.Add( oCone );

    oList.Add( oCube );

    var oLat = Application.ActiveSceneRoot.AddLattice( "Lattice", oList, "MyConeCubeLattice" );

#### 2. VBScript Example

    NewScene , false

    set oRoot = Application.ActiveProject.ActiveScene.Root

    set oCube = oRoot.AddGeometry( "Cube", "NurbsSurface" )

    set oCone = oRoot.AddGeometry( "Cone", "NurbsSurface" )

    set oList = CreateObject( "XSI.Collection" )

    oList.Add oCone

    oList.Add oCube

    set oLat = oRoot.AddLattice( "Lattice", oList, "MyConeCubeLattice" )