The issue of saving format and calling pyANSYS model #2801
-
I created a model using PyANSYS and generated a 3D cloud map in Mapdl Reader. Then, I want to save this 3D cloud map as a model that can be directly called, such as displaying it in Qt Creator. Is there any way to do this? Looking forward to and thank you for your answer!
In addition, there is another issue during the process of Qt creator calling the pyANSYS script. When the script is called, it will generate a 3D cloud map of Madpl reader separately. When I close this 3D cloud map, it will cause the Qt program to also close directly. Currently, I have tried many methods but still have not solved it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @COOLEST-GET We should discriminate here between:
mapdl.save("mymodel.cdb")
...
mapdl.clear()
mapdl.resume("mymodel.cdb")
mapdl = launch_mapdl() ..
...
...
# Create model
mapdl.block(...)
mapdl.et(...)
...
...
mesh = mapdl.mesh
# save mesh
mapdl.mesh.save("file.vtk") For more info check this: https://mapdl.docs.pyansys.com/version/0.67/api/_autosummary/ansys.mapdl.core.mesh_grpc.MeshGrpc.save.html Additionally you can save the geometries as VTK files: kp_vtk = mapdl.geometry.keypoints
areas_vtk = mapdl.geometry.areas
... Furthermore, you can extract the meshes from a plotter and save them. This is useful if you want to save the VTK models of different results: pl = mapdl.post_processing.plot_nodal_displacements("UX", return_plotter=True)
for ind, each_mesh in enumerate(pl.meshes):
each_mesh.save(f"file{ind}.vtk") I hope this is useful! |
Beta Was this translation helpful? Give feedback.
Hi @COOLEST-GET
We should discriminate here between:
mapdl
object. It is hosted in the MAPDL instance, and PyMAPDL query against it. You can save and restore as follow:For more info check this: https://mapdl.docs.pyansys.com/version/0.67/api/_autosummary/ansys.mapdl.core.mesh_grpc.MeshGrpc…