Salome HOME
IPAL21297: errors for Netgen_1D_2D
[modules/geom.git] / src / GEOM_SWIG / GEOM_ObjectInfo.py
1 #  -*- coding: iso-8859-1 -*-
2 #  GEOM GEOM_SWIG : binding of C++ omplementaion with Python
3 #
4 #  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
6
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. 
11
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. 
16
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 
20
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23 #
24 #
25 #  File   : GEOM_ObjectInfo.py
26 #  Author : Michael ZORIN
27 #  Module : GEOM
28 #  $Header: 
29
30 import salome
31 import geompy
32
33 geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM")
34
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)
44
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")
50
51 # Get information about objects
52 hasInfo = geom.hasObjectInfo()
53 print "Check if GEOM module provides information about its objects: ", hasInfo
54 if hasInfo == True:
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)
60
61 salome.sg.updateObjBrowser(1)