TAGGED: #python-#ironpython, mechanical, python-scripting
-
-
March 27, 2025 at 7:55 pm
Bobby__Bones
SubscriberI 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.
-
April 1, 2025 at 3:11 pm
Rohith Patchigolla
Ansys EmployeeHello,
Could you please provide a sample code you currently have, so that I can provide some improvements if possible?
Thank you.Â
Best regards,
Rohith -
April 1, 2025 at 3:20 pm
Bobby__Bones
SubscriberÂ
Thanks for responding. This is my entire script below
[removed]
-
April 1, 2025 at 3:54 pm
mrife
Ansys EmployeeHi 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
Â
Â
-
April 1, 2025 at 4:13 pm
Rohith Patchigolla
Ansys EmployeeHi 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):
-
April 1, 2025 at 4:41 pm
Bobby__Bones
SubscriberAgreed. 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?
Â
-
April 8, 2025 at 11:53 am
Rohith Patchigolla
Ansys EmployeeHi 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
-
- You must be logged in to reply to this topic.
-
6710
-
1906
-
1469
-
1313
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.