EditTemporary: IMetabaseObject;
The EditTemporary method opens the object for temporary change of properties.
The object cannot be used in this mode. The "Object is not in the state of editing" error is generated during the saving.
Executing the example requires a form, a button named Button1 on the form, the ModelBox component and the UiModel component named UiModel1 that is a data source for ModelBox. The repository contains a modeling container with the CONT_MODEL identifier and a model created in it with the MODEL identifier.
Add links to the Metabase, Ms system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
ContKey: Integer;
Model: IMsModel;
Begin
MB := MetabaseClass.Active;
ContKey := MB.ItemById("CONT_MODEL").Key;
Model := MB.ItemByIdNamespace("MODEL", ContKey).EditTemporary As IMsModel;
UiModel1.Active := False;
UiModel1.Model := Model;
UiModel1.Active := True;
End Sub Button1OnClick;
After executing the example the specified model opens in the ModelBox component from the modeling container. Model parameters can be edited but they cannot be saved.
See also: