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

SetActivationCode

Determines the default activation action executed when clicking on the locked group symbol.

 

JavaScript

 

SetActivationCode(

      GroupID,

      ACode,

      ActivationParam)

 

C#

 

void SetActivationCode(

      int GroupID,

      ActionCode ACode,

      int ActivationParam = -1)

 

C++

 

HRESULT SetActivationCode(

    LONG_PTR GroupID,

    ActionCode ACode,

    long ActivationParam) 

Parameters

GroupID

The ID of the group whose activation action is being set. 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.

ACode

An enum that instructs the plane on how to approach and focus in on the group. The following are the possible values:

§  AC_FLYTO = 0,

§  AC_CIRCLEPATTERN = 1,

§  AC_OVALPATTERN = 2,

§  AC_LINEPATTERN = 3,

§  AC_ARCPATTERN = 4,

§  AC_FOLLOWBEHIND = 5,

§  AC_FOLLOWABOVE = 6,

§  AC_FOLLOWBELOW = 7,

§  AC_FOLLOWRIGHT = 8,

§  AC_FOLLOWLEFT = 9,

§  AC_FOLLOWBEHINDANDABOVE = 10,

§  AC_FOLLOWCOCKPIT = 11,

§  AC_FOLLOWFROMGROUND = 12,

§  AC_JUMP = 14,

ActivationParam

When ACode is set to AC_SHOW, the ActivationParam can be one of the following values:

·         0 – The item is set to hide.

·         1 – The item is set to show.

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.