From 26ff33035c2f382ec3eba893a61fbce31d78da70 Mon Sep 17 00:00:00 2001 From: Tilman Reinhardt Date: Thu, 5 Oct 2023 14:50:03 +0200 Subject: [PATCH] GSAGH-384 GridLoadHelper.ListSeparator --- GsaGH/Parameters/3_Loads/GridLoadHelper.cs | 13 ++++++++++--- .../3_Components/3_Loads/CreateGridLineLoadTests.cs | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/GsaGH/Parameters/3_Loads/GridLoadHelper.cs b/GsaGH/Parameters/3_Loads/GridLoadHelper.cs index 08e5f8ee7..7fb455c00 100644 --- a/GsaGH/Parameters/3_Loads/GridLoadHelper.cs +++ b/GsaGH/Parameters/3_Loads/GridLoadHelper.cs @@ -1,5 +1,4 @@ -using System.Globalization; -using System; +using GsaAPI; using OasysUnits; using Rhino.Collections; using Rhino.Geometry; @@ -7,7 +6,7 @@ namespace GsaGH.Parameters { internal static class GridLoadHelper { - private static readonly char ListSeparator = Convert.ToChar(CultureInfo.CurrentCulture.TextInfo.ListSeparator); + internal static char ListSeparator = GetListSeparator(); internal static string CreateDefinition(Point3dList controlPoints, Plane plane) { string desc = string.Empty; @@ -67,5 +66,13 @@ private static (LengthUnit lengthUnit, string def) ClearDefGetUnit(string defini definition = definition.Replace("(m)", string.Empty); return (lengthUnit, definition); } + + internal static char GetListSeparator() { + // this is a hack, because GSA doesn´t use CultureInfo.CurrentCulture.TextInfo.ListSeparator + var gridLineLoad = new GridLineLoad { + PolyLineDefinition = "(0, 0) (1, 0) (m)" + }; + return gridLineLoad.PolyLineDefinition[2]; + } } } diff --git a/GsaGHTests/3_Components/3_Loads/CreateGridLineLoadTests.cs b/GsaGHTests/3_Components/3_Loads/CreateGridLineLoadTests.cs index ca8af7a44..49cc9ece1 100644 --- a/GsaGHTests/3_Components/3_Loads/CreateGridLineLoadTests.cs +++ b/GsaGHTests/3_Components/3_Loads/CreateGridLineLoadTests.cs @@ -21,7 +21,7 @@ public void CreateGridLineLoadTest() { var output = (GsaLoadGoo)ComponentTestHelper.GetOutput(comp); var load = (GsaGridLineLoad)output.Value; Assert.Equal(7, load.LoadCase.Id); - Assert.Equal("(10,5) (20,6)(m)", load.ApiLoad.PolyLineDefinition); + Assert.Equal("(10" + GridLoadHelper.ListSeparator + "5) (20" + GridLoadHelper.ListSeparator + "6)(m)", load.ApiLoad.PolyLineDefinition); Assert.Equal(0, load.ApiLoad.PolyLineReference); Assert.Equal("myGridLineLoad", load.ApiLoad.Name); Assert.Equal(-5000, load.ApiLoad.ValueAtStart);