Attributes

The <GuiOperations> node has the following attributes:

 <GuiOperations> 
 <! - Code can either be loaded from a file with the "ScriptFile" attribute, 
	or be included in a "Code" tag  - > 
 <GuiOperation Name="Enter Something" Priority="2" SourceType="CSharp"> 
 <Code> 
 	<![CDATA[  
 	Ansys.UI.Toolkit.MessageBox.Show("This is a test"); 
 	]]> 
 </Code> 

When the user interface operation invokes a script, the invocation of the script is wrapped in a command. It is possible to specify scripts to be executed in order to interrupt or cancel the execution of the command. It is also possible to specify an error file to provide messages when the command execution fails, with the same control on the error display that is provided for the update. A detailed description of the attributes is given below:

  1. InterruptScript=[string] - An optional Python script that is invoked when the computation is interrupted. In Workbench terminology, the Interrupt operation closes the external application cleanly, allowing access to data. The Interrupt operation is visible only if the Interrupt script is provided.

  2. StopScript=[string] - An optional Python script that is invoked when the computation is stopped. In Workbench terminology, the Stop operation abruptly closes the external application, possibly resulting in the loss of data. The Stop operation is visible only if the Stop script is provided. The same script can be used for Stop and Interrupt. The script has access to the same information (strings container and configurationObject) that is passed to the executing script.

  3. ErrorFile=[string] - A file used to communicate that the execution of the user interface operation was not successful. The error file muist be removed by the user interface operation upon completion. If it is still present, Workbench sends an error message. The content of the error message can be specified through the attribute CheckOnError (see below). A generic message is displayed if CheckOnError is not specified.

  4. CheckOnError=[string] - If an error file is specified, its content is scanned for lines that contain the specified error string. All lines that contain the string are displayed as error messages (with the error string stripped from the message). An error string named file causes the whole content of the file to be displayed.

  5. UseUpdateConfiguration=[boolean] - This variable can be specified as a shortcut, in order to use for the custom user interface operation the same files specified in the Update instructions for stop/interrupt and for controlling the error message display. If the attribute is True and the attributes above are not specified, the code will use the ones provided for the first update instruction, if specified.


Release 18.2 - © ANSYS, Inc. All rights reserved.