AddFolder(FolderName: String): IMsScenarioTreeFolder;
FolderName. Name of the folder that should be added to the scenario tree.
The AddFolder method adds a new folder to the tree of modeling container scenarios.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
ModelSpace: IMsModelSpace;
Tree: IMsScenarioTreeEntries;
Folder: IMsScenarioTreeFolder;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("KONT_MODEL").Edit;
ModelSpace := MObj As IMsModelSpace;
Tree := ModelSpace.ScenarioTree;
Folder := Tree.AddFolder(Folder #1);
Tree.MoveTo(Tree.IndexOf(Folder), 0);
MObj.Save;
End Sub Main;
After executing the example a new folder is created in the tree of modeling container scenarios. This folder is moved to the first position in the list.
See also: