General Mechanical

General Mechanical

ANSYS MultiObjectExport — trying to export data from ConstructionGeometry Objects Path

    • ferozheloise
      Subscriber

      Hi,

      https://catalog.ansys.com/product/5b3bc6857a2f9a5c90d32e7f/multi-object-expor

      The Multi_Object_Export method worked for me. It is quite straightforward to export information from NamedSelection Objects. But, this does not work when I want data from ConstructionGeometry Objects Path.

    • Erik Kostson
      Ansys Employee
      Hi

      Not sure, I have never used this ACT - perhaps someone else can help here ().

      Thank you

      Erik
    • Erik Kostson
      Ansys Employee
      Hi

      Also it will not be possible to modify this since it is a webex, and is not currently further developed (last release was for ANsys 17).

      ,what would you like to do exactly with the path, please elaborate and we can see if it is scriptable with ACT.

      All the best

      Erik
    • ferozheloise
      Subscriber

      Thank you for the reply. I am sending you a test case file (ANSYSv19.0), where I am trying to extract the modal deformation along a centerline of a pipe. There are two blocks of Modal analysis. In Mechanical1, the MultiObjectExport works only for the first set of results. Mechanical2 is an exact copy of Mechanical1; the only difference is -- I just rewrote the same ObjectBaseName 'Total Deformation' again. Now the MultiObjectExport does not work here as well.
      I believe that the problem is not associated with the scoping method (as I mentioned previously) -- both NamedSelection Objects and ConstructionGeometry Objects Path has the same issue. Can you please check the file?

      Regards Feroz

    • Erik Kostson
      Ansys Employee
      Hi

      Thanks for the information.

      Ansys staff are not allowed to open any attachments - also as we said, this act extension is very old (for version 17) and not maintained and developed further so we can not help with that.

      You can try instead to do your own little script (ACT mechanical), and tailor it as you need (this is the only way since this extension is frozen and we do not update it).
      To help you get started the script below collects the result objects (e.g., Total Def. ., DIrectional Def., etc.) and creates/export results files/data in a D: drive.

      --code snippet act---

      res=ExtAPI.DataModel.Project.Model.Analyses[0].Solution.Children
      maxres=len(res)
      for i in range(1,maxres):
      res[i].ExportToTextFile(bool,'''D:\\'''+str(res[i].Name)+str(i)+'''.txt''')

      -----end---

      This can be easily extended to loop also over all the analysis, and then to finally concatenate all files into one if needed. Also results can be scoped to geom., or NS or Paths without any issues.

      Thank you

      Erik
    • Erik Kostson
      Ansys Employee
      In case this might help - below is an act script that exports all results to files and then merges them all into one single file. Hope this helps:
      global files
      files=[]
      anls=ExtAPI.DataModel.Project.Model.Analyses

      maxnls=len(anls)

      for j in range(0,maxnls):
      res=anls[j].Solution.Children
      maxres=len(res)
      for i in range(1,maxres):
      res[i].ExportToTextFile(bool,'''D:\\'''+str(res[i].Name)+'''_nls_'''+str(j)+'''_'''+str(i)+'''.txt''')
      files.append('''D:\\'''+str(res[i].Name)+'''_nls_'''+str(j)+'''_'''+str(i)+'''.txt''')


      with open("D:\\output_file.txt", "w") as outfile:
      for filename in files:
      with open(filename) as infile:
      contents = infile.read outfile.write(contents)

      All the best
Viewing 5 reply threads
  • You must be logged in to reply to this topic.