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