From 3b270a61dfd93732895c6321901bdeb8ecbf7a88 Mon Sep 17 00:00:00 2001 From: ArturTomczak Date: Sat, 19 Jun 2021 11:44:33 +0200 Subject: [PATCH] handle ifc2x3 and 4 handles .ItemReference or .Identification --- src/ifcopenshell-python/ifcopenshell/ids.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/ids.py b/src/ifcopenshell-python/ifcopenshell/ids.py index c4d89e257a..389faa4068 100644 --- a/src/ifcopenshell-python/ifcopenshell/ids.py +++ b/src/ifcopenshell-python/ifcopenshell/ids.py @@ -110,8 +110,10 @@ class classification(facet): for association in inst.HasAssociations: if association.is_a("IfcRelAssociatesClassification"): cref = association.RelatingClassification - refs.append((cref.ReferencedSource.Name, cref.Identification)) # before was .ItemReference instead of .Identification - + if hasattr(cref, 'ItemReference'): #IFC2x3 + refs.append((cref.ReferencedSource.Name, cref.ItemReference)) + elif hasattr(cref, 'Identification'): # IFC4 + refs.append((cref.ReferencedSource.Name, cref.Identification)) if refs: return facet_evaluation( (self.system, self.value) in refs,