Executing the example requires the file c:\map_1.tbs containing a map topobase.
Sub NewTopobase;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
Top: ITopobase;
Begin
MB := MetabaseClass.Active;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_TOPOBASE;
CrInfo.Id := "New_Map_1";
CrInfo.Name := "New map";
CrInfo.Parent := MB.Root;
Top := MB.CreateObject(CrInfo).Edit As ITopobase;
Top.LoadFromFile("C:\map_1.tbs");
(Top As IMetabaseObject).Save;
End Sub NewTopobase;
After executing the example a new map is created in root directory of the repository. Map topobase will be loaded from the specified file.
See also: