General Mechanical

General Mechanical

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

Post processing Ansys WB results – Writing results to excel sheet

    • shravani.bojja
      Subscriber

      Dear Ansys Experts,

      An equivalent stress results from Ansys Workbench (2023 R1 version) is written to an excel (.csv) using APDL commands as shown below. In doing so, the excel file holds the data in a single column separated by a comma (,). Is it possible to get the data separated into 4 different columns in the .csv file without any manual intervention? 

      APDL command snippet used to write the results from an array MARRAY to an excel file named Results_VerticalPath_SX: where column 1 (X-coordinate), column 2 (Y-coordinate), column 3 (Z-coordinate) and column 4 (Equivalent stress)

      *CFOPEN, Results_VerticalPath_SX,csv
      *VWRITE, MARRAY(1,1), MARRAY(1,2,), MARRAY(1,3), MARRAY(1,4)
      %i, %g, %g, %g
      *CFCLOS

       

      Let me know in case of any additinal information. Thanks in advance.

      Regards,

      Shravani

    • Erik Kostson
      Ansys Employee

      Hi

       

      This seems to be an excel related question, as the file you generate from apdl is clearly comma separated.

      I would suggest to import the file manually into excel and choose separator as ","  - search also the internet:

      Search

      All the best

      Erik

    • shravani.bojja
      Subscriber

      Hi Erik,

       

      thanks for your reply. So that means that there is no other possibility to get the data into separate columns from ANSYS other than maually changing the settings in excel as specified above?

      Best Regards,

      Shavani

    • Erik Kostson
      Ansys Employee

       

       

      Hi

      Well you should not need any apdl, if you use workbench. Just define a path, and scope the results to that path and then finally export an excel file (see below).  

      Search the internet on how to define a path and to scope it to results (it is very easy once the path is defined)

      So we do not need apdl (if you use apdl you have saved it in csv format, it is just that your excel needs to be configured, see the search link and the posts there that explain this).

      All the best

      Erik

       

    • shravani.bojja
      Subscriber

      Hi Erik,

      I tried the above mentioned method and it worked as expected, however I require an APDL snippet to retrieve the equivalent stress results at different design points where 10 excel files will be generated at specified design points. What do you suggest in this case?

      Regards,

      Shravani

    • Manjunatha Siddaramanna
      Subscriber

      Hi Shravani Bojja,

      Can you help me how to export chart or Tabular data to csv file through scripting. I am trying to do it without manual intervention for multiple design point study. 

      Thanks in advance,

      Regards,

      Manju

    • shravani.bojja
      Subscriber

      Hi Erik,

      Just for your reference, the data can be separated into different columns by using a “;” as shown below. The issue is resolved now, and I can retrieve the data from ANSYS as expected. Thanks for your support.

      %i; %g;  %g;  %g

      Best Regards,

      Shravani 

      • Erik Kostson
        Ansys Employee

        Hi

        That is good, but as I was saying 'the reason behind this behavior is that CSV files (Comma Separated Values) are splitting data into columns using " , " as separator by default. But in certain countries, the default value used as separator is " ; " instead.'

         

        All the best

         

        Erik

         

    • shravani.bojja
      Subscriber

      Hi Manjunatha,

      I am trying to export the equivalent stress data of a particular path of the model into an excel, for which the data is first stored into an array. Making use of the /copy command you can export the array into an excel or text file stored at a specied path.

      Hope your question is answered.

      Regards,

      Shravani

Viewing 7 reply threads
  • The topic ‘Post processing Ansys WB results – Writing results to excel sheet’ is closed to new replies.