mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix #1989. Fix bug where you couldn't export to IfcJSON, since it couldn't be imported again.
This commit is contained in:
@@ -802,7 +802,7 @@ class ExportIFC(bpy.types.Operator):
|
||||
new.name = output_file
|
||||
if self.use_relative_path and bpy.data.is_saved:
|
||||
output_file = os.path.relpath(output_file, bpy.path.abspath("//"))
|
||||
if scene.BIMProperties.ifc_file != output_file:
|
||||
if scene.BIMProperties.ifc_file != output_file and extension not in ["ifczip", "ifcjson"]:
|
||||
scene.BIMProperties.ifc_file = output_file
|
||||
if bpy.data.is_saved and bpy.data.is_dirty and bpy.data.filepath:
|
||||
bpy.ops.wm.save_mainfile(filepath=bpy.data.filepath)
|
||||
|
||||
@@ -332,6 +332,18 @@ Scenario: Export IFC - with basic contents and saving as another file
|
||||
When I press "export_ifc.bim(filepath='{cwd}/test/files/export.ifc', should_save_as=True)"
|
||||
Then "scene.BIMProperties.ifc_file" is "{cwd}/test/files/export.ifc"
|
||||
|
||||
Scenario: Export IFC - with basic contents and saving as IfcJSON where import is not supported
|
||||
Given an empty Blender session
|
||||
And I press "bim.load_project(filepath='{cwd}/test/files/basic.ifc')"
|
||||
When I press "export_ifc.bim(filepath='{cwd}/test/files/export.ifcjson', should_save_as=True)"
|
||||
Then "scene.BIMProperties.ifc_file" is "{cwd}/test/files/basic.ifc"
|
||||
|
||||
Scenario: Export IFC - with basic contents and saving as IfcZip where import is not supported
|
||||
Given an empty Blender session
|
||||
And I press "bim.load_project(filepath='{cwd}/test/files/basic.ifc')"
|
||||
When I press "export_ifc.bim(filepath='{cwd}/test/files/export.ifczip', should_save_as=True)"
|
||||
Then "scene.BIMProperties.ifc_file" is "{cwd}/test/files/basic.ifc"
|
||||
|
||||
Scenario: Export IFC - with basic contents and saving as a relative path
|
||||
Given an empty Blender session
|
||||
And I press "bim.load_project(filepath='{cwd}/test/files/basic.ifc')"
|
||||
|
||||
Reference in New Issue
Block a user