Home > Working with SGWorld > ProjectTree (IProjectTree6) > GetTerraObjectID

GetTerraObjectID

The GetTerraObjectID method uses ItemID to retrieve the actual Object ID associated with this tree item ID entry. While ItemID can change while working with TerraExplorer Pro, and when reloading the FLY file, ObjectID always stays the same.

Supported by TerraExplorer Viewer.

 

JavaScript

 

GetTerraObjectID(

      ItemID)

 

C#

 

string GetTerraObjectID(

      int ItemID)

 

C++

 

HRESULT GetTerraObjectID(

      LONG_PTR ItemID,

      BSTR * pVal) 

Parameters

ItemID

The Project Tree ID of the object to be found.

Return Value

pVal

The ObjectID of the object.

Exceptions

HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following values:

TE_E_INFOTREE_PARENTNOTGROUP

The group ID entered does not represent a valid group in the project tree.

TE_E_INFOTREE_ITEMNOTGROUP

The item entered is not a group and therefore cannot be used as a group.

TE_E_INFOTREE_CANTUSEROOT

Can not use tree root for this operation

TE_E_INFOTREE_ITEMISGROUP

ItemID is a group so an object cannot be retrieved.