Breakpoint: IMsBreakpoint;
The Breakpoint property returns a breakpoint.
The property returns the basic interface for work with the breakpoint. To work with different types of breakpoints parameters, cast the IMsBreakpoint to the IMsModelCalendarBreakpoint or the IMsDataBreakpoint interface.
Executing the example requires a form, a button with the Button1 identifier on it and the TreeList component with the TreeList1 identifier. The repository should include a modeling container with the MODEL_SPACE identifier that contains a modeling problem with the PROBLEM identifier. Also, before executing the problem, it is necessary to add links to the Metabase, Ms system assemblies.
Click the button to start executing of this example.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Mb: IMetabase;
ModelSpaceDescr: IMetabaseObjectDescriptor;
Problem: IMsProblem;
CalcSettings: IMsProblemCalculationSettings;
Calculation: IMsProblemCalculation;
CalculationTree: IMsCalculationTree;
CalcChildren: IMsCalculationTreeNodes;
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;
FillCalcList(CalcChildren, Null);
End Sub Button1OnClick;
Sub FillCalcList(Items: IMsCalculationTreeNodes; ParentNode: ITreeListNode);
Var
TreeNodes: ITreeListNodes;
i: Integer;
Item: IMsCalculationTreeNode;
ModelKindItem: IMsCalculationModelTreeNode;
TreeNode: ITreeListNode;
Text: String;
Begin
TreeNodes := TreeList1.Nodes;
For i := 0 To Items.Count - 1 Do
Item := Items.Item(i);
Text := Item.Text;
If Item.Kind = MsCalculationTreeNodeKind.Model Then
Text := Text + (The breakpoint is set!);
ModelKindItem := Item As IMsCalculationModelTreeNode;
Debug.WriteLine(Breakpoint: + ModelKindItem.Breakpoint.Name);
Debug.WriteLine(Activated in points: + ModelKindItem.CurrentPoint.ToString);
Debug.WriteLine("----");
End If;
TreeNode := TreeNodes.AddChild(ParentNode, Text);
FillCalcList(Item.Children, TreeNode);
TreeNode.Expand(False);
End For;
End Sub FillCalcList;
After executing the example, a tree of modeling problem calculation is displayed in the TreeList component. Information about the tree elements, that are breakpoints, is displayed in the console window.
See also: