mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Minor fix where you shouldn't be able to add an element without an IFC project
This commit is contained in:
@@ -626,10 +626,14 @@ class AddElement(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
|
|
||||||
class LaunchAddElement(bpy.types.Operator, tool.Ifc.Operator):
|
class LaunchAddElement(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.launch_add_element"
|
bl_idname = "bim.launch_add_element"
|
||||||
bl_label = "Add Element"
|
bl_label = "Launch Add Element"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
bl_description = "Add an IFC physical product, construction type, and more"
|
bl_description = "Add an IFC physical product, construction type, and more"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def poll(cls, context):
|
||||||
|
return tool.Ifc.get()
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
# This stub operator is needed because operators from menu skip the invoke call
|
# This stub operator is needed because operators from menu skip the invoke call
|
||||||
bpy.ops.bim.add_element("INVOKE_DEFAULT")
|
bpy.ops.bim.add_element("INVOKE_DEFAULT")
|
||||||
|
|||||||
Reference in New Issue
Block a user