How to work with .csv data in Mechanical: Export, Import and plot

Mike.Thompson
Mike.Thompson Member, Employee Posts: 330
25 Answers First Anniversary 100 Comments 25 Likes
✭✭✭✭

There is often a need to work with data in a .csv format (comma delimited text file). You can store results, import conditions etc…

This attached analysis uses python code and results objects to:

  1. Automatically export displacements to a .csv file on solve
  2. Import from a .csv file to create a displacement condition for each node on a face
  3. Plot data directly from a .csv file onto nodes, allowing user to plot any arbitrary data on a given mesh.

The first analysis exports the data, while the second one imports it as a condition and plots it from a .csv directly. You will need to update the CSV file path selections in the import/plotting objects for your local paths after solving the first analysis.