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

Application Server

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:

  • 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 GraphicName and OwningObject 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" + ".Symbol_001"; cp1 + ".Symbol_001", where the value of cp1 = "Pump_001"; or Obj1.Str1 + ".Symbol_001", where the value of Obj.Str1 = "Pump_001".

    Examples:

    To specify a Visualization folder reference:

    graphicInfo.GraphicName = "S1";

    To specify an absolute reference:

    graphicInfo.GraphicName = "OwningObjectName.SymbolName";

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

  • 0 = Modal

  • 1 = Modeless.

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
1 = Above
2 = TopLeftCorner
3 = Top
4 = TopRightCorner
5= LeftOf
6= LeftSide
7= RightSide
8 = RightOf
9 = BottomLeftCorner
10 = Bottom
11 = BottomRightCorner
12 = Below

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
Position

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
1 = Window
2 = ClientArea
3 = ParentGraphic
4 = ParentElement
5 = Mouse
6 = DesktopXY
7 = WindowXY
8 = ClientAreaXY

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
1 = Desktop
2 = CustomizedWidthHeight

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
WindowSize

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
ScreenWidth

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
ScreenHeight

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:

  • Custom property name

  • value

  • ,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 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 );

See also

HideGraphic()

HideSelf()

ShowContent()

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