IMsModelCalendarBreakpoint.IsCalendarPointFixed

Syntax

IsCalendarPointFixed: Boolean;

Description

The IsCalendarPointFixed property determines whether calendar point is set for the breakpoint.

Comments

Calendar point is determined by value of the IMsModelCalendarBreakpoint.CalendarPoint property. If it is determined, IsCalendarPointFixed returns True. The breakpoint is triggered only for the specified date. To reset the breakpoint, use the IMsModelCalendarBreakpoint.RemoveCalendarPointFix method.

If the calendar point is not determined, IsCalendarPointFixed returns False. The breakpoint is triggered for every calendar point of the calculation.

Example

Executing the example requires that the repository contains a modeling container with the MODEL_SPACE identifier. This container should include a modeling problem with the PROBLEM identifier that calculates the model with the MODEL identifier. The example uses the MCallback class described in IMsproblemCalculationCallback.OnBreak.

Also, before starting the procedure it is necessary to add links to the Metabase, Ms system assemblies.

Sub Main;

Var

Mb: IMetabase;

ModelSpaceDescr: IMetabaseObjectDescriptor;

Problem: IMsProblem;

CalcSettings: IMsProblemCalculationSettings;

CallBack: MCallback;

Calculation: IMsProblemCalculation;

Breakpoints: IMsBreakpoints;

Breakpoint: IMsBreakpoint;

CalendarBreakpoint: IMsModelCalendarBreakpoint;

Model: IMsModel;

Begin

Mb := MetabaseClass.Active;

ModelSpaceDescr := Mb.ItemById("MODEL_SPACE");

Problem := Mb.ItemByIdNamespace("PROBLEM", ModelSpaceDescr.Key).Edit As IMsProblem;

CalcSettings := Problem.CreateCalculationSettings;

CallBack := New MCallback.Create;

CalcSettings.Callback := CallBack;

CalcSettings.FactIncluded := True;

Calculation := Problem.Calculate(CalcSettings);

Breakpoints := Calculation.Breakpoints;

Breakpoints.Clear;

Breakpoint := Breakpoints.Add(MsBreakpointKind.ModelCalendar);

CalendarBreakpoint := Breakpoint As IMsModelCalendarBreakpoint;

CalendarBreakpoint.Name := "CalendarBreakpoint";

Model := Mb.ItemByIdNamespace("MODEL", ModelSpaceDescr.Key).Edit As IMsModel;

CalendarBreakpoint.Model := Model;

If CalendarBreakpoint.IsCalendarPointFixed Then

CalendarBreakpoint.RemoveCalendarPointFix;

End If;

Calculation.Run;

End Sub Main;

After executing the example the breakpoint that is triggered for every calendar point of the calculation is set for the problem.

See also:

IMsModelCalendarBreakpoint