diff --git a/.ci/BHoMBot/Nuget/BHoM.Interop.Excel.nuspec b/.ci/BHoMBot/Nuget/BHoM.Interop.Excel.nuspec index 450487b..6f52ea9 100644 --- a/.ci/BHoMBot/Nuget/BHoM.Interop.Excel.nuspec +++ b/.ci/BHoMBot/Nuget/BHoM.Interop.Excel.nuspec @@ -18,8 +18,14 @@ - + + + + + + + diff --git a/Excel_Adapter/AdapterActions/Push.cs b/Excel_Adapter/AdapterActions/Push.cs index 44f9bbf..f9f036e 100644 --- a/Excel_Adapter/AdapterActions/Push.cs +++ b/Excel_Adapter/AdapterActions/Push.cs @@ -332,6 +332,9 @@ private static void GetPropertyDictionary(ref Dictionary dict, o } else if (obj.GetType().IsPrimitive || obj is string || obj is Guid || obj is Enum) { + if (obj is Guid) + obj = obj.ToString(); // TODO: Temporary fix to cover for a bug in IToText() from the base engine when used on Guids. Remove when fix in the base engine. + string key = parentType.Length > 0 ? parentType : "Value"; dict[key] = obj; return; diff --git a/Excel_Adapter/Convert/FromExcel/CellContents.cs b/Excel_Adapter/Convert/FromExcel/CellContents.cs index d955ebb..722761c 100644 --- a/Excel_Adapter/Convert/FromExcel/CellContents.cs +++ b/Excel_Adapter/Convert/FromExcel/CellContents.cs @@ -64,7 +64,7 @@ public static CellContents FromExcel(this IXLCell xLCell) [Input("value", "Value or cached value of the cell.")] public static object CellValueOrCachedValue(this IXLCell xLCell) { - object value; + XLCellValue value; if (!xLCell.TryGetValue(out value)) { //If not able to just get the value, then get the cached value @@ -74,7 +74,7 @@ public static object CellValueOrCachedValue(this IXLCell xLCell) value = xLCell.CachedValue; } - return value; + return ExtractValue(value); } /*******************************************/ @@ -101,6 +101,29 @@ private static Type SystemType(this XLDataType dataType) } /*******************************************/ + + private static object ExtractValue(XLCellValue xCellValue) + { + switch (xCellValue.Type) + { + case XLDataType.Boolean: + return xCellValue.GetBoolean(); + case XLDataType.DateTime: + return xCellValue.GetDateTime(); + case XLDataType.Number: + return xCellValue.GetNumber(); + case XLDataType.Text: + return xCellValue.GetText(); + case XLDataType.TimeSpan: + return xCellValue.GetTimeSpan(); + case XLDataType.Error: + return null; + default: + return null; + } + } + + /*******************************************/ } } diff --git a/Excel_Adapter/Excel_Adapter.csproj b/Excel_Adapter/Excel_Adapter.csproj index 4a755d7..62edd9e 100644 --- a/Excel_Adapter/Excel_Adapter.csproj +++ b/Excel_Adapter/Excel_Adapter.csproj @@ -7,7 +7,7 @@ BHoM Copyright © https://github.com/BHoM BH.Adapter.Excel - 7.1.0.0 + 7.2.0.0 Debug;Release;ZeroCodeTool ..\Build\ true @@ -23,7 +23,7 @@ - + diff --git a/Excel_Engine/Compute/ListToText.cs b/Excel_Engine/Compute/ListToText.cs index 4c0a72c..0e2398e 100644 --- a/Excel_Engine/Compute/ListToText.cs +++ b/Excel_Engine/Compute/ListToText.cs @@ -38,7 +38,11 @@ public static partial class Compute /**** Public Methods ****/ /*******************************************/ - public static string ListToText(List objects, string delimiter=",") + [Description("Converts a list of objects into a single string using the delimiter provided to separate items.")] + [Input("objects", "The list of objects to be converted to a string.")] + [Input("delimiter", "The delimiter to be used that separates the items of the list.")] + [Output("text", "The output text.")] + public static string ListToText(List objects, string delimiter = ",") { if (objects.Count == 0) return ""; diff --git a/Excel_Engine/Create/ExcelPushConfig.cs b/Excel_Engine/Create/ExcelPushConfig.cs index dec833c..3f8fd99 100644 --- a/Excel_Engine/Create/ExcelPushConfig.cs +++ b/Excel_Engine/Create/ExcelPushConfig.cs @@ -34,7 +34,9 @@ public static partial class Create /*******************************************/ [Description("Creates an ExcelPushConfig based on starting cell address in an Excel-readable string format and workbook properties.")] + [Input("sheetName", "The name of the sheet in the excel file to push to.")] [Input("startingCell", "Starting cell address in an Excel-readable string format.")] + [Input("objectProperties", "Object properties to apply to the pushed objects.")] [InputFromProperty("workbookProperties")] [Output("config", "ExcelPushConfig created based on the inputs.")] public static ExcelPushConfig ExcelPushConfig(string sheetName = "", string startingCell = "", List objectProperties = null, WorkbookProperties workbookProperties = null) diff --git a/Excel_Engine/Excel_Engine.csproj b/Excel_Engine/Excel_Engine.csproj index 911d867..9bb4aa9 100644 --- a/Excel_Engine/Excel_Engine.csproj +++ b/Excel_Engine/Excel_Engine.csproj @@ -7,7 +7,7 @@ BHoM Copyright © https://github.com/BHoM BH.Engine.Excel - 7.1.0.0 + 7.2.0.0 Debug;Release;ZeroCodeTool ..\Build\ true diff --git a/Excel_oM/Excel_oM.csproj b/Excel_oM/Excel_oM.csproj index 07e1847..70bdb92 100644 --- a/Excel_oM/Excel_oM.csproj +++ b/Excel_oM/Excel_oM.csproj @@ -7,7 +7,7 @@ BHoM Copyright © https://github.com/BHoM BH.oM.Excel - 7.1.0.0 + 7.2.0.0 Debug;Release;ZeroCodeTool ..\Build\ true