Rever IFC Project

https://i.imgur.com/ajQiK8D.png
This commit is contained in:
Andrej730
2023-10-02 15:30:32 +05:00
parent edaabf5bd2
commit 05d4dc5666
3 changed files with 20 additions and 0 deletions
@@ -37,6 +37,7 @@ classes = (
operator.LoadProjectElements,
operator.NewProject,
operator.RefreshLibrary,
operator.RevertProject,
operator.RewindLibrary,
operator.SaveLibraryFile,
operator.SelectLibraryFile,
@@ -676,6 +676,23 @@ class UnloadProject(bpy.types.Operator):
return {"FINISHED"}
class RevertProject(bpy.types.Operator, IFCFileSelector):
bl_idname = "bim.revert_project"
bl_label = "Revert IFC Project"
bl_options = {"REGISTER", "UNDO"}
bl_description = "Reload currently opened IFC project discarding all unsaved changes"
@classmethod
def poll(cls, context):
if not context.scene.BIMProperties.ifc_file:
cls.poll_message_set("IFC project need to be loaded and saved on the disk.")
return False
return True
def execute(self, context):
bpy.ops.bim.load_project(should_start_fresh_session=True, filepath=context.scene.BIMProperties.ifc_file)
class LoadProjectElements(bpy.types.Operator):
bl_idname = "bim.load_project_elements"
bl_label = "Load Project Elements"
@@ -73,6 +73,8 @@ def file_menu(self, context):
op = self.layout.operator("export_ifc.bim", text="Save IFC Project As...")
op.should_save_as = True
self.layout.separator()
self.layout.operator("bim.revert_project")
self.layout.separator()
class BIM_PT_project(Panel):