Personal tools
You are here: Home Forum Use saving couple of geometries automatically in Salome

saving couple of geometries automatically in Salome

Up to Use


This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.

saving couple of geometries automatically in Salome

Posted by pouyan.golestaneh at December 13. 2021

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

Re: saving couple of geometries automatically in Salome

Posted by ghodbane at December 13. 2021

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

Re: saving couple of geometries automatically in Salome

Posted by pouyan.golestaneh at December 14. 2021

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

 

 

Re: saving couple of geometries automatically in Salome

Posted by saidcatalbas at December 14. 2021

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?')

Re: saving couple of geometries automatically in Salome

Posted by pouyan.golestaneh at December 14. 2021

Thanks alot. It works now!

Previously Said ÇATALBAŞ wrote:

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.

Powered by Ploneboard
Document Actions