Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Application Server

EmbedContent()

  • Last UpdatedNov 10, 2025
  • 5 minute read

Dynamically embeds Industrial Graphics inside another Industrial Graphic at the top of the Z-order for use in an OMI ViewApp at run time. This function is available within any Industrial Graphics client script.

Note: In System Platform 2023 R2, EmbedContent() is supported only in the OMI desktop client. This function is not supported in the OMI web client.

Category

Graphic Client

Syntax

To embed an Industrial Graphic within another graphic:

Dim graphicInfo as aaGraphic.GraphicInfo;

Dim cpValues [2] as aaGraphic.CustomPropertyValuePair;

cpValues[1] = new aaGraphic.CustomPropertyValuePair("CP1", 20, true);

cpValues[2] = new aaGraphic.CustomPropertyValuePair("CP2", Pump.PV.TagName, true);

graphicInfo.Identity = "123";

graphicInfo.GraphicName = "Pump_001.Symbol_001";

graphicInfo. CustomProperties = cpValues;

EmbedContent(graphicInfo);

Parameter

GraphicInfo

aaGraphic.GraphicInfo properties

The EmbedContent() function supports a subset of aaGraphic.GraphicInfo properties. The supported properties are as follows:

Identity

The Identity property is a unique name to identify embedded content. It is unique across the entire OMI application at runtime.

