## X3DObject.AddLight

### Description

Creates a new Light object given a light preset name/object. An interest is also created by default unless its specified otherwise with the AddInterest argument. The new light created is parented under this X3DObject.
This method only creates a Ligh object with possibly an interest, whereas X3DObject.AddLightRig creates a Light root object with the Light and its interest as children.

### C# Syntax

    Light X3DObject.AddLight( Object in_Preset, Boolean in_bAddInterest, String in_name );

### Scripting Syntax

    oReturn = X3DObject.AddLight( Preset, [AddInterest], [Name] );

### Return Value

Light

### Parameters

Parameter | Type | Description
--- | --- | ---
Preset | Light Primitive Preset | Preset for type of light
Possible Values: | Description:
Infinite | Infinite light
Light_Box | Light Box light
LightInfinite | Infinite light
LightPoint | Point light
LightSpot | Spotlight
LightSun | Sunlight
Neon | Neon light
Point | Point light
Spot | Spotlight
AddInterest | Boolean | Add an interest to the created Light. This argument can be set to True for creating a spot light object. Default Value: True
Name | String | name of new Light

### Examples

#### VBScript Example

    set oRoot = Application.ActiveProject.ActiveScene.Root
    set oSpot = oRoot.AddLight( "Spot", True ,"MySpotLight" )