ModelSpace: IMsModelSpace;
The ModelSpace property determines the modeling container that contains the modeling variables, for which descriptive statistics are calculated.
Executing the example requires a form, a button named Button1 on the form, and the DescStatsBox component named DescStatsBox1. The repository contains a modeling container with the CONT_MODEL identifier that includes modeling variables with the X1 and X2 identifiers.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
MS, Var1, Var2: IMetabaseObject;
Begin
MB := MetabaseClass.Active;
MS := MB.ItemById("CONT_MODEL").Bind;
Var1 := MB.ItemByIdNamespace("X1", MS.Key).Bind;
Var2 := MB.ItemByIdNamespace("X2", MS.Key).Bind;
DescStatsBox1.ModelSpace := MS As IMsModelSpace;
DescStatsBox1.AddVariableStub(Var1 As IVariableStub);
DescStatsBox1.AddVariableStub(Var2 As IVariableStub);
End Sub Button1OnClick;
On clicking the button the DescStatsBox1 component is connected to the modeling container named CONT_MODEL. The modeling variables X1 and X2 are loaded to the list of component variables. Descriptive statistics are automatically calculated for these variables.
Executing the example requires a .NET form, a button named Button1 on the form, and the DescStatsBoxNet component named DescStatsBoxNet1. The repository contains a modeling container with the CONT_MODEL identifier that includes modeling variables with the X1 and X2 identifiers.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Ms;
//...
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
MS, Var1, Var2: IMetabaseObject;
Begin
MB := Self.Metabase;
MS := MB.ItemById["CONT_MODEL"].Bind();
Var1 := MB.ItemByIdNamespace["X1", MS.Key].Bind();
Var2 := MB.ItemByIdNamespace["X2", MS.Key].Bind();
DescStatsBoxNet1.ModelSpace := MS As IMsModelSpace;
DescStatsBoxNet1.CtrlBox.AddVariableStub(Var1 As IVariableStub);
DescStatsBoxNet1.CtrlBox.AddVariableStub(Var2 As IVariableStub);
End Sub;
On clicking the button the DescStatsBoxNet1 component is connected to the modeling container named CONT_MODEL. The modeling variables X1 and X2 are loaded to the list of component variables. Descriptive statistics are automatically calculated for these variables.
See also: