saving couple of geometries automatically in Salome
This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.
Hi guys,
i am relatively new to salome. For my use i have to produce 100 geoemtries automatically. For that goal i used python code and it works perfectly with salome. Now my problem is that i want to save all these geometries automatically. I can not find any python function to do that for me in salome. The question is,if its really possible to do that in salome.
Thanks in advance
You can save to the geometry in the appropriate format, by using the python API as shown in the examples:
https://docs.salome-platform.org/latest/gui/GEOM/tui_import_export_page.html
More generally, if you want to know how to achieve some action in SALOME with Python, you can simply proceed as follows: do all the actions in SALOME GUI, and once done, dump everything to a python script (File -> Dump Study) . The dumped python file will basically show you how you would implement your study in Python.
HTH
Thnaks alot for your response. Actually what i want to export is the mesh not the geometry itself. I think i didn't mention it properly. Do you have any idea, how can i export the mesh?
Previously Nabil Ghodbane wrote:
You can save to the geometry in the appropriate format, by using the python API as shown in the examples:
https://docs.salome-platform.org/latest/gui/GEOM/tui_import_export_page.html
More generally, if you want to know how to achieve some action in SALOME with Python, you can simply proceed as follows: do all the actions in SALOME GUI, and once done, dump everything to a python script (File -> Dump Study) . The dumped python file will basically show you how you would implement your study in Python.
HTH
Hi Golestaneh,
As Nabil said, you cant try dumping script.
isDone = Mesh_1.Compute()
try:
Mesh_1.ExportUNV( r'C:/PATH/Mesh_1.unv' )
pass
except:
print('ExportUNV() failed. Invalid file name?')
This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.