From d5169e85fac28ed2f61377bd22184d6d37de3fde Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 6 Sep 2024 13:56:54 +0500 Subject: [PATCH] bim.import_ifccsv to support undo (missing Ifc Operator) Previously it wasn't possible to undo changes in the currently loaded IFC model after bim.import_ifccsv --- src/bonsai/bonsai/bim/module/csv/operator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/csv/operator.py b/src/bonsai/bonsai/bim/module/csv/operator.py index ccfb954236..c02fb1e7f6 100644 --- a/src/bonsai/bonsai/bim/module/csv/operator.py +++ b/src/bonsai/bonsai/bim/module/csv/operator.py @@ -288,9 +288,10 @@ class ExportIfcCsv(bpy.types.Operator): ] -class ImportIfcCsv(bpy.types.Operator): +class ImportIfcCsv(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.import_ifccsv" bl_label = "Import to IFC" + bl_options = {"REGISTER", "UNDO"} filter_glob: bpy.props.StringProperty(default="*.csv;*.ods;*.xlsx", options={"HIDDEN"}) filepath: bpy.props.StringProperty(subtype="FILE_PATH") @@ -308,7 +309,7 @@ class ImportIfcCsv(bpy.types.Operator): WindowManager.fileselect_add(self) return {"RUNNING_MODAL"} - def execute(self, context): + def _execute(self, context): import ifccsv props = context.scene.CsvProperties