How can I export temperature result data in Mechanical to a csv file using a Python code object?

arranosr71 Member Posts: 1

Hello everyone, it is my first post in this forum.

I have a thermal model in ANSYS Mechanical with a couple of interesting temperature result objects on it. The thing is I'd like to create a Python code object that automatically exports these results every time the simulation is completed (the same way as doing a right-clik ->Export Text File on the interface).

Is there any way of doing that?

Thank you all for your attention


  • Abel Ramos
    Abel Ramos Member, Employee Posts: 30
    5 Likes First Answer First Comment First Anniversary

    Hello, you could investigate using something in this direction:

    import os
    lotationToExport = analysis.WorkingDir
    fileName = "exported.txt"
    fileToExport = os.path.join(lotationToExport,fileName)
    #Use your results name here
    resultsName = "myResultName"