AddScenario(Scenario: IMsScenario);
Scenario. Modeling container scenario.
The AddScenario method adds a modeling container scenario to the collection of problem scenarios.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
KMSpace: IMsModelSpace;
KmScens: IMsScenarios;
Problem: IMsProblem;
ProbScen: IMsProblemScenarios;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("PROBLEM_1", MB.ItemById("KONT_MODEL").Key).Edit;
KMSpace := MB.ItemById("KONT_MODEL").Bind As IMsModelSpace;
KmScens := KMSpace.Scenarios;
Problem := MObj As IMsProblem;
ProbScen := Problem.Scenarios;
ProbScen.AddScenario(KmScens.Item(KmScens.Count - 1));
MObj.Save;
End Sub Main;
After executing the example the last scenario of modeling container is added to the list of scenarios of the problem with the PROBLEM_1 identifier.
See also: