bim.add_element - add poll check #6985

This commit is contained in:
Andrej730
2025-08-05 13:54:27 +05:00
parent 8a4739f9c9
commit a498e75712
@@ -490,6 +490,14 @@ class AddElement(bpy.types.Operator, tool.Ifc.Operator):
ifc_class: bpy.props.StringProperty(options={"SKIP_SAVE"})
skip_dialog: bpy.props.BoolProperty(default=False, options={"SKIP_SAVE"})
@classmethod
def poll(cls, context):
# Exposed to Shift-A menu.
if not tool.Ifc.get():
cls.poll_message_set("No IFC project loaded.")
return False
return True
def invoke(self, context, event):
return IfcStore.execute_ifc_operator(self, context, event, method="INVOKE")