How can i export stl for every single time step with python in Mechanical
Hello i have a question, how can i export a .stl from every single time step in my solution (e.g. Total Deformation) with python?
I had searched for hours an i found no solution!
This is what i mean: test_1.stl, test_2.stl for the whole timeline (e.g. 100 steps)
Many Thanks!
Answers
-
I don't have the code off hand, but you can use DPF to get the mesh. You can then update the coordinates field of the mesh per whatever displacement field you want. You can then use an operator to create an stl file. If you have lots of time steps this is the most efficient way to do it.
You can also script a displacement object in mechanical and then iterate through the time points and use the Mechanical API to export an stl file from the object.
See this as a starting point:
https://forum.ansys.com/forums/topic/how-to-export-the-mesh-to-stl-file-all-via-script/I will ask others to also chime in with a specific solution of both of these approaches
0 -
Thanks for this, but i had checked different solutions including this one. What i need is the python command to set the next timestep in the animation, then i can export the .stl for the specific step. I cant find any Information about this command.
0 -