import SALOME_MED
import VISU
-from libSALOME_Swig import *
-sg = SALOMEGUI_Swig()
+if salome.hasDesktop():
+ from libSALOME_Swig import *
+ sg = SALOMEGUI_Swig()
def getMedObjectFromStudy():
mySO = salome.myStudy.FindObject("Objet MED")
def importMedFrom(medDir,medFile):
medFile = medDir + medFile
med_comp.readStructFileWithFieldType(medFile,salome.myStudyName)
- sg.updateObjBrowser(1)
+ if salome.hasDesktop():
+ sg.updateObjBrowser(1)
def importMed(medFile):
importMedFrom(medDir,medFile)
import SALOME_MED
import VISU
-from libSALOME_Swig import *
-sg = SALOMEGUI_Swig()
-
+if salome.hasDesktop():
+ from libSALOME_Swig import *
+ sg = SALOMEGUI_Swig()
import visu_gui
myVisu = visu_gui.myVisu
aScalarMap2 = myVisu.ScalarMapOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId)
if(myField.getNumberOfComponents() > 1) :
aCutPlanes = myVisu.CutPlanesOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId)
-
- sg.updateObjBrowser(0)
+ if salome.hasDesktop():
+ sg.updateObjBrowser(0)
else : print "We have no permission to rewrite medFile, so readStructFileWithFieldType can't open this file";
else : print "We have no permission to read medFile, it will not be opened";
except: