Starts modeling problem calculation.
None.
The command can be used for modeling problems only.
Executing the example requires that the repository contains a modeling container with the CONT identifier containing a modeling problem with the PROBLEM identifier. Create a form and place a button with the Button1 identifier on the form. Add links to the Metabase and Ui system assemblies.
The example is a handler of the OnClick event for Button1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
msKey: Integer;
problObj: IMetabaseObjectDescriptor;
Target: IUiCommandTarget;
Begin
MB := MetabaseClass.Active;
msKey := mb.GetObjectKeyById("CONT");
problObj := mb.ItemByIdNamespace("PROBLEM", msKey);
Target := WinApplication.Instance.GetObjectTarget(problObj);
Target.Execute("Problem.Run", Null);
End Sub Button1OnClick;
Modeling problem calculation starts by clicking the button.
Executing the example requires that the repository contains a modeling container with the CONT identifier containing a modeling problem with the PROBLEM identifier. Create a .NET form and place a button with the Button1 identifier on the form.
The example is a handler of the Click event for button1.
Imports Prognoz.Platform.Interop.Ui;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
msKey: uinteger;
problObj: IMetabaseObjectDescriptor;
Wa: WinApplicationClassClass;
Target: IUiCommandTarget;
Begin
MB := Self.Metabase;
msKey := mb.GetObjectKeyById("CONT");
problObj := mb.ItemByIdNamespace["PROBLEM", msKey];
Wa := New WinApplicationClassClass();
Target := Wa.Instance[Null].GetObjectTarget(problObj);
Target.Execute("Problem.Run", Null, Null);
End Sub;
Modeling problem calculation starts by clicking the button.
See also: