Salome HOME
CMake porting.
[modules/geom.git] / src / GEOM_PY / sketcher.py
index aeba6b43b5fe79927e968d5fb346248f8a9b759a..cc6404bd85f9b1fd82ffd945e6a8249055d3baf9 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 #
-# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -38,7 +38,8 @@ Example::
     wire = mysketcher.getGeomWire()
 
     # Put it in the study
-    import geompy
+    from salome.geom import geomBuilder
+    geompy = geomBuilder.New(salome.myStudy)
     geompy.addToStudy( wire, 'mysketch' )
 
 Additionnal examples can be found as unit tests in the source code.
@@ -46,10 +47,18 @@ Additionnal examples can be found as unit tests in the source code.
 
 geompyEnable = True
 try:
-    import geompy
+    from salome.kernel.deprecation import is_called_by_sphinx
+    if not is_called_by_sphinx():
+        import salome
+        salome.salome_init()
+        import GEOM
+        from salome.geom import geomBuilder
+        geompy = geomBuilder.New(salome.myStudy)
+        pass
+    pass
 except:
     geompyEnable = False
-    
+    pass
 
 class Sketcher: