Assign(TermInfo: IMsFormulaTermInfo);
TermInfo. Term parameters that should be set for this term.
The Assign method sets parameters of the current term in accordance with parameters of a specified term.
When this method is called, all term properties are set, except for IMsFormulaTermInfo.Slice.
Executing the example requires that the repository contains a modeling container with the KONT_MODEL identifier. This container contains a modeling problem with the NEW_NONLINREG identifier that uses the non-linear regression method for calculation. The container also contains a the VAR_FACTOR1 modeling variable that is added to the model.
Add links to the Cubes, Metabase, Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Kont: IMetabaseObjectDescriptor;
MObj: IMetabaseObject;
Model: IMsModel;
Trans: IMsFormulaTransform;
Varr: IVariableStub;
TransVar: IMsFormulaTransformVariable;
Slice: IMsFormulaTransformSlice;
NonLinear: IMsNonLinearRegressionTransform;
Oper: IMsFormulaTermList;
Term: IMsFormulaTerm;
Info: IMsFormulaTermInfo;
Begin
MB := MetabaseClass.Active;
Kont := MB.ItemById("KONT_MODEL");
MObj := MB.ItemByIdNamespace("New_NonLinReg",Kont.Key).Edit;
Model := MObj As IMsModel;
Trans := Model.Transform;
Varr := MB.ItemByIdNamespace("Var_Factor1",Kont.Key).Bind As IVariableStub;
TransVar := Trans.Inputs.Add(Varr);
Slice := TransVar.SlicesTree(TransVar).CreateSlice(1);
NonLinear := Trans.FormulaItem(0).Method As IMsNonLinearRegressionTransform;
Oper := NonLinear.Operands;
Term := Oper.Add(Slice);
Info := Term.TermInfo;
Info.Assign(Oper.Item(0).TermInfo);
Term.TermInfo := Info;
NonLinear.Expression.AsString := NonLinear.Expression.AsString + "*" + Info.TermInnerText;
MObj.Save;
End Sub UserProc;
After executing the example the VAR_FACTOR1 variable is added to the model. Parameters of the term, that corresponds to a slice of the given variable, are set up according to parameters of the first term, that exists in the list. The new term is also added to the model equation.
See also: