CreateDynamicObject

The CreateDynamicObject creates a dynamic object with no way points. To put the object in the 3D you must add way point using ITerrainDynamicObject5::AddWaypoint(). More methods for controlling the dynamic object are available using the ITerrainDynamicObject5 interface.

 

HRESULT CreateDynamicObject(

 [in, defaultvalue(1)] DynamicMotionStyle MotionStyle,

 [in, defaultvalue(3)] DynamicObjectType ObjectType,

 [in, defaultvalue("")] BSTR FileNameOrText,

 [in, defaultvalue(1)] double ScaleFactor,

 [in, defaultvalue(0)] HeightStyleCode HeightStyle,

 [in, defaultvalue(0)] long GroupID,

 [in, defaultvalue("")] BSTR Description,

 [out, retval] ITerrainDynamicObject5** pITerrainDynamicObject5)

Parameters:

The HeightStyleCode enum can use any of the following values:

Return Values:

The return value obtained from the returned HRESULT can be one of the following:

 

Return value

Meaning

S_OK

Success.

E_FAIL

Catastrophic failure.

TE_E_MPTNOTLOADED

An MPT file must be loaded in TerraExplorer for this method to work.

TE_E_INFOTREE_PARENTNOTGROUP

The group ID entered does not represent a valid group in the information tree.

TE_E_INTERNAL

TerraExplorer was unable to create the object. To get more information about this error use IErrorInfo Interface.

TE_E_NOLICENCE

Your license does not allow the use of this feature.