CreatePolyline

Creates a polyline in the 3D Window.

 

JavaScript

 

CreatePolyline(

       Geometry,

       LineColor,

       AltitudeType,

       GroupID,

       Description )

 

C#

 

ITerrainPolyline80 CreatePolyline(

       IGeometry Geometry = null,

       object        LineColor = -16711936,

       AltitudeTypeCode AltitudeType = 2,

       string GroupID = "",

       string Description = "")

 

C++

 

HRESULT CreatePolyline(

       IGeometry* pIGeometry,

       VARIANT LineColor,

       AltitudeTypeCode AltitudeType,

       BSTR GroupID,

       BSTR Description,

       ITerrainPolyline80** pITerrainPolyline80)

 

Parameters

Geometry

An IGeometry representing geometric properties of the polyline.

LineColor

The color of the lines that make up the polyline. The color value is used to specify color and transparency values. This parameter can be any of the following:

·          An IColor80 object.

·          A number which represents the color in ABGR format (0xAABBGGRR). The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; the third byte contains a value for blue. The high-order byte contains a value for alpha.

·          A string that represents HTML color format (“#RRGGBB”).

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 polyline’s pivot point at a specified altitude above the ground.

·          ATC_PIVOT_RELATIVE = 1
Places each point of the polyline at a specified altitude above the pivot point altitude, defined by its Point Altitude. In addition, for this value only, X and Y coordinates are also relative to the polyline’s pivot. The pivot is located at the center of the polyline. You can use this feature to create horizontal polylines in mountainous terrain.

·          ATC_ON_TERRAIN = 2
Creates the polyline on the terrain itself. This selection also changes the drawing method of the polyline. Instead of straight lines between the polyline’s points, it paints the terrain in the selected color. It is recommended to use this feature to improve performance.

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

GroupID

The Project Tree group in which the polyline 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 polyline as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.

Return Value

pITerrainPolyline80

An ITerrainPolyline80, representing the newly created polyline.

Exceptions

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