Ms > Examples > Creating a Modeling Container
Executing the example requires that the repository contains a database with the BD identifier.
Add links to the Db, Metabase, and Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Kont: IMsModelSpace;
Begin
MB := MetabaseClass.Active;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_MODELSPACE;
CrInfo.Id := "KONT_MODEL";
CrInfo.Name := "New modeling container";
CrInfo.Parent := MB.Root;
MObj := MB.CreateObject(CrInfo).Edit;
Kont := MObj As IMsModelSpace;
Kont.Database := MB.ItemById("BD").Bind As IDatabase;
Kont.StartDate := DateTime.ComposeDay(2000, 1, 1);
Kont.EndDate := DateTime.AddYears(Kont.StartDate, 10);
MObj.Save;
End Sub UserProc;
After executing the example a modeling container is created in the root directory of repository. Calendar period for the given container is set to 10 years.
See also: