Personal tools
You are here: Home Forum How to use Salome? using Salome without GUI

using Salome without GUI

Up to How to use Salome?
  • using Salome without GUI

    Posted by Manav Bhatia at June 04. 2008
    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
    • Re: using Salome without GUI

      Posted by woru1 at September 17. 2009

      Add the directory where runSalome is to the path:

      sys.path.append('/home/<user>/salome_5.1.2/KERNEL_5.1.2/bin/salome')

    • Re: using Salome without GUI

      Posted by Erwan ADAM at June 04. 2008
      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.

    • Re: using Salome without GUI

      Posted by Gerhard Holzinger at September 03. 2009

      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>> ignored

       

       

      What's the reason for this?

Powered by Ploneboard
Document Actions