ModelSpace: IMsModelSpace;
The ModelSpace property determines the modelling container that includes the modeling variables that are used to calculate the principal component analysis.
Executing the example requires a form, a button with the Button1 identifier on this form, the PCABox component with the PCABox1 identifier. The repository contains a modeling container with the CONT_MODEL identifier that includes modeling variables with the X1 and X2 identifiers.
Sub FormOnShow(Sender: Object; Args: IEventArgs);
Var
MB: IMetabase;
MS, VarObj: IMetabaseObjectDescriptor;
Begin
MB := MetabaseClass.Active;
MS := MB.ItemById("CONT_MODEL");
PCABox1.ModelSpace := MS.Bind As IMsModelSpace;
VarObj := MB.ItemByIdNamespace("X1", (MS As IMetabaseObject).Key);
PCABox1.AddVariableStub(VarObj.Bind As IVariableStub);
VarObj := MB.ItemByIdNamespace("X2", (MS As IMetabaseObject).Key);
PCABox1.AddVariableStub(VarObj.Bind As IVariableStub);
End Sub FormOnShow;
After executing the example, on displaying the form, the PCABox1 component is linked to the CONT_MODEL modeling container. The modeling variables X1 and X2 are loaded to the list of component variables. These variables are used to automatically calculate the principal component analysis.
See also: