Fix bim.purge_unused_openings poll

It was returning true regardless whether tool.Geometry.has_openings returned True or not.
This commit is contained in:
Andrej730
2025-02-26 15:55:23 +05:00
parent cfb7d026d1
commit b4f2039367
@@ -779,11 +779,15 @@ class PurgeUnusedOpenings(Operator, tool.Ifc.Operator):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
return any( poll = any(
[tool.Geometry.has_openings(element)] tool.Geometry.has_openings(element)
for element in [tool.Ifc.get_entity(obj) for obj in context.selected_objects] for element in [tool.Ifc.get_entity(obj) for obj in context.selected_objects]
if element if element
) )
if not poll:
cls.poll_message_set("No objects with openings selected.")
return False
return True
def _execute(self, context): def _execute(self, context):
bpy.ops.bim.show_openings() bpy.ops.bim.show_openings()