IMsCalculationState.Coord

Syntax

Coord: IMsFormulaTransformCoord;

Description

The Coord property returns parameters of coordinate in the variable, by which the current step is calculated.

Example

Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. This container should include a forecasting problem with the OBJ_problem identifier.

Add links to the Metabase and Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    pModelSpace: IMetabaseObjectDescriptor;
    _prob: IMsProblem;
    settings: IMsProblemCalculationSettings;
    _calc: IMsProblemCalculation;
    state: IMsCalculationState;
Begin
    mb := MetabaseClass.Active;
    pModelSpace := mb.ItemById("CONT_MODEL");
    _prob := mb.ItemByIdNamespace("OBJ_PROBLEM",pModelSpace.Key).Bind As IMsProblem;
    settings := _prob.CreateCalculationSettings;
    _calc := _prob.Calculate(settings);
    Repeat
        _calc.StepOver;
        state := _calc.CalculationState;
        Debug.WriteLine(state.Message);
    Until state.Model <> Null;
    Debug.WriteLine("The current calculation point: "+state.CurrentPoint.ToString);
    Debug.WriteLine("Scenario key: "+state.Scenario.ToString);
    Debug.WriteLine("Model: "+(state.Model As IMetabaseObject).Name);
    Debug.WriteLine("Number of additional dimensions of the current variable: "+state.Coord.Count.ToString);
    Debug.WriteLine("=== Abort calculation ===");
    _calc.Stop;
End Sub;

After executing the example the number of additional dimensions of the current variable and other information about modeling problem calculation state is displayed in the console window. For example:

Module execution started

Calculation initialization

The Export (all) variable data loading

The Intermediate data variable data loading

The Summary data variable data loading

The problem calculation for 01.01.1981 by the Base scenario

Current calculation point: 01.01.1981 00:00:00

Scenario key: 7063

Model: Transformation of the source data to intermediate data

The number of additional dimensions of the current variable: 0

=== Aborting calculation ===

Module execution finished

See also:

IMsCalculationState