From 7dc98612e40bda5beeb4d944cc7f1a1c93c28d80 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 21 Jun 2023 11:04:22 +0500 Subject: [PATCH] Fixed void tests after d3d2c36 --- src/blenderbim/blenderbim/bim/module/void/operator.py | 8 ++++++++ src/blenderbim/test/bim/feature/void.feature | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/void/operator.py b/src/blenderbim/blenderbim/bim/module/void/operator.py index 7cd620d754..b3b914b256 100644 --- a/src/blenderbim/blenderbim/bim/module/void/operator.py +++ b/src/blenderbim/blenderbim/bim/module/void/operator.py @@ -29,6 +29,14 @@ class AddOpening(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.add_opening" bl_label = "Add Opening" bl_options = {"REGISTER", "UNDO"} + bl_description = "Adds an opening to an element.\n" \ + "Need to select two elements, order of selection is not important" + + @classmethod + def poll(cls, context): + if len(context.selected_objects) != 2: + cls.poll_message_set("Select two elements to add an opening") + return True def _execute(self, context): props = context.scene.BIMModelProperties diff --git a/src/blenderbim/test/bim/feature/void.feature b/src/blenderbim/test/bim/feature/void.feature index 9052fb8409..44691a35d1 100644 --- a/src/blenderbim/test/bim/feature/void.feature +++ b/src/blenderbim/test/bim/feature/void.feature @@ -81,20 +81,25 @@ Scenario: Add an opening to Element B with a void that already voids Element A And the object "Cube" is selected And I set "scene.BIMRootProperties.ifc_class" to "IfcWall" And I press "bim.assign_class" + And I add a cube And the object "Cube" is selected And I press "bim.assign_class" + And I press "bim.add_potential_opening" And the object "Opening" is selected And additionally the object "IfcWall/Cube" is selected And I press "bim.add_opening" + And the object "IfcWall/Cube" is selected And I press "bim.show_openings" + When the object "IfcOpeningElement/Opening" is selected And additionally the object "IfcWall/Cube.001" is selected And I press "bim.add_opening" - Then the object "IfcWall/Cube" is voided by "Opening" - And the object "IfcWall/Cube.001" is not voided by "Opening" + + Then the object "IfcWall/Cube" is not voided by "Opening" + And the object "IfcWall/Cube.001" is voided by "Opening" Scenario: Remove opening Given an empty IFC project