mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +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
|
@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()
|
||||||
|
|||||||
Reference in New Issue
Block a user