RebindContents;
The RebindContents method updates models in the collection.
Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. This container must include a system of non-linear equations with the NON_LINEAR_MODEL identifier, a model (calculation method: linear regression (OLS estimation), non-linear regression (non-linear OLS estimation) or determinate equation) with the EXT_MODEL identifier.
Sub Main;
Var
mb: IMetabase;
ModelCont: IMetabaseObjectDescriptor;
Model: IMsModel;
Trans: IMsFormulaTransform;
Formula: IMsFormula;
Equations: IMsNonLinearEquationsTransform;
Descript: IMetabaseObjectDescriptor;
ExtModel: IMsModel;
ExternalEquations: IMsModelList;
Begin
mb := MetabaseClass.Active;
ModelCont := mb.ItemById("CONT_MODEL");
Descript := mb.ItemByIdNamespace("NON_LINEAR_MODEL", ModelCont.Key);
Model := Descript.Edit As IMsModel;
Trans := Model.Transform;
Formula := Trans.EquationsFormula;
Equations := Formula.Method As IMsNonLinearEquationsTransform;
ExternalEquations := Equations.ExternalEquations;
// Add the equation to the system
Descript := mb.ItemByIdNamespace("EXT_MODEL", ModelCont.Key);
ExtModel := Descript.Bind As IMsModel;
ExternalEquations.Add(ExtModel);
// Renew the models in the system
ExternalEquations.RebindContents;
// Save the changes
(Model As IMetabaseObject).Save;
End Sub Main;
After executing the example the external models contained in the system of non-linear equations are updated.
See also: