Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Ansys Products

Ansys Products

Discuss installation & licensing of our Ansys Teaching and Research products.

Freezing Ansys GUI/Disabling Updates to GUI IronPython Scripting

    • Bobby__Bones
      Subscriber

      I am writing a script for ansys mechanical workbench 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.

    • Rohith Patchigolla
      Ansys Employee

      Hello,

      Could you please provide a sample code you currently have, so that I can provide some improvements if possible?

      Thank you. 

      Best regards,
      Rohith

    • Bobby__Bones
      Subscriber

       

      Thanks for responding. This is my entire script below

      [removed]

    • mrife
      Ansys Employee

      Hi Bobby_Bones

      I think you are looking for ExtAPI.Graphics.Suspend which can be used in a with:

      with (ExtAPI.Graphics.Suspend()):

          #do some things

      #continue on

       

       

    • Rohith Patchigolla
      Ansys Employee

      Hi Bobby_Bones, 

      You can also try the below as an alternative to the previous suggestion, but I did not see much speed up in my case for either options.  

      with Transaction(suspendClicks=True):

    • Bobby__Bones
      Subscriber

      Agreed. I used both of the methods and I did not see a speed up when using 12 connections, in some cases it was slower. This script will be used on models with significantly more connections and I just feel like theres some way in ansys to make it run faster with reducing the graphics updates. Its just a feeling though and I definitely dont know as much as you guys. Do you know if there are any other options to speed the graphics up?

       

    • Rohith Patchigolla
      Ansys Employee

      Hi Bobby_Bones, 

      Perhaps one additional thing you could try is executing your script in batch mode. 

      You can try running the script from WB using model.SendCommand() option, with Mechanical closed. 

      Here is an example of sending commands to Mechanical from WB for reference. 

      https://discuss.ansys.com/discussion/4402/how-to-control-number-of-cores-used-when-solving-mechanical-system-in-wb-in-batch

Viewing 6 reply threads
  • You must be logged in to reply to this topic.
[bingo_chatbox]