IModelBox.SaveObject

Syntax

SaveObject: Boolean;

Description

The SaveObject method saves changes made to the parameters of the model displayed in the component. To change the parameters, that are displayed in component, it is necessary to reopen the model.

Example

Executing the example requires a form, a button named Button1 on this form, the ModelBox component named ModelBox1, and the UiModel component that is the data source for ModelBox1. The model, which parameters are displayed in ModelBox1, uses the ARIMA method to calculate.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Trans: IMsFormulaTransform;

VarTrans: IMsFormulaTransformVariable;

Tree: IMsFormulaTransformSlicesTree;

Slice: IMsFormulaTransformSlice;

Selector: IMsFormulaTransformSelector;

Formula: IMsFormula;

Arima: IMsArimaTransform;

Begin

Trans := ModelBox1.Transform;

VarTrans := Trans.Outputs.Item(0);

Tree := VarTrans.SlicesTree(VarTrans);

Slice := Tree.CreateSlice(1);

Selector := Trans.CreateSelector;

Selector.Slice := Slice;

Formula := Trans.Transform(Selector);

ARIMA := Formula.Method As IMsArimaTransform;

ARIMA.MaxIteration := 300;

ModelBox1.SaveObject;

End Sub Button1OnClick;

After executing the example, the number of iterations, over which optimal model solution is searched, is changed. This change is saved to the model in modeling container.

See also:

IModelBox