For both schematic and Workbench actions, you can manipulate the observation process.
For task-related callbacks, from the user task, you can access name
information, template information, properties, and the task’s
underlying container via the property
InternalObject.
For queries, you can alter the action’s return value in the post-execution callback.
To abort an action, you can throw an exception from the pre-execution callback.
To process only the callback for a specific task or template, you must filter the components by performing a check inside the callback implementation based on the supplied arguments.
For example, for schematic actions, you can access the task names or containers to decide whether or not to take action. If the action must apply only to all Fluent Setup components, you would create an update callback that contains the following code:
def myPostUpdateCallback(task):
container = task.InternalObject
if container != None and container.Type.Equals('Ansys.Fluent.Addin:SetupContainer'):
#perform your post-update action on the fluent setup container
Stopping Observations:When you unload all extensions that register global callbacks, ACT stops observing the specified actions. This sets Workbench back to its prior state and can be used as a fix if either schematic or Workbench observations cause unexpected behavior.