IMsProblemCalculation.SaveHistory

Syntax

SaveHistory: Boolean;

Description

The SaveHistory property determines whether history of modeling problem calculation should be saved.

Comments

By default the property is set to False, the history of calculation is not saved.

If the SaveHistory property is set to True, IMsproblemCalculation.SaveHistoryMask is set to MsCalculationHistorySet.Full.

The IMsproblemCalculation.SaveHistoryMask property influences the value of this property. If the value IMsproblemCalculation.SaveHistoryMask is set to any type of MsCalculationHistorySet, except for MsCalculationHistorySet.None, SaveHistory is automatically set to True. If IMsproblemCalculation.SaveHistoryMask is set to MsCalculationHistorySet.None,SaveHistory is automatically set to False.

Example

Executing the example requires that the repository contains a modeling container with the KONT_MODEL identifier. This container must include a problem with the PROBLEM_1 identifier.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

Problem: IMsProblem;

CalcSett: IMsProblemCalculationSettings;

Calculation: IMsProblemCalculation;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemByIdNamespace("PROBLEM_1", MB.ItemById("KONT_MODEL").Key).Edit;

Problem := MObj As IMsProblem;

CalcSett := Problem.CreateCalculationSettings;

Calculation := Problem.Calculate(CalcSett);

Calculation.SaveHistory := True;

Calculation.Run;

MObj.Save;

End Sub Main;

After executing the example the problem with the PROBLEM_1 identifier is calculated. The full history of calculation is saved.

See also:

IMsProblemCalculation