From 8f06bb29fac6b9f972a0f9da4ebbf07fedb142e0 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 27 Jan 2019 21:14:31 +1100 Subject: [PATCH] Migrate IfcAttributes to IfcData for backwards compatibility --- src/Mod/Arch/ArchComponent.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 9f895c8e20..e9b13505f9 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -231,8 +231,14 @@ class Component: if ifcProductAttribute is None or ifcProductAttribute["is_enum"] is True: obj.removeProperty(property) - def setProperties(self,obj): + def migrateDeprecatedAttributes(self, obj): + # FreeCAD <= 0.17 stored IFC data in IfcAttributes + if hasattr(obj, "IfcAttributes"): + obj.IfcData = obj.IfcAttributes + obj.removeProperty("IfcAttributes") + + def setProperties(self,obj): pl = obj.PropertiesList if not "Base" in pl: obj.addProperty("App::PropertyLink","Base","Component",QT_TRANSLATE_NOOP("App::Property","The base object this component is built upon")) @@ -292,6 +298,7 @@ class Component: self.Subvolume = None #self.MoveWithHost = False self.Type = "Component" + self.migrateDeprecatedAttributes(obj) def onDocumentRestored(self,obj):