mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user