We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.

Ansys Learning Forum Forums Discuss Simulation General Mechanical User button – Python commands Reply To: User button – Python commands

Erik Kostson
Ansys Employee

 

 

 

 

 

 

 

Hi

You can use the record in the mechanical scripting console, and add the directional deformation , etc., and you will see the commands (e.g., AddDirectionalDeformation(), AddEquivalentStress(), etc.)

On how to het the max/min from these results, one can get that by:

equivalent_stress = ExtAPI.DataModel.Project.Model.Analyses[0].Solution.AddEquivalentStress()

MaxVMSt=equivalent_stress.Maximum

Then export MaxVMSt to a csv file. Search the internet how to export there are many posts on that, e.g., : 

https://www.programiz.com/python-programming/writing-csv-files

Finally group is a bit hard, but not really needed in order to create the results, extract max/min and export these values.

If needed folders/groups look at the below link for an example that adds these results and puts them into a folder.

https://discuss.ansys.com/discussion/2540/how-can-add-certain-results-and-group-them#latest

All the best

Erik