DrawDynamicObject

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

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

 

JavaScript

 

DrawDynamicObject (

       Path,

       DrawingMode,

       GroupID,

       Left,

       Top)

 

C#

 

ITerrainDynamicObject80 DrawDynamicObject (

       String Path,

       TerraExplorerX.DrawingMode = DrawingMode.DRAW_MODE_MAGNET,

       string GroupID = "",

       int Left =  int.MaxValue,

       int Top = int.MaxValue)

 

C++

 

HRESULT DrawDynamicObject (

       [in] BSTR Path,

       [in] DrawingMode DrawingMode,

       [in] BSTR GroupID,

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

       [out, retval] ITerrainDynamicObject80** pITerrainDynamicObject80)

Parameters

Path

Full path to the model file or image file to be used for the dynamic object.

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 dynamic 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

pITerrainDynamicObject80

An ITerrainDynamicObject representing the dynamic object 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.