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(); } 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/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(); } 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/Properties/AssemblyInfo.cs b/XML_Adapter/Properties/AssemblyInfo.cs deleted file mode 100644 index 2d9397e..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.2.0.0")] - - - - diff --git a/XML_Adapter/XML_Adapter.csproj b/XML_Adapter/XML_Adapter.csproj index 6361640..e8cc5ea 100644 --- a/XML_Adapter/XML_Adapter.csproj +++ b/XML_Adapter/XML_Adapter.csproj @@ -1,262 +1,115 @@ - - - + - 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 + + + + + + + + + + + + + + - C:\ProgramData\BHoM\Assemblies\Adapter_Engine.dll + $(ProgramData)\BHoM\Assemblies\Adapter_Engine.dll False 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 - - - - - - - - - - C:\ProgramData\BHoM\Assemblies\TriangleNet_Engine.dll + $(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/Create/DocumentBuilder.cs b/XML_Engine/Create/DocumentBuilder.cs deleted file mode 100644 index 91ab361..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/Properties/AssemblyInfo.cs b/XML_Engine/Properties/AssemblyInfo.cs deleted file mode 100644 index 5987d97..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.2.0.0")] - - - - 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 diff --git a/XML_Engine/XML_Engine.csproj b/XML_Engine/XML_Engine.csproj index 2be6c4d..e0656d6 100644 --- a/XML_Engine/XML_Engine.csproj +++ b/XML_Engine/XML_Engine.csproj @@ -1,141 +1,60 @@ - - - + - 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 + + + + + + + + + - - C:\ProgramData\BHoM\Assemblies\Analytical_oM.dll - False - False - - - C:\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 - False - False - - - C:\ProgramData\BHoM\Assemblies\Dimensional_oM.dll + $(ProgramData)\BHoM\Assemblies\BHoM_Engine.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 - False - False - - - C:\ProgramData\BHoM\Assemblies\Physical_oM.dll + $(ProgramData)\BHoM\Assemblies\Geometry_oM.dll False False - - False - C:\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 - 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/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/Properties/AssemblyInfo.cs b/XML_oM/Properties/AssemblyInfo.cs deleted file mode 100644 index 95c2a5a..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.2.0.0")] - - - - 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..9607985 100644 --- a/XML_oM/XML_oM.csproj +++ b/XML_oM/XML_oM.csproj @@ -1,136 +1,52 @@ - - - + - 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 + + + + + + - C:\ProgramData\BHoM\Assemblies\Adapter_oM.dll + $(ProgramData)\BHoM\Assemblies\Adapter_oM.dll 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 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -xcopy "$(TargetDir)$(TargetFileName)" "C:\ProgramData\BHoM\Assemblies" /Y - - + \ No newline at end of file