Show contents 

Ms > Ms Assembly Interfaces > IMsModelList > IMsModelList.RebindContents

IMsModelList.RebindContents

Syntax

RebindContents;

Description

The RebindContents method updates models in the collection.

Example

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 with the EXT_MODEL identifier, which calculation method is: linear regression, non-linear regression or determinate equation.

Sub UserProc;
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 an equation to system
    Descript := mb.ItemByIdNamespace("EXT_MODEL", ModelCont.Key);
    ExtModel := Descript.Bind As IMsModel;
    ExternalEquations.Add(ExtModel);
    // Update models in system
    ExternalEquations.RebindContents;
    // Save changes
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the external models contained in the system of non-linear equations are updated.

See also:

IMsModelList