From 7235c59c04e18d28f8410a2a85522c5224cd0805 Mon Sep 17 00:00:00 2001 From: BHoMBot Date: Fri, 23 Jun 2023 19:36:23 +0100 Subject: [PATCH 1/9] Upgrade AssemblyFileVersion to 6.3.0.0 --- XML_Adapter/Properties/AssemblyInfo.cs | 2 +- XML_Engine/Properties/AssemblyInfo.cs | 2 +- XML_oM/Properties/AssemblyInfo.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/XML_Adapter/Properties/AssemblyInfo.cs b/XML_Adapter/Properties/AssemblyInfo.cs index 2d9397e..2dca35d 100644 --- a/XML_Adapter/Properties/AssemblyInfo.cs +++ b/XML_Adapter/Properties/AssemblyInfo.cs @@ -55,7 +55,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.2.0.0")] +[assembly: AssemblyFileVersion("6.3.0.0")] diff --git a/XML_Engine/Properties/AssemblyInfo.cs b/XML_Engine/Properties/AssemblyInfo.cs index 5987d97..a2f0081 100644 --- a/XML_Engine/Properties/AssemblyInfo.cs +++ b/XML_Engine/Properties/AssemblyInfo.cs @@ -55,7 +55,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.2.0.0")] +[assembly: AssemblyFileVersion("6.3.0.0")] diff --git a/XML_oM/Properties/AssemblyInfo.cs b/XML_oM/Properties/AssemblyInfo.cs index 95c2a5a..381be78 100644 --- a/XML_oM/Properties/AssemblyInfo.cs +++ b/XML_oM/Properties/AssemblyInfo.cs @@ -55,7 +55,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.2.0.0")] +[assembly: AssemblyFileVersion("6.3.0.0")] From 6189278a3be264704d663ef3ad5f23fa5f66dece Mon Sep 17 00:00:00 2001 From: BHoMBot Date: Fri, 23 Jun 2023 21:24:28 +0100 Subject: [PATCH 2/9] Remove Previous Version Attributes for 6.2 --- XML_oM/Versioning_62.json | 26 -------------------------- XML_oM/XML_oM.csproj | 5 ++--- 2 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 XML_oM/Versioning_62.json diff --git a/XML_oM/Versioning_62.json b/XML_oM/Versioning_62.json deleted file mode 100644 index 4ac06b0..0000000 --- a/XML_oM/Versioning_62.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "Namespace": { - "ToNew": { - }, - "ToOld": { - } - }, - "Type": { - "ToNew": { - "BH.oM.XML.GBXML.RoundingSettings": "BH.oM.Adapters.XML.GBXML.RoundingSettings" - }, - "ToOld": { - "BH.oM.Adapters.XML.GBXML.RoundingSettings": "BH.oM.XML.GBXML.RoundingSettings" - } - }, - "Property": { - "ToNew": { - }, - "ToOld": { - } - }, - "MessageForDeleted": { - }, - "MessageForNoUpgrade": { - } -} \ No newline at end of file diff --git a/XML_oM/XML_oM.csproj b/XML_oM/XML_oM.csproj index 878b281..1a57245 100644 --- a/XML_oM/XML_oM.csproj +++ b/XML_oM/XML_oM.csproj @@ -1,4 +1,4 @@ - + @@ -125,7 +125,6 @@ - @@ -133,4 +132,4 @@ xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - \ No newline at end of file + From 1ba254efbf3dd8d8a4f8b8b4135dcc6b3fb714ba Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Mon, 3 Jul 2023 17:56:17 +0100 Subject: [PATCH 3/9] Initial commit to project compliance, let bot fix the rest --- XML_Adapter/XML_Adapter.csproj | 2 +- XML_Engine/XML_Engine.csproj | 2 +- XML_oM/XML_oM.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/XML_Adapter/XML_Adapter.csproj b/XML_Adapter/XML_Adapter.csproj index 6361640..0f72a70 100644 --- a/XML_Adapter/XML_Adapter.csproj +++ b/XML_Adapter/XML_Adapter.csproj @@ -32,7 +32,7 @@ - C:\ProgramData\BHoM\Assemblies\Adapter_Engine.dll + $(ProgramData)\BHoM\Assemblies\Adapter_Engine.dll False False diff --git a/XML_Engine/XML_Engine.csproj b/XML_Engine/XML_Engine.csproj index 2be6c4d..6ea23bb 100644 --- a/XML_Engine/XML_Engine.csproj +++ b/XML_Engine/XML_Engine.csproj @@ -32,7 +32,7 @@ - C:\ProgramData\BHoM\Assemblies\Analytical_oM.dll + $(ProgramData)\BHoM\Assemblies\Analytical_oM.dll False False diff --git a/XML_oM/XML_oM.csproj b/XML_oM/XML_oM.csproj index 1a57245..a550839 100644 --- a/XML_oM/XML_oM.csproj +++ b/XML_oM/XML_oM.csproj @@ -31,7 +31,7 @@ - C:\ProgramData\BHoM\Assemblies\Adapter_oM.dll + $(ProgramData)\BHoM\Assemblies\Adapter_oM.dll False False From a623d66a6875e684128785cfe830fc31de7c41e0 Mon Sep 17 00:00:00 2001 From: BHoMBot Date: Mon, 3 Jul 2023 17:57:46 +0100 Subject: [PATCH 4/9] Update project compliance --- XML_Adapter/XML_Adapter.csproj | 32 ++++++++++++++++---------------- XML_Engine/XML_Engine.csproj | 24 ++++++++++++------------ XML_oM/XML_oM.csproj | 10 +++++----- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/XML_Adapter/XML_Adapter.csproj b/XML_Adapter/XML_Adapter.csproj index 0f72a70..22980b4 100644 --- a/XML_Adapter/XML_Adapter.csproj +++ b/XML_Adapter/XML_Adapter.csproj @@ -37,77 +37,77 @@ False - C:\ProgramData\BHoM\Assemblies\Adapter_oM.dll + $(ProgramData)\BHoM\Assemblies\Adapter_oM.dll False False - C:\ProgramData\BHoM\Assemblies\Analytical_oM.dll + $(ProgramData)\BHoM\Assemblies\Analytical_oM.dll False False False - C:\ProgramData\BHoM\Assemblies\Architecture_oM.dll + $(ProgramData)\BHoM\Assemblies\Architecture_oM.dll False False - C:\ProgramData\BHoM\Assemblies\BHoM.dll + $(ProgramData)\BHoM\Assemblies\BHoM.dll False - C:\ProgramData\BHoM\Assemblies\BHoM_Adapter.dll + $(ProgramData)\BHoM\Assemblies\BHoM_Adapter.dll False False - C:\ProgramData\BHoM\Assemblies\BHoM_Engine.dll + $(ProgramData)\BHoM\Assemblies\BHoM_Engine.dll False False False - C:\ProgramData\BHoM\Assemblies\Data_oM.dll + $(ProgramData)\BHoM\Assemblies\Data_oM.dll False False - C:\ProgramData\BHoM\Assemblies\Dimensional_oM.dll + $(ProgramData)\BHoM\Assemblies\Dimensional_oM.dll False - C:\ProgramData\BHoM\Assemblies\Environment_Engine.dll + $(ProgramData)\BHoM\Assemblies\Environment_Engine.dll False False False - C:\ProgramData\BHoM\Assemblies\Environment_oM.dll + $(ProgramData)\BHoM\Assemblies\Environment_oM.dll False - C:\ProgramData\BHoM\Assemblies\Geometry_Engine.dll + $(ProgramData)\BHoM\Assemblies\Geometry_Engine.dll False False - C:\ProgramData\BHoM\Assemblies\Geometry_oM.dll + $(ProgramData)\BHoM\Assemblies\Geometry_oM.dll False False - C:\ProgramData\BHoM\Assemblies\Physical_oM.dll + $(ProgramData)\BHoM\Assemblies\Physical_oM.dll False False False - C:\ProgramData\BHoM\Assemblies\Serialiser_Engine.dll + $(ProgramData)\BHoM\Assemblies\Serialiser_Engine.dll False - C:\ProgramData\BHoM\Assemblies\Spatial_oM.dll + $(ProgramData)\BHoM\Assemblies\Spatial_oM.dll False False @@ -121,7 +121,7 @@ - C:\ProgramData\BHoM\Assemblies\TriangleNet_Engine.dll + $(ProgramData)\BHoM\Assemblies\TriangleNet_Engine.dll False False diff --git a/XML_Engine/XML_Engine.csproj b/XML_Engine/XML_Engine.csproj index 6ea23bb..cf91d23 100644 --- a/XML_Engine/XML_Engine.csproj +++ b/XML_Engine/XML_Engine.csproj @@ -37,63 +37,63 @@ False - C:\ProgramData\BHoM\Assemblies\Architecture_oM.dll + $(ProgramData)\BHoM\Assemblies\Architecture_oM.dll False False - C:\ProgramData\BHoM\Assemblies\BHoM.dll + $(ProgramData)\BHoM\Assemblies\BHoM.dll False False - C:\ProgramData\BHoM\Assemblies\BHoM_Engine.dll + $(ProgramData)\BHoM\Assemblies\BHoM_Engine.dll False False - C:\ProgramData\BHoM\Assemblies\Dimensional_oM.dll + $(ProgramData)\BHoM\Assemblies\Dimensional_oM.dll False False False - C:\ProgramData\BHoM\Assemblies\Environment_Engine.dll + $(ProgramData)\BHoM\Assemblies\Environment_Engine.dll False - C:\ProgramData\BHoM\Assemblies\Environment_oM.dll + $(ProgramData)\BHoM\Assemblies\Environment_oM.dll False False False - C:\ProgramData\BHoM\Assemblies\Geometry_Engine.dll + $(ProgramData)\BHoM\Assemblies\Geometry_Engine.dll False - C:\ProgramData\BHoM\Assemblies\Geometry_oM.dll + $(ProgramData)\BHoM\Assemblies\Geometry_oM.dll False False - C:\ProgramData\BHoM\Assemblies\Physical_oM.dll + $(ProgramData)\BHoM\Assemblies\Physical_oM.dll False False False - C:\ProgramData\BHoM\Assemblies\Serialiser_Engine.dll + $(ProgramData)\BHoM\Assemblies\Serialiser_Engine.dll False - C:\ProgramData\BHoM\Assemblies\Spatial_oM.dll + $(ProgramData)\BHoM\Assemblies\Spatial_oM.dll False False False - C:\ProgramData\BHoM\Assemblies\Structure_Engine.dll + $(ProgramData)\BHoM\Assemblies\Structure_Engine.dll False diff --git a/XML_oM/XML_oM.csproj b/XML_oM/XML_oM.csproj index a550839..0c6cdda 100644 --- a/XML_oM/XML_oM.csproj +++ b/XML_oM/XML_oM.csproj @@ -36,27 +36,27 @@ False - C:\ProgramData\BHoM\Assemblies\Architecture_oM.dll + $(ProgramData)\BHoM\Assemblies\Architecture_oM.dll False False - C:\ProgramData\BHoM\Assemblies\BHoM.dll + $(ProgramData)\BHoM\Assemblies\BHoM.dll False False - C:\ProgramData\BHoM\Assemblies\Environment_oM.dll + $(ProgramData)\BHoM\Assemblies\Environment_oM.dll False False - C:\ProgramData\BHoM\Assemblies\Geometry_oM.dll + $(ProgramData)\BHoM\Assemblies\Geometry_oM.dll False False - C:\ProgramData\BHoM\Assemblies\Spatial_oM.dll + $(ProgramData)\BHoM\Assemblies\Spatial_oM.dll False False From bf53ee63c0d05788d8740e3a63f4b2536e683ae3 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Wed, 23 Aug 2023 12:25:09 +0100 Subject: [PATCH 5/9] Remove GBXML DocumentBuilder from workflow for pushing Environment objects to XML --- XML_Adapter/AdapterActions/Push.cs | 62 +++++++++++++--- XML_Adapter/CRUD/Create.cs | 102 -------------------------- XML_Adapter/CRUD/GBXML/CreateGBXML.cs | 26 ++----- XML_Adapter/XML_Adapter.csproj | 8 +- XML_Engine/Create/DocumentBuilder.cs | 2 +- XML_Engine/Versioning_63.json | 7 ++ 6 files changed, 70 insertions(+), 137 deletions(-) delete mode 100644 XML_Adapter/CRUD/Create.cs create mode 100644 XML_Engine/Versioning_63.json diff --git a/XML_Adapter/AdapterActions/Push.cs b/XML_Adapter/AdapterActions/Push.cs index 453c441..70f7478 100644 --- a/XML_Adapter/AdapterActions/Push.cs +++ b/XML_Adapter/AdapterActions/Push.cs @@ -30,6 +30,9 @@ using BH.oM.Adapter; using BH.oM.Base; using System.Reflection; +using BH.oM.Adapters.XML; +using BH.oM.Adapters.XML.Enums; +using System.IO; namespace BH.Adapter.XML { @@ -41,26 +44,65 @@ public override List Push(IEnumerable objects, String tag = "", if (pushType == PushType.AdapterDefault) pushType = m_AdapterSettings.DefaultPushType; - /*if (_xmlSettings == null) + if (actionConfig == null) { - BH.Engine.Base.Compute.RecordError("Please set some XML Settings on the XML Adapter before pushing to an XML File"); + BH.Engine.Base.Compute.RecordError("Please provide configuration settings to push to an XML file"); return new List(); - }*/ + } - IEnumerable objectsToPush = ProcessObjectsForPush(objects, actionConfig); // Note: default Push only supports IBHoMObjects. + XMLConfig config = actionConfig as XMLConfig; + if (config == null) + { + BH.Engine.Base.Compute.RecordError("Please provide valid a XMLConfig object for pushing to an XML file"); + return new List(); + } - bool success = true; + IEnumerable objectsToPush = ProcessObjectsForPush(objects, actionConfig); // Note: default Push only supports IBHoMObjects. - MethodInfo methodInfos = typeof(Enumerable).GetMethod("Cast"); - foreach (var typeGroup in objectsToPush.GroupBy(x => x.GetType())) + bool success = false; + switch (config.Schema) { - MethodInfo mInfo = methodInfos.MakeGenericMethod(new[] { typeGroup.Key }); - var list = mInfo.Invoke(typeGroup, new object[] { typeGroup }); - success &= ICreate(list as dynamic, actionConfig); + case Schema.CSProject: + success = CreateCSProject(objectsToPush, config); + break; + case Schema.GBXML: + success = CreateGBXML(objectsToPush, config); + break; + case Schema.KML: + success = CreateKML(objectsToPush, config); + break; + case Schema.EnergyPlusLoads: + BH.Engine.Base.Compute.RecordError("The EnergyPlusLoads Schema is not supported for push operations at this time"); + success = false; + break; + case Schema.Bluebeam: + BH.Engine.Base.Compute.RecordError("The Bluebeam markup schema is not supported for push operations at this time."); + success = false; + break; + default: + success = CreateDefault(objectsToPush, config); + break; } + if (success && config.RemoveNils) + RemoveNil(_fileSettings); + return success ? objects.ToList() : new List(); } + + private static bool RemoveNil(FileSettings file) + { + var path = Path.Combine(file.Directory, file.FileName); + var xmlFile = File.ReadAllLines(path); + + xmlFile = xmlFile.Where(x => !x.Trim().Contains("xsi:nil")).ToArray(); + xmlFile = xmlFile.Where(x => x != null).ToArray(); + + File.Delete(path); + File.WriteAllLines(path, xmlFile); + + return true; + } } } diff --git a/XML_Adapter/CRUD/Create.cs b/XML_Adapter/CRUD/Create.cs deleted file mode 100644 index f7621cb..0000000 --- a/XML_Adapter/CRUD/Create.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using BH.oM.Adapters.XML; -using BH.oM.Adapters.XML.Enums; - -using BH.oM.Adapter; -using System.IO; - -namespace BH.Adapter.XML -{ - public partial class XMLAdapter : BHoMAdapter - { - protected override bool ICreate(IEnumerable objects, ActionConfig actionConfig = null) - { - if(actionConfig == null) - { - BH.Engine.Base.Compute.RecordError("Please provide configuration settings to push to an XML file"); - return false; - } - - XMLConfig config = actionConfig as XMLConfig; - if(config == null) - { - BH.Engine.Base.Compute.RecordError("Please provide valid a XMLConfig object for pushing to an XML file"); - return false; - } - - bool success = false; - - switch(config.Schema) - { - case Schema.CSProject: - success = CreateCSProject(objects, config); - break; - case Schema.GBXML: - success = CreateGBXML(objects, config); - break; - case Schema.KML: - success = CreateKML(objects, config); - break; - case Schema.EnergyPlusLoads: - BH.Engine.Base.Compute.RecordError("The EnergyPlusLoads Schema is not supported for push operations at this time"); - success = false; - break; - case Schema.Bluebeam: - BH.Engine.Base.Compute.RecordError("The Bluebeam markup schema is not supported for push operations at this time."); - success = false; - break; - default: - success = CreateDefault(objects, config); - break; - } - - if (success && config.RemoveNils) - RemoveNil(_fileSettings); - - return success; - } - - private static bool RemoveNil(FileSettings file) - { - var path = Path.Combine(file.Directory, file.FileName); - var xmlFile = File.ReadAllLines(path); - - xmlFile = xmlFile.Where(x => !x.Trim().Contains("xsi:nil")).ToArray(); - xmlFile = xmlFile.Where(x => x != null).ToArray(); - - File.Delete(path); - File.WriteAllLines(path, xmlFile); - - return true; - } - } -} - - diff --git a/XML_Adapter/CRUD/GBXML/CreateGBXML.cs b/XML_Adapter/CRUD/GBXML/CreateGBXML.cs index 1d2fb2a..de2f77e 100644 --- a/XML_Adapter/CRUD/GBXML/CreateGBXML.cs +++ b/XML_Adapter/CRUD/GBXML/CreateGBXML.cs @@ -37,6 +37,9 @@ using BH.Engine.Adapter; using BH.Engine.Adapters.XML; +using BH.oM.Spatial.SettingOut; +using BH.Engine.Environment; + namespace BH.Adapter.XML { public partial class XMLAdapter : BHoMAdapter @@ -58,29 +61,16 @@ private bool CreateGBXML(IEnumerable objects, XMLConfig config) return false; } - GBXMLDocumentBuilder doc = objects.ToList()[0] as GBXMLDocumentBuilder; - - if(doc == null) - { - BH.Engine.Base.Compute.RecordError("The GBXML schema requires a full model to be provided as a single push operation. For pushing to the GBXML version, you need to plug your objects into a GBXMLDocumentBuilder which collates the objects for pushing and push that to GBXML via this adapter."); - return false; - } + List panels = objects.Where(x => x.GetType() == typeof(Panel)).Cast().ToList(); List bhomObjects = new List(); - bhomObjects.AddRange(doc.Buildings); - bhomObjects.AddRange(doc.Levels); - bhomObjects.AddRange(doc.ShadingElements); - bhomObjects.AddRange(doc.UnassignedPanels); + bhomObjects.AddRange(objects.Where(x => x.GetType() == typeof(oM.Environment.Elements.Building)).Cast()); + bhomObjects.AddRange(objects.Where(x => x.GetType() == typeof(Level)).Cast()); if (settings.ExportDetail == oM.Adapters.XML.Enums.ExportDetail.Full) - { - foreach (List p in doc.ElementsAsSpaces) - bhomObjects.AddRange(p); - } + bhomObjects.AddRange(panels); else if(settings.ExportDetail == oM.Adapters.XML.Enums.ExportDetail.BuildingShell) - { - bhomObjects.AddRange(doc.ElementsAsSpaces.ExternalElements()); - } + bhomObjects.AddRange(panels.ToSpaces().ExternalElements()); else { BH.Engine.Base.Compute.RecordError("The ExportDetail has not been appropriately set. Please set the ExportDetail to continue"); diff --git a/XML_Adapter/XML_Adapter.csproj b/XML_Adapter/XML_Adapter.csproj index 22980b4..326ca62 100644 --- a/XML_Adapter/XML_Adapter.csproj +++ b/XML_Adapter/XML_Adapter.csproj @@ -1,4 +1,4 @@ - + @@ -149,7 +149,6 @@ - @@ -243,9 +242,6 @@ False - - - @@ -259,4 +255,4 @@ xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y --> - + \ No newline at end of file diff --git a/XML_Engine/Create/DocumentBuilder.cs b/XML_Engine/Create/DocumentBuilder.cs index 91ab361..30c8142 100644 --- a/XML_Engine/Create/DocumentBuilder.cs +++ b/XML_Engine/Create/DocumentBuilder.cs @@ -59,7 +59,7 @@ public static GBXML.GBXMLDocumentBuilder DocumentBuilder(List building ShadingElements = shadingElements, Levels = levels, UnassignedPanels = unassignedPanels, - }; + }; } [Description("Create a Document Builder object to collate data required for GBXML schema documents automatically from a given list of BHoM Objects")] diff --git a/XML_Engine/Versioning_63.json b/XML_Engine/Versioning_63.json new file mode 100644 index 0000000..a2e9826 --- /dev/null +++ b/XML_Engine/Versioning_63.json @@ -0,0 +1,7 @@ +{ + "MessageForDeleted": { + "BH.Engine.Adapters.XML.Create.DocumentBuilder(System.Collections.Generic.List)": "The GBXML Document Builder has been retired in favour of allowing objects to be pushed to XML in a manner that is aligned with other BHoM adapters. Please plug your BHoM objects directly into the Push component to continue your workflow. Ensure the XML Schema is set to GBXML in your configuration settings. Please reach out to the development team via https://github.com/BHoM/XML_Toolkit/issues if you encounter any issues with this.", + "BH.Engine.Adapters.XML.Create.DocumentBuilder(System.Collections.Generic.List, System.Collections.Generic.List>, System.Collections.Generic.List, System.Collections.Generic.List, System.Collections.Generic.List)": "The GBXML Document Builder has been retired in favour of allowing objects to be pushed to XML in a manner that is aligned with other BHoM adapters. Please plug your BHoM objects directly into the Push component to continue your workflow. Ensure the XML Schema is set to GBXML in your configuration settings. Please reach out to the development team via https://github.com/BHoM/XML_Toolkit/issues if you encounter any issues with this.", + "BH.oM.Adapters.XML.GBXMLDocumentBuilder": "The GBXML Document Builder has been retired in favour of allowing objects to be pushed to XML in a manner that is aligned with other BHoM adapters. Please plug your BHoM objects directly into the Push component to continue your workflow. Ensure the XML Schema is set to GBXML in your configuration settings. Please reach out to the development team via https://github.com/BHoM/XML_Toolkit/issues if you encounter any issues with this." + } +} \ No newline at end of file From 5424993126ba50fc505d52fe17b5d5f93d044e93 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Wed, 23 Aug 2023 12:27:59 +0100 Subject: [PATCH 6/9] Delete unnecessary files --- XML_Engine/Create/DocumentBuilder.cs | 89 ---------------------------- XML_Engine/XML_Engine.csproj | 5 +- XML_oM/GBXML/GBXMLDocumentBuilder.cs | 48 --------------- XML_oM/XML_oM.csproj | 5 +- 4 files changed, 4 insertions(+), 143 deletions(-) delete mode 100644 XML_Engine/Create/DocumentBuilder.cs delete mode 100644 XML_oM/GBXML/GBXMLDocumentBuilder.cs diff --git a/XML_Engine/Create/DocumentBuilder.cs b/XML_Engine/Create/DocumentBuilder.cs deleted file mode 100644 index 30c8142..0000000 --- a/XML_Engine/Create/DocumentBuilder.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using BH.oM.Base.Attributes; - -using BH.oM.Environment.Elements; -using GBXML = BH.oM.Adapters.XML; -using BH.oM.Base; -using BH.oM.Spatial.SettingOut; -using BH.Engine.Environment; - -using System.ComponentModel; - -namespace BH.Engine.Adapters.XML -{ - public static partial class Create - { - /***************************************************/ - /**** Public Methods ****/ - /***************************************************/ - - [Description("Create a Document Builder object to collate data required for GBXML schema documents")] - [Input("building", "The building object for the elements in the schema")] - [Input("elementsAsSpaces", "The nested collection of Environment Panels which form closed spaces within the building")] - [Input("shadingElements", "A collection of Environment Panels which provide shading to the building")] - [Input("levels", "A collection of levels which group spaces by floor")] - [Input("unassignedPanels", "Any additional panels needed to be included within the GBXML file")] - [Output("documentBuilder", "A Document Builder object suitable for GBXML schema document creation")] - public static GBXML.GBXMLDocumentBuilder DocumentBuilder(List building, List> elementsAsSpaces, List shadingElements, List levels, List unassignedPanels) - { - return new GBXML.GBXMLDocumentBuilder - { - Buildings = building, - ElementsAsSpaces = elementsAsSpaces, - ShadingElements = shadingElements, - Levels = levels, - UnassignedPanels = unassignedPanels, - }; - } - - [Description("Create a Document Builder object to collate data required for GBXML schema documents automatically from a given list of BHoM Objects")] - [Input("objs", "A collection of BHoM Objects to sort into a suitable format for inclusion within a GBXML file")] - [Output("documentBuilder", "A Document Builder object suitable for GBXML schema document creation")] - public static GBXML.GBXMLDocumentBuilder DocumentBuilder(List objs) - { - List panels = objs.Panels(); - List spaces = objs.Spaces(); - List levels = objs.Levels(); - List buildings = objs.Buildings(); - - List unassignedPanels = new List(); - - List shadingElements = panels.FilterPanelsByType(new List() { PanelType.Shade }).Item1; - panels = panels.FilterPanelsByType(new List() { PanelType.Shade }).Item2; //Remove shading if it exists - - List> elementsAsSpaces = panels.ToSpaces(); - unassignedPanels.AddRange(panels.Where(x => !elementsAsSpaces.IsContaining(x)).ToList()); - - return DocumentBuilder(buildings, elementsAsSpaces, shadingElements, levels, unassignedPanels); - } - } -} - - - diff --git a/XML_Engine/XML_Engine.csproj b/XML_Engine/XML_Engine.csproj index cf91d23..f882a07 100644 --- a/XML_Engine/XML_Engine.csproj +++ b/XML_Engine/XML_Engine.csproj @@ -1,4 +1,4 @@ - + @@ -106,7 +106,6 @@ - @@ -138,4 +137,4 @@ xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y --> - + \ No newline at end of file diff --git a/XML_oM/GBXML/GBXMLDocumentBuilder.cs b/XML_oM/GBXML/GBXMLDocumentBuilder.cs deleted file mode 100644 index 5ae8963..0000000 --- a/XML_oM/GBXML/GBXMLDocumentBuilder.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System; -using System.Collections.Generic; -using BH.oM.Base; -using BHoME = BH.oM.Environment.Elements; - -namespace BH.oM.Adapters.XML -{ - public class GBXMLDocumentBuilder : BHoMObject - { - /***************************************************/ - /**** Properties ****/ - /***************************************************/ - - public virtual List Buildings { get; set; } = new List(); - public virtual List> ElementsAsSpaces { get; set; } = new List>(); - public virtual List ShadingElements { get; set; } = new List(); - public virtual List Levels { get; set; } = new List(); - public virtual List UnassignedPanels { get; set; } = new List(); - - /***************************************************/ - } -} - - - - diff --git a/XML_oM/XML_oM.csproj b/XML_oM/XML_oM.csproj index 0c6cdda..82072a4 100644 --- a/XML_oM/XML_oM.csproj +++ b/XML_oM/XML_oM.csproj @@ -1,4 +1,4 @@ - + @@ -109,7 +109,6 @@ - @@ -132,4 +131,4 @@ xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - + \ No newline at end of file From f6da9a36f2c307e768b31acd52e1698e821f4630 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Wed, 23 Aug 2023 13:01:04 +0100 Subject: [PATCH 7/9] Upgrade XML Toolkit to NetStandard 2.0 --- XML_Adapter/Properties/AssemblyInfo.cs | 62 -------- XML_Adapter/XML_Adapter.csproj | 191 ++++--------------------- XML_Engine/Properties/AssemblyInfo.cs | 62 -------- XML_Engine/XML_Engine.csproj | 116 +++------------ XML_Toolkit.sln | 37 ++--- XML_oM/Properties/AssemblyInfo.cs | 62 -------- XML_oM/XML_oM.csproj | 114 +++------------ 7 files changed, 78 insertions(+), 566 deletions(-) delete mode 100644 XML_Adapter/Properties/AssemblyInfo.cs delete mode 100644 XML_Engine/Properties/AssemblyInfo.cs delete mode 100644 XML_oM/Properties/AssemblyInfo.cs diff --git a/XML_Adapter/Properties/AssemblyInfo.cs b/XML_Adapter/Properties/AssemblyInfo.cs deleted file mode 100644 index 2dca35d..0000000 --- a/XML_Adapter/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("XML_Adapter")] -[assembly: AssemblyDescription("https://github.com/BHoM/XML_Toolkit")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("XML_Adapter")] -[assembly: AssemblyCopyright("Copyright © https://github.com/BHoM")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1a7282cf-923c-471b-b9d4-aade4a0be364")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] - - - - diff --git a/XML_Adapter/XML_Adapter.csproj b/XML_Adapter/XML_Adapter.csproj index 326ca62..e8cc5ea 100644 --- a/XML_Adapter/XML_Adapter.csproj +++ b/XML_Adapter/XML_Adapter.csproj @@ -1,35 +1,29 @@ - - - + - Debug - AnyCPU - {1A7282CF-923C-471B-B9D4-AADE4A0BE364} - Library - Properties - BH.Adapter.XML - XML_Adapter - v4.7.2 - 512 - - - - true - full - false - ..\Build\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true + netstandard2.0 + 6.0.0.0 + https://github.com/BHoM/XML_Toolkit + 6.0.0 + BHoM + Copyright © https://github.com/BHoM + BH.oM.Adapters.XML + 6.3.0.0 ..\Build\ - TRACE - prompt - 4 + + + + + + + + + + + + + + $(ProgramData)\BHoM\Assemblies\Adapter_Engine.dll @@ -111,148 +105,11 @@ False False - - - - - - - - - $(ProgramData)\BHoM\Assemblies\TriangleNet_Engine.dll False False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {dc706f55-e26d-4463-9ec3-5a9827b24bc6} - XML_Engine - False - - - {43c9dc2f-18c1-48a9-b06f-b89cf188616e} - XML_oM - False - - - - - -xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - - - + \ No newline at end of file diff --git a/XML_Engine/Properties/AssemblyInfo.cs b/XML_Engine/Properties/AssemblyInfo.cs deleted file mode 100644 index a2f0081..0000000 --- a/XML_Engine/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("XML_Engine")] -[assembly: AssemblyDescription("https://github.com/BHoM/XML_Toolkit")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("XML_Engine")] -[assembly: AssemblyCopyright("Copyright © https://github.com/BHoM")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("dc706f55-e26d-4463-9ec3-5a9827b24bc6")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] - - - - diff --git a/XML_Engine/XML_Engine.csproj b/XML_Engine/XML_Engine.csproj index f882a07..e0656d6 100644 --- a/XML_Engine/XML_Engine.csproj +++ b/XML_Engine/XML_Engine.csproj @@ -1,46 +1,25 @@ - - - + - Debug - AnyCPU - {DC706F55-E26D-4463-9EC3-5A9827B24BC6} - Library - Properties + netstandard2.0 + 6.0.0.0 + https://github.com/BHoM/XML_Toolkit + 6.0.0 + BHoM + Copyright © https://github.com/BHoM BH.Engine.Adapters.XML - XML_Engine - v4.7.2 - 512 - - - - true - full - false - ..\Build\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true + 6.3.0.0 ..\Build\ - TRACE - prompt - 4 + + + + + + + + + - - $(ProgramData)\BHoM\Assemblies\Analytical_oM.dll - False - False - - - $(ProgramData)\BHoM\Assemblies\Architecture_oM.dll - False - False - $(ProgramData)\BHoM\Assemblies\BHoM.dll False @@ -51,11 +30,6 @@ False False - - $(ProgramData)\BHoM\Assemblies\Dimensional_oM.dll - False - False - False $(ProgramData)\BHoM\Assemblies\Environment_Engine.dll @@ -76,65 +50,11 @@ False False - - $(ProgramData)\BHoM\Assemblies\Physical_oM.dll - False - False - - - False - $(ProgramData)\BHoM\Assemblies\Serialiser_Engine.dll - False - $(ProgramData)\BHoM\Assemblies\Spatial_oM.dll False False - - False - $(ProgramData)\BHoM\Assemblies\Structure_Engine.dll - False - - - - - - - - - - - - - - - - - - - - - - - - - {43c9dc2f-18c1-48a9-b06f-b89cf188616e} - XML_oM - - - - - -xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - - - + \ No newline at end of file diff --git a/XML_Toolkit.sln b/XML_Toolkit.sln index d7fbec7..2d315c1 100644 --- a/XML_Toolkit.sln +++ b/XML_Toolkit.sln @@ -1,13 +1,13 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34003.232 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XML_Engine", "XML_Engine\XML_Engine.csproj", "{DC706F55-E26D-4463-9EC3-5A9827B24BC6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XML_oM", "XML_oM\XML_oM.csproj", "{C5967983-4AA3-4A99-A586-FBCF109A7615}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XML_Adapter", "XML_Adapter\XML_Adapter.csproj", "{1A7282CF-923C-471B-B9D4-AADE4A0BE364}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XML_Engine", "XML_Engine\XML_Engine.csproj", "{553B0BDA-F82A-4501-99E4-0F2C9053A11D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XML_oM", "XML_oM\XML_oM.csproj", "{43C9DC2F-18C1-48A9-B06F-B89CF188616E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XML_Adapter", "XML_Adapter\XML_Adapter.csproj", "{F85B0D9F-6C04-4E86-99E2-D6AFBEBD7FA7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,20 +15,23 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DC706F55-E26D-4463-9EC3-5A9827B24BC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC706F55-E26D-4463-9EC3-5A9827B24BC6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC706F55-E26D-4463-9EC3-5A9827B24BC6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC706F55-E26D-4463-9EC3-5A9827B24BC6}.Release|Any CPU.Build.0 = Release|Any CPU - {1A7282CF-923C-471B-B9D4-AADE4A0BE364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A7282CF-923C-471B-B9D4-AADE4A0BE364}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A7282CF-923C-471B-B9D4-AADE4A0BE364}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A7282CF-923C-471B-B9D4-AADE4A0BE364}.Release|Any CPU.Build.0 = Release|Any CPU - {43C9DC2F-18C1-48A9-B06F-B89CF188616E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {43C9DC2F-18C1-48A9-B06F-B89CF188616E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43C9DC2F-18C1-48A9-B06F-B89CF188616E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {43C9DC2F-18C1-48A9-B06F-B89CF188616E}.Release|Any CPU.Build.0 = Release|Any CPU + {C5967983-4AA3-4A99-A586-FBCF109A7615}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5967983-4AA3-4A99-A586-FBCF109A7615}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5967983-4AA3-4A99-A586-FBCF109A7615}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5967983-4AA3-4A99-A586-FBCF109A7615}.Release|Any CPU.Build.0 = Release|Any CPU + {553B0BDA-F82A-4501-99E4-0F2C9053A11D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {553B0BDA-F82A-4501-99E4-0F2C9053A11D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {553B0BDA-F82A-4501-99E4-0F2C9053A11D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {553B0BDA-F82A-4501-99E4-0F2C9053A11D}.Release|Any CPU.Build.0 = Release|Any CPU + {F85B0D9F-6C04-4E86-99E2-D6AFBEBD7FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F85B0D9F-6C04-4E86-99E2-D6AFBEBD7FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F85B0D9F-6C04-4E86-99E2-D6AFBEBD7FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F85B0D9F-6C04-4E86-99E2-D6AFBEBD7FA7}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {15CAC8A9-2607-4A0C-9267-CF2D83A1ED31} + EndGlobalSection EndGlobal diff --git a/XML_oM/Properties/AssemblyInfo.cs b/XML_oM/Properties/AssemblyInfo.cs deleted file mode 100644 index 381be78..0000000 --- a/XML_oM/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the Buildings and Habitats object Model (BHoM) - * Copyright (c) 2015 - 2023, the respective contributors. All rights reserved. - * - * Each contributor holds copyright over their respective contributions. - * The project versioning (Git) records all such contribution source information. - * - * - * The BHoM is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3.0 of the License, or - * (at your option) any later version. - * - * The BHoM is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this code. If not, see . - */ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("XML_oM")] -[assembly: AssemblyDescription("https://github.com/BHoM/XML_Toolkit")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("XML_oM")] -[assembly: AssemblyCopyright("Copyright © https://github.com/BHoM")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("43c9dc2f-18c1-48a9-b06f-b89cf188616e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.3.0.0")] - - - - diff --git a/XML_oM/XML_oM.csproj b/XML_oM/XML_oM.csproj index 82072a4..9607985 100644 --- a/XML_oM/XML_oM.csproj +++ b/XML_oM/XML_oM.csproj @@ -1,34 +1,21 @@ - - - + - Debug - AnyCPU - {43C9DC2F-18C1-48A9-B06F-B89CF188616E} - Library - Properties - BH.oM.XML - XML_oM - v4.7.2 - 512 - - - true - full - false - ..\Build\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true + netstandard2.0 + 6.0.0.0 + https://github.com/BHoM/XML_Toolkit + 6.0.0 + BHoM + Copyright © https://github.com/BHoM + BH.oM.Adapters.XML + 6.3.0.0 ..\Build\ - TRACE - prompt - 4 + + + + + + $(ProgramData)\BHoM\Assemblies\Adapter_oM.dll @@ -60,75 +47,6 @@ False False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - - + \ No newline at end of file From 647009643e900fdef03b3be1d35810b670957a17 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Wed, 6 Sep 2023 10:28:57 +0100 Subject: [PATCH 8/9] Specify the file that couldn't be pulled on pull error --- XML_Adapter/AdapterActions/Pull.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XML_Adapter/AdapterActions/Pull.cs b/XML_Adapter/AdapterActions/Pull.cs index 111d40c..d120603 100644 --- a/XML_Adapter/AdapterActions/Pull.cs +++ b/XML_Adapter/AdapterActions/Pull.cs @@ -39,7 +39,7 @@ public override IEnumerable Pull(IRequest request, PullType pullType = P { if (!System.IO.File.Exists(_fileSettings.GetFullFileName())) { - BH.Engine.Base.Compute.RecordError("File does not exist to pull from"); + BH.Engine.Base.Compute.RecordError($"The file at {_fileSettings.GetFullFileName()} does not exist to pull from."); return new List(); } From 699a2e078ef220d01597e1d43c1777561b8ef7d0 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Wed, 6 Sep 2023 21:46:34 +0100 Subject: [PATCH 9/9] Fix read and write of generic XML --- XML_Adapter/CRUD/Default/CreateDefault.cs | 6 +++++- XML_Adapter/CRUD/Default/ReadDefault.cs | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/XML_Adapter/CRUD/Default/CreateDefault.cs b/XML_Adapter/CRUD/Default/CreateDefault.cs index 3389f32..11169fc 100644 --- a/XML_Adapter/CRUD/Default/CreateDefault.cs +++ b/XML_Adapter/CRUD/Default/CreateDefault.cs @@ -58,8 +58,12 @@ private bool CreateDefault(IEnumerable objects, XMLConfig config) foreach (System.Reflection.PropertyInfo pi in bhomProperties) overrides.Add(typeof(BHoMObject), pi.Name, new XmlAttributes { XmlIgnore = true }); + var exportType = typeof(T); + if (exportType == typeof(IBHoMObject)) + exportType = objects.First().GetType(); + XmlSerializerNamespaces xns = new XmlSerializerNamespaces(); - XmlSerializer szer = new XmlSerializer(typeof(T), overrides); + XmlSerializer szer = new XmlSerializer(exportType, overrides); TextWriter ms = new StreamWriter(_fileSettings.GetFullFileName()); foreach (var obj in objects) { diff --git a/XML_Adapter/CRUD/Default/ReadDefault.cs b/XML_Adapter/CRUD/Default/ReadDefault.cs index 01d36fd..c185470 100644 --- a/XML_Adapter/CRUD/Default/ReadDefault.cs +++ b/XML_Adapter/CRUD/Default/ReadDefault.cs @@ -54,8 +54,14 @@ private IEnumerable ReadDefault(Type type = null, XMLConfig config object obj = null; try { + System.Reflection.PropertyInfo[] bhomProperties = typeof(BHoMObject).GetProperties(); + XmlAttributeOverrides overrides = new XmlAttributeOverrides(); + + foreach (System.Reflection.PropertyInfo pi in bhomProperties) + overrides.Add(typeof(BHoMObject), pi.Name, new XmlAttributes { XmlIgnore = true }); + TextReader reader = new StreamReader(_fileSettings.GetFullFileName()); - XmlSerializer szer = new XmlSerializer(type); + XmlSerializer szer = new XmlSerializer(type, overrides); obj = System.Convert.ChangeType(szer.Deserialize(reader), type); reader.Close(); }