From 3ec7b82b8529d0339ee9a0735249d290372061c1 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 3 Apr 2023 21:28:00 +1000 Subject: [PATCH] Fix #2930. Do not require entity applicability in IfcTester. --- src/ifctester/ifctester/ids.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ifctester/ifctester/ids.py b/src/ifctester/ifctester/ids.py index 55b8e49782..24bed309b8 100644 --- a/src/ifctester/ifctester/ids.py +++ b/src/ifctester/ifctester/ids.py @@ -201,7 +201,13 @@ class Specification: return elements = [] - for facet in self.applicability: + for i, facet in enumerate(self.applicability): + # Usually, we rely on an entity applicability to give us our first + # shortlist of elements, as it's the most efficient way to filter + # elements. If this does not exist, then we have no choice but to + # check everything. + if i == 0 and not isinstance(facet, Entity): + elements = list(ifc_file) elements = facet.filter(ifc_file, elements) for element in elements: