import geompyDC
from salome import *
-geom = lcc.FindOrLoadComponent("FactoryServer", "GEOM")
-geom.init_geom(salome.myStudy)
-
-# Export the methods of geompyDC
-for k in dir(geom):
- if k[0] == '_':continue
- globals()[k]=getattr(geom,k)
-del k
-from geompyDC import ShapeType, GEOM, kind, info, PackData, ReadTexture, EnumToLong
+# retrieve GEOM engine in try/except block
+# to avoid problems in some cases, e.g. when generating documentation
+try:
+ # get GEOM engine
+ geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
+ # initialize GEOM with current study
+ geom.init_geom( salome.myStudy )
+ # export the methods of geompyDC
+ for k in dir( geom ):
+ if k[0] == '_': continue
+ globals()[k] = getattr( geom, k )
+ pass
+ del k
+ from geompyDC import ShapeType, GEOM, kind, info, PackData, ReadTexture, EnumToLong
+ pass
+except:
+ geom = None
+ pass
## @}
-import salome
-salome.salome_init()
-from salome import *
+# initialize SALOME session in try/except block
+# to avoid problems in some cases, e.g. when generating documentation
+try:
+ import salome
+ salome.salome_init()
+ from salome import *
+except:
+ pass
from salome_notebook import *