CreateDynamicObject

Creates a dynamic object with waypoints.

 

JavaScript

 

CreateDynamicObject(

       Waypoints,

       MotionStyle,

       ObjectType,

       FileNameOrText,

       ScaleFactor,

       AltitudeType,

       GroupID,

       Description )

 

C#

 

ITerrainDynamicObject80 CreateDynamicObject(

       object        Waypoints = 0,

       DynamicMotionStyle MotionStyle = 1,

       DynamicObjectType   ObjectType = 3,

       string        FileNameOrText = "",

       double        ScaleFactor = 1,

       AltitudeTypeCode    AltitudeType = AltitudeTypeCode.ATC_TERRAIN_RELATIVE,

       string        GroupID = "",

       string        Description = "")

 

C++

 

HRESULT CreateDynamicObject(

       VARIANT Waypoints

       DynamicMotionStyle MotionStyle,

       DynamicObjectType ObjectType,

       BSTR FileNameOrText,

       double ScaleFactor,

       AltitudeTypeCode AltitudeType,

       BSTR GroupID,

       BSTR Description,

       ITerrainDynamicObject80 ** pITerrainDynamicObject80) 

Parameters

Waypoints

An array of IRouteWaypoint80 objects.

MotionStyle

An enum that determines the style of motion of the dynamic object. The following are the possible values:

·          MOTION_GROUND_VEHICLE = 0
The object is a ground vehicle.

·          MOTION_AIRPLANE = 1
The object sets the pitch angles during the flight according to altitude differences between the waypoints. It also rolls while turning between the waypoints.

·          MOTION_HELICOPTER = 2
The object leans forward with a fixed pitch angle of –15 degrees. It also rolls while turning between the waypoints.

·          MOTION_HOVER = 3
The object always keeps the pitch and roll angles set to zero.

·          MOTION_MANUAL = 4
The yaw, pitch, and roll can be set by the client at each waypoint. If the value -9999 is entered for any of these parameters, a default value will be calculated for this parameter so that the object will point to the next waypoint.

ObjectType

An enum that determines the type of object to be used for the dynamic object. The following are the possible values:

·          DYNAMIC_3D_MODEL = 0
A 3D model is used.

·          DYNAMIC_TEXT_LABEL = 1
A text label is used.

·          DYNAMIC_IMAGE_LABEL = 2
An image label is used.

·          DYNAMIC_VIRTUAL = 3
A virtual type is used. You can attach any object to the virtual dynamic object.

FileNameOrText

If the ObjectType value is set to DYNAMIC_TEXT_LABEL, this parameter is the image label text. If ObjectType is set to DYNAMIC_3D_MODEL or DYNAMIC_IMAGE_LABEL, this is the 3D model file, or image label image file, respectively, to be used.

ScaleFactor

If the ObjectType value is set to DYNAMIC_3D_MODEL, this parameter is the scale value of the 3D model. If ObjectType value is set to DYNAMIC_TEXT_LABEL, or DYNAMIC_IMAGE_LABEL, this is the scale of the label.

AltitudeType

An enum that determines the altitude type to be used by the object. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0

Places the object’s pivot point at a specified altitude above the ground.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the object’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

GroupID

The Project Tree group in which the dynamic 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 IProjectTree80.CreateGroup.

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

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

Description

The name of the dynamic 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

pITerrainDynamicObject80

An ITerrainDynamicObject80, representing the newly created dynamic object.

Exceptions

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