IMsCalculationChainVariable.Slice

Syntax

Slice: IMsFormulaTransformSlice;

Description

The Slice property determines the variable slice.

Comments

To get whether the variable is internal for the calculation chain, use the IMsCalculationChainVariable.IsInternal property.

Example

Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier containing a modeling problem with the WEB_PROBLEM identifier. The task must contain the internal metamodel.

Add links to the Metabase and Ms system assemblies.

Sub ChainEntry;
Var
    mb: IMetabase;
    msKey: Integer;
    Problem: IMsProblem;
    Meta: IMsMetaModel;
    MetaVisual: IMsMetaModelVisualController;
    ChainEnts: IMsCalculationChainEntries;
    i: Integer;
    ChainEl: IMsCalculationChainEntry;
    ChainVar: IMsCalculationChainVariable;
Begin
    mb := MetabaseClass.Active;
    // Get modelling container key
    msKey := mb.GetObjectKeyById("MODEL_SPACE");
    // Getnbsp;modelingnbsp;problem
    Problem := mb.ItemByIdNamespace("WEB_PROBLEM", msKey).Bind As IMsProblem;
    // Get metamodel
    Meta := Problem.MetaModel;
    MetaVisual := Meta.VisualController;
    // Get metamodel calculation chain
    ChainEnts := Meta.CalculationChain;
    For i := 0 To ChainEnts.Count - 1 Do
        ChainEl := ChainEnts.Item(i);
        // Display information only about variables
        If ChainEl.Type = MsCalculationChainEntryType.Variable Then
            ChainVar := ChainEl As IMsCalculationChainVariable;
            Debug.WriteLine("Name: " + ChainVar.Slice.Name);
            Debug.WriteLine("Internal variable: " + ChainVar.IsInternal.ToString);
            Debug.WriteLine("");
        End If;
    End For;
End Sub ChainEntry;

After executing the example the console window displays information about variables contained in the metamodel calculation chain.

See also:

IMsCalculationChainVariable