1 # Copyright (C) 2014-2020 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # Test if the Model_AttributeSelection::newestContext method work in case
21 # the initial shell is concealed by multi-rotation (all-feature selection)
22 # and the same sketch is used by a next shell.
24 from salome.shaper import model
27 partSet = model.moduleDocument()
28 Part_1 = model.addPart(partSet)
29 Part_1_doc = Part_1.document()
30 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
31 SketchCircle_1 = Sketch_1.addCircle(47.53111880904039, 63.23707920074999, 11.27757708463696)
33 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")])
34 AngularCopy_1 = model.addMultiRotation(Part_1_doc, [model.selection("COMPOUND", "all-in-Shell_1")], model.selection("EDGE", "PartSet/OZ"), 3, keepSubResults = True)
35 Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r")])
38 from ModelAPI import *
39 aFactory = ModelAPI_Session.get().validators()
40 assert(aFactory.validate(Shell_2.feature()))
42 assert(model.checkPythonDump())