Execute(Calculation: IMsModelCalculation; ScenarioKey: Integer; [Options: Integer = 0]);
Calculation. Model calculation parameters.
ScenarioKey. Scenario key, based on which the model must be calculated.
Options. Additional model calculation options. Optional parameter, default value is 0.
The Execute method executes the model.
Executing the example requires that the repository contains a modeling container with the OBJ_TRANSFORM identifier. This container includes a model with the OBJ_MODEL identifier.
Sub UserProc;
Var
ActiveMetabase: IMetabase;
ModelCont: IMetabaseObjectDescriptor;
Descript: IMetabaseObjectDescriptor;
Obj: IMetabaseObject;
Model: IMsModel;
Calcul: IMsModelCalculation;
Per: IMsModelPeriod;
Begin
ActiveMetabase := MetabaseClass.Active;
ModelCont := ActiveMetabase.ItemById("OBJ_TRANSFORM");
Descript := ActiveMetabase.ItemByIdNamespace("OBJ_MODEL", ModelCont.Key);
Obj := Descript.Bind;
Model := Obj As IMsModel;
Calcul := Model.CreateCalculation;
Per := Calcul.Period;
Per.IdentificationStartDate := DateTime.ComposeDay(2000, 1, 1);
Per.IdentificationEndDate := DateTime.ComposeDay(2004, 1, 1);
Per.ForecastStartDate := DateTime.ComposeDay(2005, 1, 1);
Per.ForecastEndDate := DateTime.ComposeDay(2007, 1, 1);
Calcul.CurrentPoint := DateTime.ComposeDay(2005, 1, 1);
Model.Execute(Calcul, -1);
End Sub UserProc;
After executing the example the OBJ_MODEL model is calculated.
See also: