ShowGraphic()
- Last UpdatedAug 21, 2025
- 9 minute read
Shows a graphic within a pop-up window. The ShowGraphic() function has been extended to call InTouch HMI Windows. This function is available within any Industrial Graphics client script.
Note: The ShowGraphic() function should not be used to display a layout. Although it may work in some cases, the results are inconsistent and there not recommended. Instead, use the ShowContent() function.
Category
Graphic Client
Syntax
To show a graphic within a pop-up window:
Dim graphicInfo as aaGraphic.GraphicInfo;
graphicInfo.Identity = "<Identity>";
graphicInfo.GraphicName = "<SymbolName>";
ShowGraphic( graphicInfo );
To call an HMI window
Dim graphicInfo as aaGraphic.GraphicInfo;
graphicInfo0.Identity = "<<HMIName>:WindowName>";
ShowGraphic( graphicInfo );
Parameter
GraphicInfo
Data Type
aaGraphic.GraphicInfo
aaGraphic.GraphicInfo properties
GraphicInfo is a predefined structure that contains the data members described below.
|
Identity |
The Identity property is a unique name that identifies which instance has opened the graphic. Identity 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 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 your HMI/SCADA application browser, such as the Display Galaxy Browser or equivalent in your HMI/SCADA software, or directly type the graphic name. The application name can come from:
|
|
OwningObject |
The name of the owning object of the graphic shown by the ShowGraphic() script function. OwningObject is an optional property. It can be a concatenation of constant strings and reference strings. OwningObject can be browsed using the Display Automation Object Browser, or you can type the name of the owning object. The OwningObject property sets references for the graphic, but is not associated with the GraphicName property if the graphic is part of an Object Wizard. Therefore, if you are scripting a graphic with an owning object, specify the owning object name as part of the GraphicName property, for example: UserDefined_001.Pump_001. This is an optional property of data type string. Default Value: empty Example: graphicInfo.OwningObject = "UserDefined_001"; |
|
HasTitleBar |
HasTitleBar determines if the graphic is shown with a title bar. This is an optional property of data type Boolean. Default value: True Example: graphicInfo.HasTitleBar = false; |
|
WindowTitle |
WindowTitle specifies the title shown in the window title bar. This is an optional property of data type string. Default value: Empty Valid range: Limit of 1024 characters. WindowTitle can be a constant string, a reference, or an expression. If you change the owning object for an AutomationObject graphic, WindowTitle is updated accordingly. If WindowTitle is empty, the value of the Identity property is shown on the title bar. Example: This is an optional property of data type Boolean. graphicInfo.WindowTitle = "Graphic01"; |
|
WindowType |
WindowType specifies whether window type is modal or modeless. This is an optional property of data type enum. Default value: Modeless Valid range: 0 or 1 where
Examples: graphicInfo.WindowType = aaGraphic.WindowType.<windowtype>; graphicInfo.WindowType = 1; |
|
HasCloseButton |
HasCloseButton determines if the pop-up window has a close button. This is an optional property of data type Boolean. Default value: True Example: graphicInfo.HasCloseButton = false; |
|
Resizable |
Resizable determines if the pop-up window is resizable. This is an optional property of data type Boolean. Default value: False Example: graphicInfo.Resizable = true; |
|
WindowLocation |
WindowLocation specifies the location of the pop-up window. This is an optional property of data type enum. Default value: 0 (center) Valid range: 0 through 12, where the window location is set by the corresponding enumeration: 0 = Center If you select Desktop as the WindowRelativePosition (see below), Above (1), LeftOf (6), RightOf (8), and Below (12) are invalid. For more information about the behavior of the WindowLocation parameter, see Working with the Show/Hide Graphics Script Functions in the Creating and Managing Industrial Graphics User Guide. Examples: graphicInfo.WindowLocation = aaGraphic.WindowLocation.<WindowLocation>; graphicInfo.WindowLocation = 1; |
|
WindowRelative |
WindowRelativePosition specifies the relative position of the pop-up window. This is an optional property of data type enum. Default value: 0 (desktop) Valid range: 0 through 8, where the window relative position is set by the corresponding enumeration. 0 = Desktop Examples: graphicInfo.WindowRelativePosition = aaGraphic.WindowRelativePosition.<WindowRelativePosition>; graphicInfo.WindowRelativePosition = 1; |
|
RelativeTo |
RelativeTo specifies the size of the pop-up window relative to the graphic, desktop, or customized width and height. This is an optional property of data type enum. Default value: 0 (Graphic) Valid range: 0, 1, 2 where 0 = Graphic If you enter aaGraphic.RelativeTo.CustomizedWidthHeight, you can include the values of the height and width in the script. Otherwise, the default values are used. Examples: graphicInfo.RelativeTo = aaGraphic.RelativeTo.<RelativeTo>; graphicInfo.RelativeTo = 1; |
|
X |
X specifies the horizontal position of the pop-up window. 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. This parameter is applicable only if the value of the WindowRelativePosition parameter is DesktopXY, WindowXY, or ClientAreaXY. Unlike the ShowSymbol animation, there is no boundary for this value. Example: graphicInfo.X = 100; |
|
Y |
Y specifies the vertical position of the pop-up window. 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. This value is applicable only if WindowRelativePosition is DesktopXY, WindowXY, or ClientAreaXY. Unlike the ShowSymbol animation, there is no boundary for this value. Example: graphicInfo.Y = 100; |
|
Width |
Width specifies the width of the pop-up window. This is an optional property of data type integer. Default value: 100 Valid range: 0–10000 Applicable only if RelativeTo is CustomizedWidthHeight. You can specify either the height or the width of the pop-up window. The system calculates the other, based on the aspect ratio of the graphic. If you enter an out-of-boundary value, the system shows an "Out of range" message at run time. If the value > 10000, it is set at 10000. If the value < 0, it is set at 0. Example: graphicInfo.width = 500; |
|
Height |
Height specifies the height of the pop-up window. This is an optional property of data type integer. Default value: 100 Valid range: 0–10000 Height is applicable only if RelativeTo is the value of the CustomizedWidthHeight parameter. You can specify either the height or the width of the pop-up window. The system calculates the other, based on the aspect ratio of the graphic. If you enter an out-of-boundary value, the system shows an "Out of range" message at run time. If the value > 10000, it is set at 10000. If the value < 0, it is set at 0. Example: graphicInfo.height = 500; |
|
TopMost |
TopMost sets a value that indicates whether the ShowGraphic appears in the top most z-order window. A ShowGraphic whose Topmost property is set to true appears above all windows whose TopMost properties are set to false (same as Windows Task Manager). This is an optional property of data type Boolean. Default value: False In a group of windows that have the Topmost property set to true, the active window is the topmost window. Do not create scripts that launch a non-TopMost Modal dialog from a TopMost dialog. Users will not be able to interact with the View if the Modal dialog is completely hidden by any TopMost window. Example: graphicInfo.TopMost = true; |
|
ScalePercentage |
ScalePercentage sets the scaling percentage of the pop-up window and the graphic it contains. This is an optional property of data type integer. Default value: 100 Valid range: 0–1000 If you enter an out-of-boundary value, the system shows an "Out of range" message at run time. If the value > 1000, it is set at 1000. If the value < 0, it is set at 0. Example: graphicInfo.ScalePercentage = 150; |
|
KeepOnMonitor |
KeepOnMonitor specifies that a pop-up window appears entirely within the boundaries of an application window. This is an optional property of data type Boolean. Default value: True Example: graphicInfo.KeepOnMonitor = true; |
|
StretchGraphicToFit |
StretchGraphicToFitWindowSize determines if the graphic is scaled to the current size of the pop-up window. This is an optional property of data type Boolean. Default Value: True Applicable only if the value of the ScalePercentage parameter is greater than 100. Example: graphicInfo.StretchGraphicToFitWindowSize = false; |
|
StretchWindowTo |
StretchWindowToScreenWidth determines if the pop-up window is scaled to the same width as the screen. This is an optional property of data type Boolean. Default value: False Applicable only if the WindowRelativePosition parameter is Desktop, Window, Client Area, ParentGraphic, or ParentElement. Example: graphicInfo.StretchWindowToScreenWidth = true; |
|
StretchWindowTo |
StretchWindowToScreenHeight determines if the pop-up window is scaled to the same height as the screen. This is an optional property of data type Boolean. Default value: False Applicable only if the WindowRelativePosition parameter is set to Desktop, Window, Client Area, ParentGraphic, or ParentElement. Example: graphicInfo.StretchWindowToScreenHeight = true; |
|
CustomProperties |
CustomProperties is a ValuePair[] array that is used to set the custom properties of the graphic being shown. This is an optional property of data type ValuePair[]. The first three parameters are:
|
Summary of GraphicInfo properties
|
Property Name |
Required |
Data Type |
Default Value |
|---|---|---|---|
|
Identity |
Yes |
String |
None |
|
GraphicName |
Yes |
String |
None |
|
OwningObject |
No |
String |
None |
|
HasTitleBar |
No |
Boolean |
Empty |
|
WindowTitle |
No |
String |
Empty |
|
WindowType |
No |
Enum |
Modeless |
|
HasCloseButton |
No |
Boolean |
True |
|
Resizable |
No |
Boolean |
False |
|
WindowLocation |
No |
Enum |
Center |
|
WindowRelativePosition |
No |
Enum |
Desktop |
|
RelativeTo |
No |
Enum |
Graphic |
|
X |
No |
Integer |
0 |
|
Y |
No |
Integer |
0 |
|
Width |
No |
Integer |
100 |
|
Height |
No |
Integer |
100 |
|
TopMost |
No |
Boolean |
False |
|
ScalePercentage |
No |
Integer |
100 |
|
KeepOnMonitor |
No |
Boolean |
True |
|
StretchGraphicToFitWindowSize |
No |
Boolean |
True |
|
StretchWindowToScreenWidth |
No |
Boolean |
False |
|
StretchWindowToScreenHeight |
No |
Boolean |
False |
|
CustomProperties |
No |
ValuePair[] array |
Empty |
Remarks
-
Any parameter that has 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.
-
For more information, see "Working with the Show/Hide Graphics Script Functions" in the Industrial Graphic Editor User Guide.
Examples for ShowGraphic
Basic script example:
Dim graphicInfo as aaGraphic.GraphicInfo;
graphicInfo.Identity = "Script_001";
graphicInfo.GraphicName = "Symbol_001";
ShowGraphic( graphicInfo );
Advanced script example:
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", false);
graphicInfo.Identity = "i1";
graphicInfo.GraphicName = "S1";
graphicInfo.OwningObject = "UserDefined_001";
graphicInfo.WindowTitle = "Graphic01";
graphicInfo.Resizable = false;
graphicInfo.CustomProperties=cpValues;
ShowGraphic( graphicInfo );
Where "i1" is string Identity and the graphic "S1" contains custom property CP1 and CP2.
Show graphic within a pop-up window
ShowGraphic (graphicInfo);
Show an HMI window
Dim graphicInfo0 as aaGraphic.GraphicInfo;
graphicInfo0.Identity = "<HMIName>:Window1";
ShowGraphic( graphicInfo0 );