TAGGED: #automation#ACT, mechancial, parametric, python-scripting
-
-
July 24, 2023 at 11:19 amGary WangSubscriber
Hi there,
I am doing a parametric study with an indenter pressing a piece of rubber. The parameter is the indenter positions. Currently, I am using scripting in Automation to create coordinates and transform the indenter to those coordinates. I choose this because I need to do some exporting within Scripting, such as force, and strain of interested nodes. However, this is a sequential method the latter cases only start after the former finish.Â
I know that Ansys itself has a Parametric module, which can get use of multiple cores and parallel computing. Provided that I have hundreds of cases, it would be beneficial to leverage parallel computing.
Can I also run my scripting in Ansys Parametric to export results for each case? Or can I leverage parallel computing in Automation Scripting?
Thanks a lot.
-
July 26, 2023 at 2:52 am
-
July 28, 2023 at 5:50 amAniketForum Moderator
Â
Hi Gary,
You can combine native parametric analysis capability along with Python using the Python code object in Mechanical to achieve what you want (i.e. exporting files after each solution):
Now coming to your parallel processing query, with the above-suggested approach, each design point is run after previous finishes. If you want multiple parallel instants, you will need multiple licenses to start separate mechanical sessions.
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
Â
-
-
July 28, 2023 at 5:28 amAshish KhemkaForum Moderator
Hi Gary,
Please see if the following links are of use to you:
Access the Power of Ansys from the Python World
How to automate Ansys Mechanical using Python?
Regards,
Ashish Khemka
-
July 31, 2023 at 12:16 pmGary WangSubscriber
Â
Hi Aniket and Ashish,
thanks for your input. I have added Python Code object into Mechanical. And my previous Scripting texts did proceed to finish the exporting files. A big thumb up! However, I need to export all UserDefined results at each timestep. So I looped to set the result.DisplayTime. In scripting, I used [result.EvaluateAllResults()] to update the result after I set the timestep. While in Python Code object, it has no property of [result.EvaluateAllResults()]. So how can I re-evaluate the results in Python Code object?
The link I followed to do the Python Code: https://developer.ansys.com/blog/script-tip-friday-python-code-object-mechanical
Thanks a lot
Â
-
August 1, 2023 at 7:23 amGary WangSubscriber
And I also tried this method from the link below, it didn't work either.
Â
https://www.linkedin.com/pulse/script-tip-friday-communicate-project-page-from-within-/
-
August 1, 2023 at 11:26 amAshish KhemkaForum Moderator
Hi Gary, I do not have any additional comments. Let us see if other members have something else to suggest.
Regards,
Ashish Kumar
-
- The topic ‘how to do parametric simulation with scripting?’ is closed to new replies.
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- How to apply Compression-only Support?
- Geometric stiffness matrix for solid elements
- Frictional No separation contact
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- Script Error Code:800a000d
- Elastic limit load, Elastic-plastic limit load
- Element has excessive thickness change, distortion, is turning inside out
-
1421
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.