Salome HOME
0022766: [EDF] Transport of names
[modules/geom.git] / src / GEOM_SWIG / GEOM_ObjectInfo.py
index fb2ab3e15dff92f98c7e328ecbcd55bf333058ad..f34e86601d16b0f6f4757f5e131b7b2d964a1a7e 100644 (file)
@@ -1,10 +1,10 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014  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
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 #  Module : GEOM
 #
 import salome
-import geompy
-
-geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
 
 # Create several objects
 obj1 = geompy.MakeVertex(0.,0.,0.)
@@ -45,13 +46,13 @@ obj4_entry = geompy.addToStudy(obj4, "Object4")
 obj5_entry = geompy.addToStudy(obj5, "Object5")
 
 # Get information about objects
-hasInfo = geom.hasObjectInfo()
+hasInfo = geompy.hasObjectInfo()
 print "Check if GEOM module provides information about its objects: ", hasInfo
 if hasInfo == True:
-    print "Information about first  object: ", geom.getObjectInfo(salome.myStudyId, obj1_entry) 
-    print "Information about second object: ", geom.getObjectInfo(salome.myStudyId, obj2_entry)
-    print "Information about third  object: ", geom.getObjectInfo(salome.myStudyId, obj3_entry)
-    print "Information about fourth object: ", geom.getObjectInfo(salome.myStudyId, obj4_entry)
-    print "Information about fifth  object: ", geom.getObjectInfo(salome.myStudyId, obj5_entry)
+    print "Information about first  object: ", geompy.getObjectInfo(salome.myStudyId, obj1_entry)
+    print "Information about second object: ", geompy.getObjectInfo(salome.myStudyId, obj2_entry)
+    print "Information about third  object: ", geompy.getObjectInfo(salome.myStudyId, obj3_entry)
+    print "Information about fourth object: ", geompy.getObjectInfo(salome.myStudyId, obj4_entry)
+    print "Information about fifth  object: ", geompy.getObjectInfo(salome.myStudyId, obj5_entry)
 
 salome.sg.updateObjBrowser(1)