IMetaMemberChildren.GetTree

Syntax

GetTree: IMetaMembersTree;

Description

The GetTree property returns hierarchy element children as a tree.

Example

Executing the example requires that the repository contains a time series database with the OBJ_FC identifier.

Sub Main;

Var

Mb: Imetabase;

Rubr: IMetabaseObject;

RubrInst: IRubricatorInstance;

Facts: IMetaDictionaryInstance;

Hierarchy: IMetaHierarchy;

HInstance: IMetaHierarchyInstance;

Mem: IMetaMember;

MemCh: IMetaMemberChildren;

Tree: IMetaMembersTree;

Begin

Mb := MetabaseClass.Active;

Rubr := MB.ItemById("OBJ_FC").Bind;

RubrInst := Rubr.Open(Null) As IRubricatorInstance;

Facts := RubrInst.GetDictionary(RubricatorDictionary.Facts);

Hierarchy := Facts.Dictionary.DefaultHierarchy;

HInstance := Facts.OpenHierarchy(Hierarchy);

Mem := HInstance.Root;

MemCh := Mem.Children;

If Not MemCh.IsEmpty Then

Tree := MemCh.GetTree;

Tree.Reset;

While Not Tree.Eof Do

If Tree.CurrentPosition.LevelIndex = 0 Then

Debug.WriteLine(Tree.Current.Name);

End If;

Tree.Next;

End While;

End If;

End Sub Main;

After executing the example, names of child elements for factors hierarchy node are displayed in the console window.

See also:

IMetaMemberChildren