Back to index

salome-smesh  6.5.0
SMESH_test0.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 #  File   : SMESH_test0.py
00025 #  Module : SMESH
00026 #
00027 import salome
00028 import geompy
00029 from geompy import geom
00030 
00031 
00032 myBuilder = salome.myStudy.NewBuilder()
00033 
00034 # ---- define a box
00035 
00036 box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
00037 idbox = geompy.addToStudy(box, "box")
00038 
00039 # ---- add first face of box in study
00040 
00041 subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
00042 face = subShapeList[0]
00043 name = geompy.SubShapeName(face, box)
00044 print name
00045 idface = geompy.addToStudyInFather(box, face, name)
00046 
00047 # ---- add shell from box  in study
00048 
00049 subShellList = geompy.SubShapeAll(box, geompy.ShapeType["SHELL"])
00050 shell = subShellList[0]
00051 name = geompy.SubShapeName(shell, box)
00052 print name
00053 idshell = geompy.addToStudyInFather(box, shell, name)
00054 
00055 # ---- add first edge of face in study
00056 
00057 edgeList = geompy.SubShapeAll(face, geompy.ShapeType["EDGE"])
00058 edge = edgeList[0]
00059 name = geompy.SubShapeName(edge, face)
00060 print name
00061 idedge = geompy.addToStudyInFather(face, edge, name)
00062 
00063 salome.sg.updateObjBrowser(1)