PathName(Depth: Integer): String;
Depth - parameter that determines how many upper levels are included in an element path.
The PathName property returns an element path as a name.
Executing the example requires that the repository contains a time series database with the OBJ_FC identifier.Time series database hierarchy must have more than one level.
Sub Main;
Var
Mb: IMetabase;
RubrObj: IMetabaseObject;
CatInst: IRubricatorInstance;
DictInst: IMetaDictionaryInstance;
HierarchyInst: IMetaHierarchyInstance;
Mems: IMetaMembersSet;
Mem: IMetaMember;
Mems1: IMetaMembersSet;
Mem1: IMetaMember;
Begin
Mb := MetabaseClass.Active;
RubrObj := Mb.ItemById("OBJ_FC").Bind;
CatInst := RubrObj.Open(Null) As IRubricatorInstance;
DictInst := CatInst.GetDictionary(RubricatorDictionary.Facts);
HierarchyInst := DictInst.DefaultHierarchy;
Mems := HierarchyInst.GetRootMembers;
Mem := Mems.Current;
Mems1 := Mem.Children.GetMembers;
If Mems1 <> Null Then
Mem1 := Mems1.Current;
Debug.WriteLine(Path of an element: + Mem1.PathName(1));
End If;
End Sub Main;
After executing the example complete path of the first element of the second level of hierarchy is displayed in the console window.
See also: