This commit is contained in:
Gorgious
2021-08-15 19:19:32 +02:00
parent a6c11b7e23
commit d7a76bfa11
@@ -82,6 +82,10 @@ class CreateProjectLibrary(bpy.types.Operator):
bl_label = "Create Project Library"
bl_options = {"REGISTER", "UNDO"}
@classmethod
def poll(cls, context):
return IfcStore.get_file()
def execute(self, context):
IfcStore.begin_transaction(self)
IfcStore.add_transaction_operation(self, rollback=self.rollback, commit=lambda data: True)
@@ -321,6 +325,10 @@ class AppendLibraryElement(bpy.types.Operator):
bl_options = {"REGISTER", "UNDO"}
definition: bpy.props.IntProperty()
@classmethod
def poll(cls, context):
return IfcStore.get_file()
def execute(self, context):
return IfcStore.execute_ifc_operator(self, context)
@@ -403,6 +411,10 @@ class EnableEditingHeader(bpy.types.Operator):
bl_label = "Enable Editing Header"
bl_options = {"REGISTER", "UNDO"}
@classmethod
def poll(cls, context):
return IfcStore.get_file()
def execute(self, context):
self.file = IfcStore.get_file()
props = context.scene.BIMProjectProperties
@@ -435,6 +447,10 @@ class EditHeader(bpy.types.Operator):
bl_label = "Edit Header"
bl_options = {"REGISTER", "UNDO"}
@classmethod
def poll(cls, context):
return IfcStore.get_file()
def execute(self, context):
IfcStore.begin_transaction(self)
self.transaction_data = {}