IMsCalculationModelTreeNode.Model

Syntax

Model: IMsModel;

Description

The Model property returns the model, for which the breakpoint is set.

Example

Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier containing a modeling problem with the PROBLEM identifier.

Add links to the Metabase and Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    ModelSpaceDescr: IMetabaseObjectDescriptor;
    Problem: IMsProblem;
    CalcSettings: IMsProblemCalculationSettings;
    Calculation: IMsProblemCalculation;
    CalculationTree: IMsCalculationTree;
    CalcChildren: IMsCalculationTreeNodes;
    i: Integer;
    Item: IMsCalculationTreeNode;
    ModelTreeNode: IMsCalculationModelTreeNode;
Begin
    mb := MetabaseClass.Active;
    ModelSpaceDescr := Mb.ItemById("MODEL_SPACE");
    Problem := Mb.ItemByIdNamespace("PROBLEM", ModelSpaceDescr.Key).Bind As IMsProblem;
    CalcSettings := Problem.CreateCalculationSettings;
    CalcSettings.FactIncluded := True;
    Calculation := Problem.Calculate(CalcSettings);
    CalculationTree := Calculation.CalculationTree;
    CalcChildren := CalculationTree.Children;
    For i := 0 To CalcChildren.Count - 1 Do
        Item := CalcChildren.Item(i);
        If Item.Kind = MsCalculationTreeNodeKind.Model Then
            ModelTreeNode := Item As IMsCalculationModelTreeNode;
            Debug.WriteLine("Breakpoint ");
            Debug.WriteLine("  - key: " + ModelTreeNode.Key.ToString);
            Debug.WriteLine("  - scenario key: " + ModelTreeNode.Scenario.ToString);
            Debug.WriteLine("  - is present the parent: " + (ModelTreeNode.Parent <> Null).ToString);
            Debug.WriteLine("  - model: " + (ModelTreeNode.Model As IMetabaseObject).Name);
        End If;
    End For;
End Sub UserProc;

After executing the example the console window displays information about the breakpoints if they are present in the problem.

See also:

IMsCalculationModelTreeNode