Arch: Prevision for forward compatibility

This commit is contained in:
Yorik van Havre
2019-01-20 19:32:12 -02:00
parent 6e4249f677
commit 1cbcc7b5a4

View File

@@ -255,6 +255,12 @@ class Component:
if r in IfcRoles:
obj.IfcRole = r
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" Role property to IfcRole\n")
if "IfcType" in pl: # for future backwards compatibility
r = obj.IfcType
obj.removeProperty("IfcType")
if r in IfcRoles:
obj.IfcRole = r
FreeCAD.Console.PrintMessage("Downgrading "+obj.Label+" IfcType property to IfcRole\n")
if not "MoveWithHost" in pl:
obj.addProperty("App::PropertyBool","MoveWithHost","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if this object must move together when its host is moved"))
obj.MoveWithHost = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("MoveWithHost",False)