Coord: IMsFormulaTransformCoord;
The Coord property returns parameters of coordinate in the variable by which the current step is calculated.
Executing the example requires a modeling container with the CONT_MODEL identifier. The forecasting problem with the OBJ_problem identifier must be present in this container.
Sub Main;
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("Current calculation point: " + state.CurrentPoint.ToString);
Debug.WriteLine("Scenario key: " + state.script.ToString);
Debug.WriteLine("Model: " + (state.Model As IMetabaseObject).Name);
Debug.WriteLine("The number of additional dimensions of the current variable: " + state.Coord.Count.ToString);
Debug.WriteLine("=== Aborting calculation ===");
_calc.Stop;
End Sub Main;
After executing the example the number of additional dimensions of the current variable and other information about the of the modeling problem calculation, 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: