General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

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
      Forum Moderator
      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?

      • Siyang Qiu
        Subscriber

        I am using Explicit Dynamics analysis, and your method does not seem to work on result probes such as the velocity probe, any clues on how to deal with this situation?

         

        Thanks in advance

    • joshuahutton
      Subscriber
      Thanks
Viewing 3 reply threads
  • The topic ‘How to export results to file automatically from Mechanical’ is closed to new replies.