DefaultObject: IMetabaseObjectDescriptor;
DefaultObject: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor
The DefaultObject property determines times series database where modeling container data will be stored.
Executing the example requires that the repository contains a time series database with the TSDB identifier.
Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Ms: IMsModelSpace;
Begin
// Get repository
MB := MetabaseClass.Active;
// Set basic properties of modeling container
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_MODELSPACE;
CrInfo.Id := mb.GenerateId("MS");
CrInfo.Name := "Modeling container at attributes";
MObj := MB.CreateObject(CrInfo).Edit;
Ms := MObj As IMsModelSpace;
// Specify time series database for data storing
Ms.Rubricator := MB.ItemById("TSDB");
// Set start and end dates of modeling container
Ms.StartDate := DateTime.Parse("1.1.2000");
Ms.EndDate := DateTime.Parse("1.1.2020");
MObj.Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Ms;
Public Class StartParams
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Ms: IMsModelSpace;
Begin
// Get repository
MB := Params.Metabase;
// Set basic properties of modeling container
CrInfo := MB.CreateCreateInfo();
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_MODELSPACE As Int32;
CrInfo.Id := mb.GenerateId("MS", 0);
CrInfo.Name := "Modeling container at attributes";
MObj := MB.CreateObject(CrInfo).Edit();
Ms := MObj As IMsModelSpace;
// Specify time series database for data storing
Ms.DefaultObject := MB.ItemById["TSDB"];
// Set start and end dates of modeling container
Ms.StartDate := DateTime.Parse("1.1.2000");
Ms.EndDate := DateTime.Parse("1.1.2020");
MObj.Save();
End Sub;
After executing the example, time series database will be determined where modeling container data will be stored.
See also: