Consider the example of opening the variable in the interface of the modeling container.
Executing the example requires a modeling container with the MS identifier containing a modeling variable with the VARIABLE identifier.
Add links to the Metabase and Ui system assemblies.
Sub OpenVariable;
Var
Mb: IMetabase;
ObjDes: IMetabaseObjectDescriptor;
Target: IUiCommandTarget;
Begin
MB := MetabaseClass.Active;
// Get modeling variable
ObjDes := MB.ItemByIdNamespace("VARIABLE", MB.GetObjectKeyById("MS"));
// Get an object for executing operations with the variable
Target := WinApplication.Instance.GetObjectTarget(ObjDes);
// Open modeling variable for edit
Target.Execute("Object.Edit", Null);
End Sub OpenVariable;
See also: