IMsCalculationChainIterator.ElementGroup

Syntax

ElementGroup: IDimElementGroup;

Description

The ElementGroup property determines the group of elements based on which cycle should be calculated.

Comments

If the value of this property is determined, the IMsCalculationChainIterator.Selection property should not be used.

Example

Executing the example requires that the repository contains a dictionary with the D_SOURCE identifier, DICT_GROUP is the group of elements of this dictionary. A modeling container with the CONT_ITERATOR identifier should also be present. The container must have a metamodel with the META_MODEL identifier.

Add links to the Dimensions, Metabase, Ms system assemblies.

Sub UserProc;
Var
    pMetabase: IMetabase;
    pModelSpace: IMetabaseObjectDescriptor;
    pMetaModel: IMsMetaModel;
    pChain: IMsCalculationChainEntries;
    pCycle: IMsCalculationChainIterator;
    pDim: IMetabaseObjectDescriptor;
    pElement: IDimElementGroup;
    pParam: IMsModelParam;
Begin
    pMetabase := MetabaseClass.Active;
    pModelSpace := pMetabase.ItemById("CONT_ITERATOR");
    pMetaModel := pMetabase.ItemByIdNamespace("META_MODEL",pModelSpace.Key).Edit As IMsMetaModel;
    pChain := pMetaModel.CalculationChain;
    pChain.Clear;
    pMetaModel.Params.Clear;
    pParam := pMetaModel.Params.Add;
    pParam.Id := "PARAM_1";
    pParam.Name := "Param";
    pDim := pMetabase.ItemById("D_SOURCE");
    pParam.LinkedObject := pDim;
    pElement := pMetabase.ItemByIdNamespace("DICT_GROUP",pDim.Key).Bind As IDimElementGroup;
    pCycle := pChain.AddIterator("Cycle");
    pCycle.ElementGroup := pElement;
    pCycle.Parameter := pParam;
    (pMetaModel As IMetabaseObject).Save;
End Sub;

After executing the example the cycle is added to the metamodel calculation cycle. The cycle will be calculated by elements included in the DICT_GROUP group.

See also:

IMsCalculationChainIterator