From bb29a493c7004a241bfc7ac20eff441b7f219e89 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 1 Sep 2019 10:33:06 +1000 Subject: [PATCH] Don't hardcode spatial structure elements. Make a sensible assumption instead that all collections are either contexts or spatial structures. --- export.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/export.py b/export.py index 916986859f..391bf76aba 100644 --- a/export.py +++ b/export.py @@ -85,7 +85,10 @@ class IfcParser(): print('ERROR: Name "{}" does not follow the format of "IfcClass/Name"'.format(name)) def is_a_spatial_structure_element(self, class_name): - return class_name in ['IfcBuilding', 'IfcBuildingStorey', 'IfcSite'] # TODO: unhardcode + # This should only be called on collection class_names, and since + # collections either represent contexts or spatial structure elements, + # we use this simplified assumption. + return class_name[0:3] == 'Ifc' and not self.is_a_context(class_name) def is_a_context(self, class_name): return class_name in ['IfcProject', 'IfcProjectLibrary']