IMsDisplaySettings.DisplayAttributes

Fore Syntax

DisplayAttributes: IMsDisplayAttributeSettingsList;

Fore.NET Syntax

DisplayAttributes: Prognoz.Platform.Interop.Ms.IMsDisplayAttributeSettingsList;

Description

The DisplayAttributes property returns collection of attribute display settings in string view of expression elements.

Comments

String view of expression elements is used, for example, on displaying factor and expression names for determinate equation calculation.

Fore Example

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

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

Sub UserProc;
Var
    mb: IMetabase;
    MSKey: Integer;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Sett: IMsDisplaySettings;
    AttributeSett: IMsDisplayAttributeSettingsList;
    OutVar: IMsFormulaTransformVariable;
    SelSet: IDimSelectionSet;
    Dim: IDimensionModel;
    Attr: IMsDisplayAttributeSettings;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get modelling container key
    MSKey := mb.GetObjectKeyById("MS");
    // Get the model
    Model := mb.ItemByIdNamespace("MODEL_DISPLAY", MSKey).Edit As IMsModel;
    // Get model parameters
    Transform := Model.Transform;
    // Get model display parameters
    Sett := Transform.DisplaySettings;
    // Set parent element display mode for expression element
    Sett.DisplayParentAs := MsDisplayParent.Id;
    // Get collection of settings of attributes displayed in string view of expression element
    AttributeSett := Sett.DisplayAttributes;
    // Clear collection
    AttributeSett.Clear;
    // Get output variable
    OutVar := Transform.Outputs.Item(0);
    // Get selection of output variable dimensions
    SelSet := OutVar.Slices.Item(0).Selection;
    // Get the first dimension of output variable
    Dim := SelSet.Item(0).Dimension.Dimension;
    // Add  a setting based on obtained dimension
    Attr := AttributeSett.Add(Dim);
    // Specify that expression element displays value of the KEY attribute
    Attr.AttributeId := "KEY";
    // Output dimension name to console window
    Debug.WriteLine((Attr.Dimension As IMetabaseObject).Name);
    // Save changes
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example parent element identifier and first dimension key are displayed for expression factors and elements in the model equation.

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;
    MSKey: uinteger;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Sett: IMsDisplaySettings;
    AttributeSett: IMsDisplayAttributeSettingsList;
    OutVar: IMsFormulaTransformVariable;
    SelSet: IDimSelectionSet;
    Dim: IDimensionModel;
    Attr: IMsDisplayAttributeSettings;
Begin
    // Get current repository
    mb := Params.Metabase;
    // Get modelling container key
    MSKey := mb.GetObjectKeyById("MS");
    // Get the model
    Model := mb.ItemByIdNamespace["MODEL_DISPLAY", MSKey].Edit() As IMsModel;
    // Get model parameters
    Transform := Model.Transform;
    // Get model display parameters
    Sett := Transform.DisplaySettings;
    // Set parent element display mode for expression element
    Sett.DisplayParentAs := MsDisplayParent.mdpId;
    // Get collection of settings of attributes displayed in string view of expression element
    AttributeSett := Sett.DisplayAttributes;
    // Clear collection
    AttributeSett.Clear();
    // Get output variable
    OutVar := Transform.Outputs.Item[0];
    // Get selection of output variable dimensions
    SelSet := OutVar.Slices.Item[0].Selection;
    // Get the first dimension of output variable
    Dim := SelSet.Item[0].Dimension.Dimension;
    // Add  a setting based on obtained dimension
    Attr := AttributeSett.Add(Dim);
    // Specify that expression element displays value of the KEY attribute
    Attr.AttributeId := "KEY";
    // Output dimension name to console window
    System.Diagnostics.Debug.WriteLine((Attr.Dimension As IMetabaseObject).Name);
    // Save changes
    (Model As IMetabaseObject).Save();
End Sub;

See also:

IMsDisplayAttributeSettings