1 # -*- coding: iso-8859-1 -*-
2 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
4 # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 # File : GEOM_ObjectInfo.py
26 # Author : Michael ZORIN
33 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
35 # Create several objects
36 obj1 = geompy.MakeVertex(0.,0.,0.)
37 obj2 = geompy.MakeCircleR(150.)
38 obj3 = geompy.MakeBoxDXDYDZ(300.,400.,500.)
39 obj4 = geompy.MakeCylinderRH(100.,200.)
40 ShapeListCompound = []
41 ShapeListCompound.append(obj3)
42 ShapeListCompound.append(obj4)
43 obj5 = geompy.MakeCompound(ShapeListCompound)
45 obj1_entry = geompy.addToStudy(obj1, "Object1")
46 obj2_entry = geompy.addToStudy(obj2, "Object2")
47 obj3_entry = geompy.addToStudy(obj3, "Object3")
48 obj4_entry = geompy.addToStudy(obj4, "Object4")
49 obj5_entry = geompy.addToStudy(obj5, "Object5")
51 # Get information about objects
52 hasInfo = geom.hasObjectInfo()
53 print "Check if GEOM module provides information about its objects: ", hasInfo
55 print "Information about first object: ", geom.getObjectInfo(salome.myStudyId, obj1_entry)
56 print "Information about second object: ", geom.getObjectInfo(salome.myStudyId, obj2_entry)
57 print "Information about third object: ", geom.getObjectInfo(salome.myStudyId, obj3_entry)
58 print "Information about fourth object: ", geom.getObjectInfo(salome.myStudyId, obj4_entry)
59 print "Information about fifth object: ", geom.getObjectInfo(salome.myStudyId, obj5_entry)
61 salome.sg.updateObjBrowser(1)