From 3066404b4086575970ee3bd44f00a9538d59a498 Mon Sep 17 00:00:00 2001 From: Jordan McManus Date: Mon, 11 Mar 2024 11:52:09 -0400 Subject: [PATCH] changed comparison for type relationships --- src/ifcdiff/ifcdiff.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ifcdiff/ifcdiff.py b/src/ifcdiff/ifcdiff.py index e41a9667ee..2d973d0110 100755 --- a/src/ifcdiff/ifcdiff.py +++ b/src/ifcdiff/ifcdiff.py @@ -277,7 +277,14 @@ class IfcDiff: return for relationship in self.relationships: if relationship == "type": - if ifcopenshell.util.element.get_type(old) != ifcopenshell.util.element.get_type(new): + old_type = ifcopenshell.util.element.get_type(old) + new_type = ifcopenshell.util.element.get_type(new) + if old_type is not None and new_type is not None: + if old_type.get_info() != new_type.get_info(): + self.change_register.setdefault(new.GlobalId, {}).update({"type_changed": True}) + return True + elif old_type != new_type: + # one of the types is None while the other is not None self.change_register.setdefault(new.GlobalId, {}).update({"type_changed": True}) return True elif relationship == "property":