Creates a rectangle in the 3D Window.
JavaScript |
|
CreateRectangle( Position, ObjectWidth, ObjectDepth, LineColor, FillColor, GroupID, Description ) |
C# |
|
ITerrainRectangle66 CreateRectangle( IPosition66 Position, double ObjectWidth, double ObjectDepth, [object LineColor = 0xFF00FF00], [object FillColor = 0xFF646464], [string GroupID = ""], [string Description = ""]) |
C++ |
|
HRESULT CreateRectangle( IPosition66* Position, double ObjectWidth, double ObjectDepth, VARIANT LineColor, VARIANT FillColor, BSTR GroupID, BSTR Description, ITerrainRectangle66** pITerrainRectangle66) |
Parameters
Position
An IPosition66 representing the position and orientation of the rectangle on the terrain.
ObjectWidth
The width of the rectangle in meters.
ObjectDepth
The depth of the rectangle in meters.
LineColor
The color of the lines that make up the rectangle. The color value is used to specify color and transparency values. This parameter can be any of the following:
· An IColor66 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”).
FillColor
The color which fills the rectangle, if the alpha value is greater than zero. The color value is used to specify color and transparency values. This parameter can be any of the following:
· An IColor66 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”).
GroupID
The Project Tree group in which the rectangle 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 IProjectTree66.CreateGroup.
· Find the group, if you know the name, using IProjectTree66.FindItem.
· Traverse the Tree using IProjectTree66 methods such as GetNextItem, until you come to the desired GroupID.
Description
The name of the rectangle as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.
Return Value
pITerrainRectangle66
An ITerrainRectangle66, representing the newly created rectangle.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
Remarks
The rectangle is initially created with its orientation aligned with the north. The client can then change its orientation using the IPosition66 interface.