General Mechanical

General Mechanical

Solution name in Python

    • johnstn

      Hi. Is it possible to get the solution name and use it as variable on Python?

      I'd like to get this "Static Structural (A5)" and use it in a code to export the data.

      I have a lot of containers and if I keep this "DATEI_NAME", it will write the exported data in the same xls of the previous solution.

      Thank you

    • Erik Kostson
      Ansys Employee



      The way to get that name (but (A.. is not part of it is):



      There is also the internalobject, which is to be used with care (might not always work):



      This gives also the (A..) part




    • johnstn

      Hi Erik

      Thank you for your answer. It works. However, I get the "(A...)" in the name.

      Is it possible to get the name of the current analysis (based on the selected results)?

      I would like to run a script for each container, not changing the [0] in the code. The script should read each result selected in "Solution" and export to an xls file.

      Thanks again

    • johnstn

      I found out how to do it... 

      I added this code to find out the "i" in Analyses[i] and remove the "(A....)" from the string.


      Thanks 😀

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