From 7bb7d91c7eb7695908b3928745bd3bcea1817beb Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 28 Apr 2020 11:42:08 +1000 Subject: [PATCH] Improve usability of IFCDiff by prompting for export JSON file --- src/ifcblenderexport/blenderbim/bim/operator.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ifcblenderexport/blenderbim/bim/operator.py b/src/ifcblenderexport/blenderbim/bim/operator.py index 4a5ca99cc5..5111ae7d2b 100644 --- a/src/ifcblenderexport/blenderbim/bim/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/operator.py @@ -1064,16 +1064,25 @@ class SelectDiffNewFile(bpy.types.Operator): class ExecuteIfcDiff(bpy.types.Operator): bl_idname = 'bim.execute_ifc_diff' bl_label = 'Execute IFC Diff' + filename_ext = '.json' + filepath: bpy.props.StringProperty(subtype='FILE_PATH') + + def invoke(self, context, event): + self.filepath = bpy.path.ensure_ext(bpy.data.filepath, '.json') + WindowManager = context.window_manager + WindowManager.fileselect_add(self) + return {'RUNNING_MODAL'} def execute(self, context): import ifcdiff ifc_diff = ifcdiff.IfcDiff( bpy.context.scene.BIMProperties.diff_old_file, bpy.context.scene.BIMProperties.diff_new_file, - bpy.context.scene.BIMProperties.diff_json_file + self.filepath ) ifc_diff.diff() ifc_diff.export() + bpy.context.scene.BIMProperties.diff_json_file = self.filepath return {'FINISHED'}