IMsDimOpenParamValue.Dimension

Fore Syntax

Dimension: IDimensionModel;

Fore.NET Syntax

Dimension: Prognoz.Platform.Interop.Dimension.IDimensionModel;

Description

The Dimension property determines the dimension, for which the value of the parameter is used.

Comments

To get a collection of parameter values, use the IMsDimOpenParamValue.Values property.

Fore Example

Executing the example requires that the repository contains a modeling container with the MS identifier, containing a metamodel with the METAMODEL identifier. This metamodel must contain parameters for opening objects with parametric dimensions.

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

Sub GetParam;
Var
    mb: IMetabase;
    ms: IMetabaseObjectDescriptor;
    MetaModel: IMsMetaModel;
    StParams: IMsDimOpenStubParamValues;
    i, j, k: Integer;
    StVal: IMsDimOpenStubParamValue;
    ParamVals: IMsDimOpenParamValues;
    PVal: IMsDimOpenParamValue;
    Val: IMetabaseObjectParamValue;
Begin
    mb := MetabaseClass.Active;
    // Get metamodel
    ms := mb.ItemById("MS");
    MetaModel := mb.ItemByIdNamespace("METAMODEL", ms.Key).Edit As IMsMetaModel;
    // Get the parameters of the metamodel to open objects with parametric dimensions
    StParams := MetaModel.DimOpenStubParamValues;
    // Display the information about parameters in the console window
    For i := 0 To StParams.Count - 1 Do
        StVal := StParams.Item(i);
        Debug.WriteLine("Parameter #" + (i + 1).ToString);
        Debug.WriteLine("  It is used for objects with the key: " + StVal.StubKey.ToString);
        Debug.WriteLine("  Parameter values:");
        ParamVals := StVal.Values;
        For j := 0 To ParamVals.Count - 1 Do
            PVal := ParamVals.Item(j);
            Debug.WriteLine("    Dictionary which the object dimension is based on: " +
                (PVal.Dimension As IMetabaseObject).Id);
            Debug.WriteLine("    Values of the parameter for this dimension:");
            For k := 0 To PVal.Values.Count - 1 Do
                Val := PVal.Values.Item(k);
                Debug.WriteLine("      " + Val.Value);
            End For;
        End For;
    End For;
End Sub GetParam;

After executing the example the information about model parameters will be displayed in the console window.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ms: IMetabaseObjectDescriptor;
    MetaModel: IMsMetaModel;
    StParams: IMsDimOpenStubParamValues;
    i, j, k: Integer;
    StVal: IMsDimOpenStubParamValue;
    ParamVals: IMsDimOpenParamValues;
    PVal: IMsDimOpenParamValue;
    Val: IMetabaseObjectParamValue;
Begin
    mb := Params.Metabase;
    // Get metamodel
    ms := mb.ItemById["MS"];
    MetaModel := mb.ItemByIdNamespace["METAMODEL", ms.Key].Edit() As IMsMetaModel;
    // Get the parameters of the metamodel to open objects with parametric dimensions
    StParams := MetaModel.DimOpenStubParamValues;
    // Display the information about parameters in the console window
    For i := 0 To StParams.Count - 1 Do
        StVal := StParams.Item[i];
        System.Diagnostics.Debug.WriteLine("Parameter #" + (i + 1).ToString());
        System.Diagnostics.Debug.WriteLine("  Used for object with the key: " + StVal.StubKey.ToString());
        System.Diagnostics.Debug.WriteLine("  Parameter values:");
        ParamVals := StVal.Values;
        For j := 0 To ParamVals.Count - 1 Do
            PVal := ParamVals.Item[j];
            System.Diagnostics.Debug.WriteLine("    Dictionary which the object dimension is based on: " +
                (PVal.Dimension As IMetabaseObject).Id);
            System.Diagnostics.Debug.WriteLine("    Values of the parameter for this dimension:");
            For k := 0 To PVal.Values.Count - 1 Do
                Val := PVal.Values.Item[k];
                System.Diagnostics.Debug.WriteLine("      " + Val.Value);
            End For;
        End For;
    End For;
End Sub;

See also:

IMsDimOpenParamValue