IPCABox.AddVariableStub

Syntax

AddVariableStub(Stub: IVariableStub);

Parameters

Stub. Variable that is used on calculating the principal component analysis.

Description

The AddVariableStub method adds a variable, that is used on calculating the principal component analysis, into the component.

Example

Executing the example requires a form, a button named Button1 on it, and the PCABox component named PCABox1. The component is connected to the modeling container that contains variables with the X1, X2 and X3 identifiers.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

MB: IMetabase;

MS: IMsModelSpace;

VarObj: IMetabaseObjectDescriptor;

Begin

MB := MetabaseClass.Active;

MS := PCABox1.ModelSpace;

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);

VarObj := MB.ItemByIdNamespace("X3", (MS As IMetabaseObject).Key);

PCABox1.AddVariableStub(VarObj.Bind As IVariableStub);

End Sub Button1OnClick;

After executing the example, pressing the button adds three variables from the modeling container to the list of component variables. The principal component analysis is calculated automatically for variables.

See also:

IPCABox