MoveTo(Attribute: IMetaAttribute; LevelTo: IMetaHierarchyLevel; [IndexTo: Integer = -1);
Attribute - attribute that should be moved.
LevelTo - hierarchy level that the attribute should be moved to.
IndexTo - hierarchy position index that the attribute should be moved to. Optional parameter.
The MoveTo method moves the attribute to the specified level.
Executing the example requires that the repository contains a time series database with the OBJ_FC identifier.
Sub Main;
Var
Mb: Imetabase;
Rubr: IRubricator;
Facts: IMetaDictionary;
Hierarchy: IMetaHierarchy;
HAttributes: IMetaHierarchyAttributes;
Begin
Mb := MetabaseClass.Active;
Rubr := MB.ItemById("OBJ_FC").Bind As IRubricator;
Facts := Rubr.Facts;
Hierarchy := Facts.DefaultHierarchy;
HAttributes := Hierarchy.Attributes;
HAttributes.MoveTo(HAttributes.Item(0), Hierarchy.Levels.Leaf);
End Sub Main;
After executing the example the first attribute is moved to the last level of the hierarchy.
See also: