Minor fix where you shouldn't be able to add an element without an IFC project

This commit is contained in:
Dion Moult
2025-03-10 18:08:43 +11:00
parent ba1b6b5b10
commit 9f1ffe6381
@@ -626,10 +626,14 @@ class AddElement(bpy.types.Operator, tool.Ifc.Operator):
class LaunchAddElement(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.launch_add_element"
bl_label = "Add Element"
bl_label = "Launch Add Element"
bl_options = {"REGISTER", "UNDO"}
bl_description = "Add an IFC physical product, construction type, and more"
@classmethod
def poll(cls, context):
return tool.Ifc.get()
def execute(self, context):
# This stub operator is needed because operators from menu skip the invoke call
bpy.ops.bim.add_element("INVOKE_DEFAULT")