Reuse tool.Ifc.Operator

This commit is contained in:
Andrej730
2024-09-06 17:45:18 +05:00
parent 871cd45f53
commit eaaa18468a
12 changed files with 30 additions and 125 deletions
@@ -367,7 +367,7 @@ class SaveLibraryFile(bpy.types.Operator):
return {"FINISHED"}
class AppendEntireLibrary(bpy.types.Operator):
class AppendEntireLibrary(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.append_entire_library"
bl_label = "Append Entire Library"
@@ -375,9 +375,6 @@ class AppendEntireLibrary(bpy.types.Operator):
def poll(cls, context):
return IfcStore.get_file()
def execute(self, context):
return IfcStore.execute_ifc_operator(self, context)
def _execute(self, context):
self.file = IfcStore.get_file()
self.library = IfcStore.library_file
@@ -389,7 +386,7 @@ class AppendEntireLibrary(bpy.types.Operator):
return {"FINISHED"}
class AppendLibraryElementByQuery(bpy.types.Operator):
class AppendLibraryElementByQuery(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.append_library_element_by_query"
bl_label = "Append Library Element By Query"
query: bpy.props.StringProperty(name="Query")
@@ -398,9 +395,6 @@ class AppendLibraryElementByQuery(bpy.types.Operator):
def poll(cls, context):
return IfcStore.get_file()
def execute(self, context):
return IfcStore.execute_ifc_operator(self, context)
def _execute(self, context):
self.file = IfcStore.get_file()
self.library = IfcStore.library_file
@@ -416,7 +410,7 @@ class AppendLibraryElementByQuery(bpy.types.Operator):
self.layout.prop(self, "query")
class AppendLibraryElement(bpy.types.Operator):
class AppendLibraryElement(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.append_library_element"
bl_label = "Append Library Element"
bl_options = {"REGISTER", "UNDO"}
@@ -431,9 +425,6 @@ class AppendLibraryElement(bpy.types.Operator):
cls.poll_message_set("Please create or load a project first.")
return poll
def execute(self, context):
return IfcStore.execute_ifc_operator(self, context)
def _execute(self, context):
self.file = IfcStore.get_file()
element = ifcopenshell.api.run(