Executing the example requires a modeling container with the Kont_Model identifier.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
ModelSpace: IMsModelSpace;
Tree: IMsScenarioTreeEntries;
Folder: IMsScenarioTreeFolder;
Scen: IMsScenarioTreeElement;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Kont_Model").Edit;
ModelSpace := MObj As IMsModelSpace;
Tree := ModelSpace.ScenarioTree;
Folder := Tree.AddFolder(Additional scenarios);
Scen := Folder.Contents.AddScenario;
Scen.Name := Scenario #1;
MObj.Save;
End Sub Main;
After executing the example the Additional Scenarios folder is created in the scenario tree of the modeling container. One scenario is created in this folder.
See also: