Home > Working with SGWorld > Creator (ICreator6) > CreateLocation
In TerraExplorer, a location is defined as a point of interest (X, Y, Height). The camera is given a direction and distance from which this point of interest is viewed. For example, if you chose the White House as your point of interest, you would need to find the x- and y-coordinates of the White House and pass those coordinates to the CreateLocation() method.
JavaScript |
|
CreateLocation( Position , GroupID , Description ) |
C# |
|
ITerrainLocation6 CreateLocation( IPosition6 Position = 0, int GroupID = 0, string Description = "") |
C++ |
|
HRESULT CreateLocation( IPosition6 * Position, LONG_PTR GroupID, BSTR Description, ITerrainLocation6 ** pITerrainLocation6) |
Parameters
Position
An IPosition6 representing the position of the location on the terrain.
GroupID
The Project Tree group in which the location is created. If it is set to zero, the object is created under the root. You can obtain the GroupID by one of the following methods:
§ Create the group using IProjectTree6.CreateGroup.
§ Find the group, if you know the name, using IProjectTree6.FindItem.
§ Traverse the Tree using IProjectTree6 methods such as GetNextItem(), until you come to the desired GroupID.
Description
The name of the location as it appears in the Project Tree. If an empty string is passed into this parameter, TerraExplorer assigns it a unique name.
Return Value
pITerrainLocation6
An ITerrainLocation6, representing the newly created location.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.