Opening Variable in the Modeling Container

Contents

Description

Requirements

Example

Description

Consider the example of opening the variable in the interface of the modeling container.

Requirements

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.

Example

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:

Examples