Add: IMsScenario;
The Add method adds a new scenario.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
KM: IMsModelSpace;
Scenars: IMsScenarios;
Scen: IMetabaseObject;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("KONT_MODEL").Edit;
KM := MObj As IMsModelSpace;
Scenars := KM.Scenarios;
Scen := Scenars.Add As IMetabaseObject;
Scen.Id := "New_scenario";
Scen.Name := New scenario;
Scen.Save;
MObj.Save;
End Sub Main;
After executing the example a new scenario is added to the modeling container with the KONT_MODEL identifier.
See also: