From d27683e8e65cce8cdf498e387ea96305ec5aed24 Mon Sep 17 00:00:00 2001 From: MaxJPRey Date: Mon, 20 Jun 2022 09:48:04 +0200 Subject: [PATCH] A list of 5 elements for the bounding box should raise an exception. --- _unittest/test_02_2D_modeler.py | 3 +++ pyaedt/modeler/Model2D.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/_unittest/test_02_2D_modeler.py b/_unittest/test_02_2D_modeler.py index fd104ec0826..c45ffe16a69 100644 --- a/_unittest/test_02_2D_modeler.py +++ b/_unittest/test_02_2D_modeler.py @@ -167,3 +167,6 @@ def test_12_objects_in_bounding_box(self): with pytest.raises(ValueError): bounding_box = [3, 4, 5] self.aedtapp.modeler.objects_in_bounding_box(bounding_box) + with pytest.raises(ValueError): + bounding_box_5_elements = [1, 2, 3, 4, 5] + self.aedtapp.modeler.objects_in_bounding_box(bounding_box_5_elements) diff --git a/pyaedt/modeler/Model2D.py b/pyaedt/modeler/Model2D.py index 5a8264d76dd..215c3d53f02 100644 --- a/pyaedt/modeler/Model2D.py +++ b/pyaedt/modeler/Model2D.py @@ -156,7 +156,7 @@ def objects_in_bounding_box(self, bounding_box, check_lines=True, check_sheets=T list of :class:`pyaedt.modeler.Object3d` """ - if len(bounding_box) not in [4, 6]: + if len(bounding_box) != 4 and len(bounding_box) != 6: raise ValueError("Bounding box must be a list of 4 or 6 elements.") if len(bounding_box) == 4: