General Mechanical

General Mechanical

How to export results to file automatically from Mechanical

    • joshuahutton
      Subscriber

      Hello All,

      I am using Ansys 2021R2 and I need to export certain component stress results (not all of them) to a text or excel file for further post processing. Currently I can do the manually by selecting the particular component stress results in the solution, then right-click, export, export text file to save the file. This becomes very tedious for each of the components and each of my analyses so I am looking for a way to automate this. I don't know much APDL (commands) or python, but I am a quick study on coding in general if someone has a close example. Does anyone have any thoughts on how to do this?

      Thanks

      Joshua

    • joshuahutton
      Subscriber
      bump
    • Aniket
      Ansys Employee
      Hi Joshua Please check:
      https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v212/en/act_script/act_script.html

      you can easily loop through all the required results using
      result = Model.Analyses[0].Solution.Children[i] #where i ranges from 1 to n
      result.ExportToTextFile(r"C:\\testdata2.txt")
      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum
      • yuriporto
        Subscriber

        Hi Aniket, I can't access your link. Still works?

    • joshuahutton
      Subscriber
      Thanks
Viewing 3 reply threads
  • You must be logged in to reply to this topic.