Use python script to do the repeated work in preview

Hello, here is the process of how I load and export one data file as .csv

I have some simulation results, like these ouput folders, I need to read the certain one in each output folder such as 6_Run_1_femdem.r2m_broken_joint_100000 (the name should be a variable). Then I open the spreadsheet of it, click the Cell Data (attribute), and Toggle cell connectivity visibility, now I can export the spreadsheet as .csv. Besides this, I also need to export the spreadsheet of the Point Data (attribute)

I will have lots of folders shown in the first pictures, so I think performing the above operation by hand is so hard, can anyone please tell me how to write a script to process them? I believe there are variables in the folder name and read them in a certain order.

I tried to use the trace, but it can only form the script of one data file

Thank you so much!

6_Run_1_femdem.r2m_broken_joint_100000.vtu (495.6 KB)

Hi @Miraboreasau ,

You can use the “Python Trace” mechanism to generate a script for your usecase.

Best,