using Salome without GUI
-
Hi, I have my python script that creates a geometry, meshes it and writes it to the disk. So far, I have been opening the Salome GUI, and running it from the console there. Is there a way to do this without the GUI? i.e., run the script from the unix shell? I will appreciate any hints. Thanks, Manav-
Add the directory where runSalome is to the path:
sys.path.append('/home/<user>/salome_5.1.2/KERNEL_5.1.2/bin/salome')
-
Something like that ??
# -------------------
class X(object):
def __init__(self):
import runSalome
import sys
sys.argv += ["--show-desktop=0"]
sys.argv += ["--modules=GEOM"]
clt, d = runSalome.main()
port = d['port']
self.port = port
return
def __del__(self):
from os import system
system('killSalomeWithPort.py %s'%(self.port))
return
pass
x = X()
from geompy import *
box = MakeBox(0.0, 0.0, 0.0, 100.0, 100.0, 100.0)
ExportBREP(box, "box.brep"
# -------------------
You can save that in box.py and launch python box.py ...
It should work !!
Regards,
E.A.
-
This script does not work for me.
[caelinux@dyn165012 work]$ python box.py
Traceback (most recent call last):
File "box.py", line 17, in ?
x = X()
File "box.py", line 3, in __init__
import runSalome
ImportError: No module named runSalome
Exception exceptions.AttributeError: "'X' object has no attribute 'port'" in <bound method X.__del__ of <__main__.X object at 0xb7b6c0ac>> ignoredWhat's the reason for this?
-
Powered by
Ploneboard
