From b8a7a9100414e8015bc79fe6bf84a713fccdf9a3 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Mon, 5 Dec 2022 10:01:35 +0000 Subject: [PATCH 1/2] Attempt fix for versioning of XML PR --- BHoMUpgrader60/Converter.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BHoMUpgrader60/Converter.cs b/BHoMUpgrader60/Converter.cs index b14876b..037cb54 100644 --- a/BHoMUpgrader60/Converter.cs +++ b/BHoMUpgrader60/Converter.cs @@ -42,6 +42,7 @@ public Converter() : base() ToNewObject.Add("BH.oM.Adapters.Revit.RevitMaterialTakeOff", UpgradeRevitMaterialTakeoff); ToNewObject.Add("BH.oM.LadybugTools.ExternalComfortShelter", UpgradeShelter); ToNewObject.Add("BH.oM.LadybugTools.ExternalComfortTypology", UpgradeTypology); + ToNewObject.Add("BH.oM.XML.Bluebeam.Markup", UpdateBluebeamMarkdown); } /***************************************************/ @@ -134,5 +135,15 @@ public static Dictionary UpgradeTypology(Dictionary UpdateBluebeamMarkdown(Dictionary oldVersion) + { + Dictionary newVersion = new Dictionary(oldVersion); + newVersion["Depth"] = oldVersion["Depth"].ToString(); + + return newVersion; + } + + /***************************************************/ } } From d0a3b3ceee4edd03eda6fd4d0afb3e7d1ad81368 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Mon, 5 Dec 2022 15:24:03 +0000 Subject: [PATCH 2/2] #209 - versioning of dictionary properties --- BHoMUpgrader/Upgrader.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BHoMUpgrader/Upgrader.cs b/BHoMUpgrader/Upgrader.cs index bde7af6..9ab3953 100644 --- a/BHoMUpgrader/Upgrader.cs +++ b/BHoMUpgrader/Upgrader.cs @@ -117,6 +117,11 @@ private BsonDocument Upgrade(BsonDocument document, Converter converter) else result = UpgradeObject(document, converter); } + else if(document.Contains("k") && document.Contains("v")) + { + result = UpgradeObject(document, converter); + } + return result; } @@ -258,7 +263,12 @@ private string UpgradeType(string type, Converter converter) private BsonDocument UpgradeObject(BsonDocument document, Converter converter) { //Get the old type - string oldType = CleanTypeString(document["_t"].AsString); + string oldType = ""; + try + { + oldType = CleanTypeString(document["_t"].AsString); + } + catch { } // Check if the object type is classified as deleted or without update CheckForNoUpgrade(converter, oldType, "object type");