Configure the Show/Hide Graphic script functions
- Last UpdatedJul 08, 2024
- 2 minute read
We recommend that you first include a script that contains the ShowGraphic function to display a graphic as a pop-up window at run time. You can also include a script that contains the HideGraphic or HideSelf functions. The HideGraphic script function allows you to close any Industrial Graphic, displayed through the ShowGraphic script function. The HideSelf script function allows you to close the graphic, displayed by either the ShowGraphic script function or the ShowSymbol animation.
The ShowGraphic function can be used in a graphic’s action script, named script and pre-defined script. Although the system allows you to include it in a server script, such as Start Up, On Scan, Off Scan, Shut Down and Execute, you will not be able to execute the function at run time.
The HideGraphic script function can be called from any Industrial Graphic being used in the HMI application.
To include a script that contains the Show/Hide Graphic functions within a graphic animation action script
-
Create a graphic or open an existing graphic.
-
Draw a graphic, and then double-click it to open the Edit Animations page.
-
Open the action script editor.
-
Click the Display Script Function Browser icon. The Script Function Browser appears.
-
In the Graphic Client list, click the required script function, and then click OK. The script is added to the graphic script editor. If you add the ShowGraphic script function, the following code snippet is added:
Dim graphicInfo as aaGraphic.GraphicInfo;
graphicInfo.Identity = "<Identity>";
graphicInfo.GraphicName = "<SymbolName>";
ShowGraphic( graphicInfo );
-
Modify the script. The Identity and GraphicName are required properties and be specified.
-
You can use the Display Graphic Browser to set the value for the GraphicName property.
-
You can use the Display Automation Object Browser to set the OwningObject property.
For more information, see The Display Graphic Browser and Display Automation Object Browser.
For details on the scripts and samples, see Show/Hide Graphic Script Functions Guidelines.
-