+# Copyright (C) 2014-2023 CEA, EDF
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
"""
-Test case for MultiTranslation feature.
+Test case for MultiTranslation feature.
Written on High API.
"""
from salome.shaper import model
model.do()
# Create Wire & Extrusion
-Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_2"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_1"), model.selection("EDGE", "Sketch_1/Edge-SketchLine_3")])
+Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_2"), model.selection("EDGE", "Sketch_1/SketchLine_1"), model.selection("EDGE", "Sketch_1/SketchLine_3")])
Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Wire_1_1")], model.selection("EDGE", "PartSet/OZ"), 50, 0)
# Revolution of the circle
-Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_1_2f")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
+Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_1_2r_wire")], model.selection("EDGE", "PartSet/OZ"), 360, 0)
# Create MultiTranslations
MultiTranslation_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OX"), 15, 5)
model.testNbSubResults(MultiTranslation_10, [3, 3])
def testSubResult(theFeature, theModel, thePartDoc, resultIndex, nbSolidsExpected, nbFacesExpected):
- result = theFeature.results()[resultIndex].resultSubShapePair()[0]
+ result = theFeature.results()[resultIndex].resultSubShapePair()[0]
shape = result.shape()
shapeExplorer = GeomAPI_ShapeExplorer(shape, GeomAPI_Shape.SOLID)
nbSolids = 0
nbSolids += 1
shapeExplorer.next()
assert(nbSolids == nbSolidsExpected)
-
+
shapeExplorer = GeomAPI_ShapeExplorer(shape, GeomAPI_Shape.FACE)
nbFaces = 0
selectionList = []
Group_1 = theModel.addGroup(thePartDoc, selectionList)
theModel.do()
theModel.end()
-
+
# Now you can check that all selected shapes in group have right shape type and name.
groupFeature = Group_1.feature()
groupSelectionList = groupFeature.selectionList("group_list")
#model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.SOLID, [0])
#model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.SHELL, [10])
#model.testNbSubShapes(MultiTranslation_9, GeomAPI_Shape.FACE, [30])
-#model.testHaveNamingFaces(MultiTranslation_9, model, Part_1_doc)
\ No newline at end of file
+#model.testHaveNamingFaces(MultiTranslation_9, model, Part_1_doc)