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.
|
|
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:
|
|
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:
|
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.