The Identity name cannot contain more than 329 characters and must contain at least one letter. Valid characters are alphanumeric and special characters ($, #, _).

This is a required property of data type string.

  • If you do not specify the Identity name, a warning message is logged in the Logger, and the EmbedContent call fails.

  • If the EmbedContent call is first made with one Identity and then a a second call is made with a different Identity but the same GraphicName, the same symbol is embedded with a new identity.

  • If EmbedContent is called again with the same Identity, it replaces the existing embedded content that used the Identity in the previous call.

    The same Identity is used for the RemoveContent() script function.

    Example:

    graphicInfo.Identity = "i1";

GraphicName

GraphicName is the name of the graphic to show.

GraphicName cannot contain more than 329 characters and must contain at least one letter. Valid characters are alphanumeric and special characters ($, #, _).

This is a required property of data type string.

Default value: none

Browse using the Galaxy Browser, or directly type the graphic name. The GraphicName can come from:

  • Visualization folder, for example:
    "Symbol_001"

  • Instances, absolute or hierarchical, for example:
    "Userdefined_001.Symbol1", "Userdefined_001.Pump_001.S1"

  • Relative reference, for example:
    "Me.Symbol_001"

    Use an absolute name to specify the graphic name and owning object if you are using an Object Wizard with Symbol Wizard custom property selections. This allows the correct graphic configuration to be shown for the instance. See OwningObject, below, for more information.

    If you type any invalid character or exceed the character limit, the system shows a warning message at run time. There is no validation at design time.

    The graphic name can be a concatenation of constant strings and reference strings. For example:

    "Pump_001" + ".Graphic_001";
    cp1 + ".Graphic_001"
    where the value of cp1 = "Pump_001"

    – or

    Obj1.Str1 + ".Symbol_001"

    where the value of Obj.Str1 = "Pump_001".

    Examples:

    Visualization Folder reference

    graphicInfo.GraphicName = "S1";

    Absolute Reference

    graphicInfo.GraphicName = "OwningObjectName.SymbolName";

OwningObject

The name of the owning object of the graphic shown by the EmbedContent() script function.

It is the owning object of the graphic shown by the EmbedContent script function. It can be a concatenation of constant strings and reference strings. OwningObject can be browsed by the Galaxy Browser or or you can type the name of the object. The browser mode can be Tag name or Hierarchical Name. If selected from the Browser, double quotes are added to the selected automation object name.

This is is an optional property of data type string.

Default value: empty

Example:

graphicInfo.OwningObject = "UserDefined_001";

X

X specifies the horizontal position of the embedded content. This value is relative to the symbol in which the EmbeddedContent() function is called.

This is an optional property of data type integer.

Default Value: 0

Valid Range: -2,147,483,648 through 2,147,483,647

If X is beyond the integer range, an overflow message appears in the Logger at run time.

Example:

graphicInfo.X = 100;

Y

Y specifies the vertical position of the embedded content. This value is relative to the symbol in which the EmbeddedContent() function is called.

This is an optional property of data type integer.

Default Value: 0

Valid Range: -2,147,483,648 through 2,147,483,647

If Y is beyond integer range, a proper overflow message will appear in the Logger at run time.

Example:

graphicInfo.Y = 100;

Width

Width specifies the width of the embedded symbol. Default value is the actual value coming from symbol design-time. The valid range is from 0 to 10000. If Width is less than 0 or greater than 10000, an “Out of range” warning is logged at runtime. No validation is done at design time.

This is an optional property of data type integer.

Default Value: 100

Valid Range: 0–10000

Both Width and Height must be specified in order to take effect. If only the height or width parameter is provided, the provided value is ignored and instead, the values are taken from the symbol as designed.

Example:

graphicInfo.width = 500;

Height

Height specifies the height of the embedded graphic. Default value is the actual value coming from graphic design-time. The valid range is from 0 to 10000. If Height is less than 0 or greater than 10000, an “Out of range” warning is logged at runtime. No validation is done at design time.

This is an optional property of data type integer.

Default Value: 100

Valid Range: 0–10000

Both Width and Height must be specified in order to take effect. If only the height or width parameter is provided, the provided value is ignored and instead, the values are taken from the symbol as designed.

Example:

graphicInfo.height = 350;

CustomProperties

CustomProperties is a ValuePair[] array that is used to override the custom properties of the graphic being shown.

This is an optional property of data type ValuePair[].

The first three parameters are:

  • Custom property name

  • value

  • IsConstant

    The collection of custom property name, value, and IsConstant sets custom properties in the symbol being shown. Both the custom property and the value could be constant string, reference or concatenation of strings.

    The first three parameters are custom property name, value, and IsConstant.

    Both custom property and the value can be a constant string, reference, or concatenation of strings.

    If the parameter IsConstant = True, the value is treated as a constant. Otherwise, the value is treated as a reference.

    The array index starts at 1.

    Example:

    Dim cpValues [4] as aaGraphic.CustomPropertyValuePair;

    cpValues[1] = new aaGraphic.CustomPropertyValuePair("CP1", 20, true);

    cpValues[2] = new aaGraphic.CustomPropertyValuePair("CP2", Pump.PV.TagName, true);

    cpValues[3] = new aaGraphic.CustomPropertyValuePair("CP3", "CP"+var1, CP2 + "001" + ".Speed", true);

    cpValues[4] = new aaGraphic.CustomPropertyValuePair("CP3", "<HMIName>:Tag1", false);

    graphicInfo.CustomProperties = cpValues;

Summary of supported GraphicInfo properties

Property Name

Required (y/n)

Data Type

Default Value

Identity

Yes

String

None

GraphicName

Yes

String

None

OwningObject

No

String

Empty

X

No

Integer

0

Y

No

Integer

0

Width

No

Integer

100

Height

No

Integer

100

CustomProperties

No

ValuePair[] array

Empty

Remarks

  • Any parameter that has a default value in the GraphicInfo is optional. If no input value specified for these parameters, the default values are used at run time. Any parameter except the Enum data type can be a constant, reference, or expression.

  • String properties can be a concatenation of strings and/or custom properties. Detailed information about these properties is listed below.

  • For more information, see "Working with the Show/Hide Graphics Script Functions" in the Industrial Graphic Editor User Guide.

Example for EmbedContent

Dim graphicInfo as aaGraphic.GraphicInfo;

Dim cpValues[4] as aaGraphic.CustomPropertyValuePair;

cpValues[1] = new aaGraphic.CustomPropertyValuePair("CP1", 20, true);

cpValues[2] = new aaGraphic.CustomPropertyValuePair("CP2", "Pump.PV.TagName", true);

cpValues[3] = new aaGraphic.CustomPropertyValuePair("CP"+var1, CP2+"001" + ".Speed", true);

cpValues[4] = new aaGraphic.CustomPropertyVlauePair(CP3", InTouch:Tag1",false);

graphicInfo.Identity = "123";

graphicInfo.GraphicName = "Pump_001.Symbol_001";

graphicInfo.CustomProperties = cpValues;

graphicInfo.OwningObject = "UserDefined_001";

EmbedContent( graphicInfo );

Where "123" is string Identity and the graphic "Pump_001.Symbol_001" contains four custom properties: CP, CP1, CP2, and CP3.

See Also

EmbedMultipleContents()

ShowGraphic()

HideContent()

In This Topic
TitleResults for “How to create a CRG?”Also Available in