From 556766bf2ba32cb8db03b33ae4f274dbed42a7e6 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 12 Oct 2019 18:53:40 +1100 Subject: [PATCH] Spatial elements should check both class and name to prevent issue where two elements have the same name --- src/ifcblenderexport/io_export_ifc/export_ifc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ifcblenderexport/io_export_ifc/export_ifc.py b/src/ifcblenderexport/io_export_ifc/export_ifc.py index 5d995d28bb..2098e6a98d 100644 --- a/src/ifcblenderexport/io_export_ifc/export_ifc.py +++ b/src/ifcblenderexport/io_export_ifc/export_ifc.py @@ -689,7 +689,8 @@ class IfcParser(): return collection_tree def get_spatial_structure_element_reference(self, name): - return [ e['attributes']['Name'] for e in self.spatial_structure_elements ].index(self.get_ifc_name(name)) + return [ '{}/{}'.format(e['class'], e['attributes']['Name']) for e in + self.spatial_structure_elements ].index(name) def get_type_product_reference(self, name): return [ p['attributes']['Name'] for p in self.type_products ].index(self.get_ifc_name(name))