mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
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:
@@ -779,11 +779,15 @@ class PurgeUnusedOpenings(Operator, tool.Ifc.Operator):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return any(
|
||||
[tool.Geometry.has_openings(element)]
|
||||
poll = any(
|
||||
tool.Geometry.has_openings(element)
|
||||
for element in [tool.Ifc.get_entity(obj) for obj in context.selected_objects]
|
||||
if element
|
||||
)
|
||||
if not poll:
|
||||
cls.poll_message_set("No objects with openings selected.")
|
||||
return False
|
||||
return True
|
||||
|
||||
def _execute(self, context):
|
||||
bpy.ops.bim.show_openings()
|
||||
|
||||
Reference in New Issue
Block a user