From 3d6d2a403986ccf85e7b10203137269ce78ca4bd Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Mon, 20 Jan 2025 21:59:44 +0100 Subject: [PATCH] BIM: Fix BIM Schedule Fixes #18934. --- src/Mod/BIM/ArchSchedule.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Mod/BIM/ArchSchedule.py b/src/Mod/BIM/ArchSchedule.py index 78c42e4ef5..b1c5ee671a 100644 --- a/src/Mod/BIM/ArchSchedule.py +++ b/src/Mod/BIM/ArchSchedule.py @@ -88,26 +88,32 @@ class _ArchSchedule: self.setProperties(obj) if hasattr(obj, "Result"): self.update_properties_0v21(obj) + if hasattr(obj, "Description"): + self.update_properties_1v1(obj) def update_properties_0v21(self,obj): + from draftutils.messages import _wrn sp = obj.Result if sp is not None: self.setSchedulePropertySpreadsheet(sp, obj) obj.removeProperty("Result") - from draftutils.messages import _wrn - if "Description" in obj.PropertiesList: - if obj.getTypeOfProperty("Description") == "App::PropertyStringList": - obj.Operation = obj.Description - obj.removeProperty("Description") - _wrn("v0.21, " + sp.Label + ", " + translate("Arch", "renamed property 'Description' to 'Operation'")) _wrn("v0.21, " + obj.Label + ", " + translate("Arch", "removed property 'Result', and added property 'AutoUpdate'")) if sp is not None: _wrn("v0.21, " + sp.Label + ", " + translate("Arch", "added property 'Schedule'")) + def update_properties_1v1(self,obj): + from draftutils.messages import _wrn + if obj.getTypeIdOfProperty("Description") == "App::PropertyStringList": + obj.Operation = obj.Description + obj.removeProperty("Description") + _wrn("v1.1, " + obj.Label + ", " + translate("Arch", "renamed property 'Description' to 'Operation'")) + for prop in ("Operation", "Value", "Unit", "Objects", "Filter", "CreateSpreadsheet", "DetailedResults"): + obj.setGroupOfProperty(prop,"Schedule") + def setProperties(self,obj): if not "Operation" in obj.PropertiesList: - obj.addProperty("App::PropertyStringList","Operation", "Schedule",QT_TRANSLATE_NOOP("App::Property","The operation column")) + obj.addProperty("App::PropertyStringList","Operation", "Schedule",QT_TRANSLATE_NOOP("App::Property","The operation column")) if not "Value" in obj.PropertiesList: obj.addProperty("App::PropertyStringList","Value", "Schedule",QT_TRANSLATE_NOOP("App::Property","The values column")) if not "Unit" in obj.PropertiesList: