CreateEffect

Creates an ITerrainEffect66 animated effect object.

 

JavaScript

 

CreateEffect(

       Position,

       EffectsXML = "",

       GroupID = "",

       string Description = "")

 

C#

 

ITerrainEffect66 CreateEffect(

       IPosition66 Position,

       string EffectsXML = "",

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreateEffect(

       IPosition66* Position,

       BSTR EffectsXML,

       BSTR GroupID,

       BSTR Description,

       ITerrainEffect66** pITerrainEffect66);

 

Parameters

Position

An IPosition66 representing the position and orientation of the object on the terrain.

EffectsXML

An XML that defines the animation effect’s particle system parameters, such as the shape and size of the particle emitter, and shape and scale factor of the volume that the particles are emitted into. This XML is returned by ITerrainEffect66.EffectXML. See: “Particle Editor Parameters” in the “Effects” chapter in the TerraExplorer User Manual for a description of the XML’s particle system parameters.

GroupID

The Project Tree group in which the effect object is created. If it is set to an empty string, the object is created under the root. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree66.CreateGroup.

·          Find the group, if you know the name, using IProjectTree66.FindItem.

·          Traverse the Tree using IProjectTree66 methods such as GetNextItem, until you come to the desired GroupID.

Description

The name of the effect object as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainEffect66

An ITerrainEffect66, representing the newly created effect.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.