SortGroup

Sorts the items in the group according to the specified sort type.

 

JavaScript

 

SortGroup(

       GroupID,

       SType)

 

C#

 

void SortGroup(

       string GroupID,

       SortType SType = SortType.SORT_ALPHABETICALLY_AZ)

 

C++

 

HRESULT SortGroup(

       BSTR GroupID,

       SortType SType) 

Parameters

GroupID

The ID of the group that is to be sorted. If it is set to zero, the root group is sorted. You can obtain the GroupID by one of the following methods:

·          Create the group using IProjectTree80.CreateGroup.

·          Find the group, if you know the name, using IProjectTree80.FindItem.

·          Traverse the Tree using IProjectTree80 methods such as GetNextItem, until you come to the desired GroupID.

SType

An enum that determines the type of sort that is performed on the group.

·          SORT_ALPHABETICALLY_AZ = 0
Ascending alphabetical sort.

·          SORT_ALPHABETICALLY_ZA = 1
Descending alphabetical sort.

·          SORT_BY_TYPE = 2
Sort by TerraExplorer type. The objects are sorted in the following order: Aerial Dynamic Object; Ground Dynamic Object; Route; Location; Text Label; Image Label; Static 3D Model; 2D Polygon; Rectangle; 3D Polygon; 2D Arrow; 3D Arrow; Arc; Ellipse; Circle; Sphere; Cone; Cylinder; Building; Pyramid; Box; Group. Objects of the same type are sorted alphabetically (A>Z).

·          SORT_NO_SORT = 3
No sort used.

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

Cannot use Tree root for this operation

TE_E_INFOTREE_ITEMISGROUP

Item ID is a group so an object cannot be retrieved.