Disable GUI Updates Using Scripting

I am writing a script on ansys mechanical workbench using IronPython that takes pictures of each connection in a model from different orientations. I have it up and running, but I am trying to make it run faster because when there are a lot of connections it takes a long time. A large chunk of that time is taken up by updating the graphics. Is there any way to stop updating the GUI? I am using 2023R1, but I am upgrading soon.
Answers
-
Use
with Transaction():From the help, section "Key Usage Concepts":
The object Transaction() can be used to speed up a block of code that modifies multiple objects. This object ensures that the tree is not refreshed and that only the bare minimum graphics and validations occur while the transaction is in scope. The object Transaction() should only be used around code blocks that do not require state updates, such as solving or meshing.0 -
Hi Matthias,
I have just tried using with Transaction(): and it actually made it about 10 seconds slower per run. Do you know if there are any other commands like that?
Thanks for your help!
0 -
@bobbyBones I think, but am not sure, you are looking for ExtAPI.Graphics.Suspend() Seach for "graphics suspend" and there are 5-6 discussions with some that have an example.
0