diff --git a/src/bonsai/bonsai/bim/module/model/slab.py b/src/bonsai/bonsai/bim/module/model/slab.py index 001310d953..82a3979e71 100644 --- a/src/bonsai/bonsai/bim/module/model/slab.py +++ b/src/bonsai/bonsai/bim/module/model/slab.py @@ -770,7 +770,10 @@ class AddSlabFromWall(bpy.types.Operator, tool.Ifc.Operator): return {"FINISHED"} walls = tool.Model.get_connected_walls(bpy.context.selected_objects) if not walls: - self.report({"WARNING"}, "Please select a closed loop of walls, or deselect the walls to add a slab using the polyline tool.") + self.report( + {"WARNING"}, + "Please select a closed loop of walls, or deselect the walls to add a slab using the polyline tool.", + ) return {"FINISHED"} DumbSlabGenerator(self.relating_type).generate("WALLS") diff --git a/src/bonsai/bonsai/tool/model.py b/src/bonsai/bonsai/tool/model.py index 9e5b7f11ac..e0e3eef00c 100644 --- a/src/bonsai/bonsai/tool/model.py +++ b/src/bonsai/bonsai/tool/model.py @@ -673,8 +673,7 @@ class Model(bonsai.core.tool.Model): return axes @classmethod - def get_connected_walls( - cls, walls: list[bpy.types.Object]) -> list[bpy.types.Object]: + def get_connected_walls(cls, walls: list[bpy.types.Object]) -> list[bpy.types.Object]: """ Loop through walls by retrieving the next connected wall using the connection path. If the function encounters the first wall again, it will return the list of connected walls. @@ -697,7 +696,7 @@ class Model(bonsai.core.tool.Model): next_wall = path.RelatedElement if path.RelatedElement != current_wall else path.RelatingElement if next_wall == previous_wall: continue - + if next_wall != current_wall and next_wall != first_wall and next_wall not in ordered_walls: ordered_walls.append(next_wall) previous_wall = current_wall