IMsFormula.FreeDimensions

Syntax

FreeDimensions: IMsDimensionFilterList;

Description

The FreeDimensions property returns collection of dimensions, by which multiple selection is enabled.

Comments

This property allows to set multiple selection in the output variable.

NOTE. Multiple selection in the output variable is available only in the determinate equation model.

If a dimension is contained in the FreeDimensions collection, output variable may have multiple selection by this dimension. Thus, calculation is performed in the cycle by all selected elements in the determinate equation.

Note:

Example

Executing the example requires that the repository contains a modeling container with the MS identifier that contains a determinate equation model with the MODEL_FREEDIM identifier.

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

Sub UserProc;
Var
    mb: IMetabase;
    MsKey: Integer;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Formula: IMsFormula;
    FreeDimensions: IMsDimensionFilterList;
    OutputVar: IMsFormulaTransformVariable;
    Slice: IMsFormulaTransformSlice;
    DimSel: IDimSelection;
    Dim: IDimensionModel;
    Filter: IMsDimensionFilter;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get modelling container key
    MsKey := mb.GetObjectKeyById("MS");
    // Get the model
    Model := mb.ItemByIdNamespace("MODEL_FREEDIM", MsKey).Edit As IMsModel;
    // Get model calculation parameters
    Transform := Model.Transform;
    // Get model calculation method
    Formula := Transform.FormulaItem(0);
    // Get list of dimensions, by which multiple selection is enabled
    FreeDimensions := Formula.FreeDimensions;
    // Get output variable
    OutputVar := Transform.Outputs.Item(0);
    // Set multiple selection by the first variable dimension
    Slice := OutputVar.Slices.Item(0);
    DimSel := Slice.Selection.Item(0);
    DimSel.DeselectAll;
    DimSel.SelectElement(1False);
    DimSel.SelectElement(2False);
    // Get this dimension and enable multiple selection in it
    Dim := Slice.ParametrizedDimensions.Item(0).Dimension;
    Filter := FreeDimensions.Add(Dim);
    // Specify that dimension is non-fixed
    Filter.Fixed := False;
    // Save changes
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the model is calculated by multiple selection of the first dimension of output variable.

See also:

IMsFormula