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 Learning Forum Forums Discuss Simulation General Mechanical User button – Python commands Reply To: User button – Python commands

ErKo
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

 

 

 

 

 

 

 

[bingo_chatbox]