hwISession PerformBatchOperation

Runs a Tcl/Tk script in a protected manner according to the specified execution mode.

Syntax

hwISession_handle PerformBatchOperation script, exec_mode

Application

HyperWorks Tcl Modify

Inputs

script
PerformBatchOperation runs the specified script in a way that ignores user mouse clicks or keyboard input while the script is running. This provides operational protection for the caller and is accomplished by running the script within a ‘UI lock’.
exec_mode (optional)
By specifying the exec_mode option, you can specify a variety of conditions, or ‘execution modes’, under which the specified script is run.
There are two primary execution modes: execution scope and render lock state.
Valid execution scope values are currentscope and globalscope. They are mutually exclusive.
currentscope
Runs the script at the current scope. Specifically, the script runs at one level below the current Tcl callstack level.
globalscope
Runs the script at the global Tcl scope and is the default. Specifically, the script runs at Tcl callstack level 0.
The execution scope dimension is important if Tcl uplevel or upvar commands are used in the implementation of the script to be run.  In these cases, currentscope must be specified.
Valid render lock states are renderlocked and renderunlocked. They are mutually exclusive.
renderlock
Runs the script inside a render lock and is the default.
renderunlock
Runs the script only inside a UI lock.
The render lock state is primarily used to control flicker as a render lock ALWAYS forces a redraw of each visible page area at the end of script execution.
The values from the two dimensions can be specified in any order and with any delimiter (space or comma, for example).  If a mode is not specified, the default value will be assumed.

Examples

To run the Tcl/Tk script myScript at the current Tcl call stack scope within a Render Lock:
[::hw::GetSessionHandle] PerformBatchOperation myScript “currentscope renderlock” – 
To run myScript at the current scope and with no render lock:
[::hw::GetSessionHandle] PerformBatchOperation myScript “current scope, renderunlock”
To run myScript at the global Tcl scope under a Render Lock. "globalscope” and “renderlock” are the default execution modes.
[::hw::GetSessionHandle] PerformBatchOperation myScript

Error

HWInvalidArg - Specifying invalid modal combinations such as "currentscope globalscope" results in this error.

Keywords

Tcl

Tk

script

commands