From b0bb05bcdb41723145259f7a3e53147fd6436270 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 17 May 2020 19:41:26 +1000 Subject: [PATCH] Minor fix. See #854. --- src/ifcblenderexport/blenderbim/bim/import_ifc.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/ifcblenderexport/blenderbim/bim/import_ifc.py b/src/ifcblenderexport/blenderbim/bim/import_ifc.py index eab95da487..f924566ab5 100644 --- a/src/ifcblenderexport/blenderbim/bim/import_ifc.py +++ b/src/ifcblenderexport/blenderbim/bim/import_ifc.py @@ -761,14 +761,8 @@ class IfcImporter(): self.file = ifcopenshell.open(filename) break elif extension == 'ifcxml': - # We write the IFCXML out to a regular IFC then re-read it, because - # right now IfcOpenShells interface for accessing an IFCXML is very - # different for some reason. When it gets standardised, we can read - # it directly. - ifcxml_file = ifcopenshell.ifcopenshell_wrapper.parse_ifcxml(self.ifc_import_settings.input_file) - with tempfile.NamedTemporaryFile() as temp_file: - ifcxml_file.write(temp_file.name) - self.file = ifcopenshell.open(temp_file.name) + self.file = ifcopenshell.file( + ifcopenshell.ifcopenshell_wrapper.parse_ifcxml(self.ifc_import_settings.input_file)) elif extension == 'ifc': self.file = ifcopenshell.open(self.ifc_import_settings.input_file) ifc.IfcStore.file = self.file