Added ReloadSelectedIfcFile operator

Added ReloadSelectedIfcFile operator and added it to IFC Quality Control -> IFC Debug, it's useful when you're debugging and doing a lot of iterations on the same file.
This commit is contained in:
Andrej730
2022-11-25 19:17:33 +06:00
committed by Dion Moult
parent c8ba2b53c9
commit 390f23a30c
3 changed files with 14 additions and 0 deletions
@@ -91,6 +91,7 @@ classes = [
operator.RemoveIfcFile,
operator.SelectDataDir,
operator.SelectIfcFile,
operator.ReloadSelectedIfcFile,
operator.SelectSchemaDir,
operator.SelectURIAttribute,
operator.EditBlenderCollection,
@@ -37,6 +37,7 @@ class BIM_PT_debug(Panel):
row = self.layout.row(align=True)
row.prop(context.scene.BIMProperties, "ifc_file", text="")
row.operator("bim.validate_ifc_file", icon="CHECKMARK", text="")
row.operator("bim.reload_selected_ifc_file", icon="FILE_REFRESH", text="")
row.operator("bim.select_ifc_file", icon="FILE_FOLDER", text="")
row = self.layout.row(align=True)
+12
View File
@@ -100,6 +100,18 @@ class SelectIfcFile(bpy.types.Operator, IFCFileSelector):
context.window_manager.fileselect_add(self)
return {"RUNNING_MODAL"}
class ReloadSelectedIfcFile(bpy.types.Operator, IFCFileSelector):
bl_idname = "bim.reload_selected_ifc_file"
bl_label = "Reload selected IFC File"
bl_options = {"REGISTER", "UNDO"}
bl_description = "Reload currently selected IFC file"
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
self.filepath = context.scene.BIMProperties.ifc_file
if self.is_existing_ifc_file():
context.scene.BIMProperties.ifc_file = context.scene.BIMProperties.ifc_file
return {"FINISHED"}
class SelectDataDir(bpy.types.Operator):
bl_idname = "bim.select_data_dir"