MoveToParent(Parent: IMsCalculationChainEntries; Index: Integer);
Parent. The parent collection of elements where the element should be placed.
Index.Position, to which the element should be moved.
The MoveToParent method moves metamodel calculation chain element.
Executing the example requires that the repository contains a modeling container with the OBJ_CONT identifier. This container must include a metamodel with the OBJ_META identifier.
Add links to the Metabase and Ms system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
ContKey: Integer;
MModel: IMsMetaModel;
Parent: IMsCalculationChainEntries;
ChainEntry: IMsCalculationChainEntry;
Begin
Mb := MetabaseClass.Active;
ContKey := Mb.GetObjectKeyById("OBJ_CONT");
MModel := Mb.ItemByIdNamespace("OBJ_META",ContKey).Edit As IMsMetaModel;
Parent := MModel.CalculationChain;
ChainEntry := Parent.Item(Parent.Count- 1);
ChainEntry.MoveToParent(Parent,0);
(MModel As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the last element in metamodel calculation chain is moved to initial position.
See also: