Disable GUI Updates Using Scripting

Member Posts: 3
First Comment
**

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.

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Member Posts: 31
    10 Comments Name Dropper First Anniversary
    **

    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.

  • Member Posts: 3
    First Comment
    **

    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!

  • Member, Employee Posts: 54
    Second Anniversary 10 Comments First Answer 5 Likes
    ✭✭✭✭

    @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.

Welcome!

It looks like you're new here. Sign in or register to get started.