EmbedMultipleContents()
- Last UpdatedNov 10, 2025
- 5 minute read
Dynamically embeds a collection of 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: EmbedMultipleContents() is supported only in the OMI desktop client. This function is not supported in the OMI web client.
Category
Graphic Client
Syntax
To embed several Industrial Graphic within another graphic:
Dim graphicCollection as aaGraphic.GraphicCollection;
graphicCollection = new aaGraphic.GraphicCollection;
Dim graphicInfo1 as aaGraphic.GraphicInfo;
graphicInfo1.Identity = "<Identity>";
graphicInfo1.GraphicName ="<SymbolName>";
Dim graphicInfo2 as aaGraphic.GraphicInfo;
graphicInfo2.Identity = "<Identity>";
graphicInfo2.GraphicName = "<SymbolName>";
graphicCollection.Add(graphicInfo1);
graphicCollection.Add(graphicInfo2);
EmbedMultipleContents( graphicCollection );
Parameter
GraphicCollection
aaGraphic.GraphicCollection Properties
EmbedMultipleContents() allows you to embed several graphics without having to create loops in your script. The EmbedMultipleContents() function supports the same subset of aaGraphic.GraphicInfo properties as the EmbedContent() function. 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. Multiple Identity properties can be defined within the GraphicCollection parameter. Each 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 an Identity name, a warning message is displayed. If the EmbedMultipleContents call is made with a different identity, the embedded symbol is replaced by matching the identity in the call. The same Identity is used for the RemoveContent() script function. Example: graphicInfo1.Identity = "i1"; graphicInfo2.Identity = "i2"; |
|
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 EmbedMultipleContents() script function. It is the owning object of the graphic shown by the EmbedMultipleContents 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: graphicCollection.OwningObject = "UserDefined_001"; |
|
X |
X specifies the horizontal position of the embedded content. 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 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 GraphicCollection properties
|
Property Name |
Required (y/n) |
Data Type |
Default Value |
|---|---|---|---|
|
Identity |
Yes |
String |
None |
|
SymbolName |
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 property that has a default value in GraphicCollection is optional. If no input value specified for these parameters, the default values are used at run time. Any property 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 EmbedMultipleContents
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 custom properties CP, CP1, CP2, and CP3.