DrawRectangle

Activates an interactive mode for drawing a rectangle in the 3D World. The drawing process and style can be controlled using the related drawing events: OnDrawingAbort, OnDrawingFinished, and OnDrawingGeometryChanged. The ITerrainRectangle return object can be used to set any of the properties of the drawn rectangle.

Note:    The Position or Geometry of the returning ITerrainRectangle rectangle should not be modified until the draw action is complete, i.e., until the OnDrawingFinished event is sent.

 

JavaScript

 

DrawRectangle(

       DrawingMode,

       GroupID,

       Left,

       Top)

 

C#

 

ITerrainRectangle80 DrawRectangle (

       TerraExplorerX.DrawingMode = DrawingMode.DRAW_MODE_MAGNET,

       string GroupID = "",

       int Left = int.MaxValue,

       int Top = int.MaxValue]

 

C++

 

HRESULT DrawRectangle (

       [in] DrawingMode DrawingMode,

       [in] BSTR GroupID,

       [in] long Left,
       [in] long Top,

       [out, retval] ITerrainRectangle80** pITerrainRectangle80)

Parameters

DrawingMode

An enum that determines an object's initial move mode, i.e., how it is moved in the 3D Window, and how the property sheet is displayed when the object is created. The DrawingMode enum is divided into two subgroups. This parameter can use a combination of values from the two subgroups, but no more than one value from each subgroup can be used.

Property Sheet Display Group – Use only one of the following values:

·          DRAW_MODE_SHOW_PROPERTY = 1
Open the property sheet including the top toolbar to edit the object.

·          DRAW_MODE_SHOW_PROPERTY_PANEL = 2
Open only the property sheet toolbar to edit the item.

Move Mode Group – Use only one of the following values:

·          DRAW_MODE_MAGNET = 4
Sets the edit mode to move the object based on where the mouse is pointing in the 3D Window. This makes it easier to move an object or node on a vertical plane or above a 3DML layer or other terrain object.

·          DRAW_MODE_XY = 8    
Set the edit mode to move the object in the XY plane.

GroupID

The ID of the group in which the rectangle object should be created.

Left

The top left X position (in pixels) of the object's property sheet relative to the last position of the property sheet.

Top

The top left Y position (in pixels) of the object's property sheet relative to the last position of the property sheet.

 

Return Value

pITerrainRectangle80

An ITerrainRectangle representing the rectangle drawn. The return object can be used to set any of the properties of the drawn object.

Exceptions

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