diff --git a/src/ifcopenshell-python/ifcopenshell/ids.py b/src/ifcopenshell-python/ifcopenshell/ids.py index 769016b600..b3ac926a79 100644 --- a/src/ifcopenshell-python/ifcopenshell/ids.py +++ b/src/ifcopenshell-python/ifcopenshell/ids.py @@ -502,8 +502,10 @@ class entity(facet): :rtype: dict """ fac_dict = {"name": parameter_asdict(self.name)} - if "predefinedtype" in self: + try: fac_dict["predefinedtype"] = parameter_asdict(self.predefinedtype) + except (RecursionError, UnboundLocalError) as e: + print(e) return fac_dict def __call__(self, inst, logger):