From 3b806a5466a23c05ea8a5480fb591ac655b4d91c Mon Sep 17 00:00:00 2001 From: atom3 Date: Fri, 30 Apr 2021 08:41:33 +0200 Subject: [PATCH] check PredefinedType if exists not based on schema --- src/ifcopenshell-python/ifcopenshell/ids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/ids.py b/src/ifcopenshell-python/ifcopenshell/ids.py index d3340cf720..a2c407c8f9 100644 --- a/src/ifcopenshell-python/ifcopenshell/ids.py +++ b/src/ifcopenshell-python/ifcopenshell/ids.py @@ -83,7 +83,7 @@ class entity(facet): def __call__(self, inst, logger): # @nb with inheritance - if self.predefinedtype and "4" in ifc_file.schema: + if self.predefinedtype and hasattr(inst, "PredefinedType"): # logger.debug("Testing if entity predefinedtype '%s' == '%s'", inst.PredefinedType, self.predefinedtype) self.message = "an entity name '%(name)s' of predefined type '%(predefinedtype)s'" return facet_evaluation(inst.is_a(self.name) and inst.PredefinedType == self.predefinedtype, self.message % {"name": inst.is_a(), "predefinedtype": inst.PredefinedType})