Impact Auto-Tasks¶
The Impact COM interface is very useful for automating Impact by writing auto-tasks and database window scripts.
Writing Automated Tasks¶
During many operations in Impact, automated tasks (auto-tasks) are performed.
It is important when writing auto-task scripts to use IDatabase.auto_task_drawing and IDatabase.auto_task_layer rather than Application.active_drawing. These two properties always provide the correct drawing and layer that the automated task is operating on even if the drawing or layer is not active. See IDatabase.auto_task_drawing for examples of writing automated tasks.
You can inform Impact to abort some operations and stop any further action by using IDatabase.accept_auto_task.
While executing COM functions such as IDrawing.save, IDatabaseItem.open or IDatabaseItem.close_and_release automated tasks are normally invoked. If you wish to prevent these tasks from being executed see IDatabase.execute_auto_tasks.
Releasing a Project¶
Two special automated tasks UpdateBefore and UpdateAfter are designed to be used when a project is being updated or discarded in Impact. The Application.gui.active_database_release property can be used to return an IReleaseAction object that describes the update or discard that is being performed.
Reverting a Project Revision¶
Two special automated tasks RevertBefore and RevertAfter are designed to be used when a project revision is being reverted or made current in Impact. The Application.gui.active_database_revert property can be used to return an IRevertAction object that describes the revert or make current operation.