Skip to content

Commit

Permalink
GSAGH-384 ListSeparator
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilman Reinhardt committed Oct 5, 2023
1 parent e807abf commit bb4e3cc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions GsaGH/Parameters/3_Loads/GridLoadHelper.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using OasysUnits;
using System.Globalization;
using System;
using OasysUnits;
using Rhino.Collections;
using Rhino.Geometry;
using LengthUnit = OasysUnits.Units.LengthUnit;

namespace GsaGH.Parameters {
internal static class GridLoadHelper {
private static readonly char ListSeparator = Convert.ToChar(CultureInfo.CurrentCulture.TextInfo.ListSeparator);

internal static string CreateDefinition(Point3dList controlPoints, Plane plane) {
string desc = string.Empty;
for (int i = 0; i < controlPoints.Count; i++) {
Expand Down Expand Up @@ -32,8 +36,8 @@ internal static Point3dList ConvertPoints(string definition, LengthUnit desiredU
foreach (string ptStr in pts) {
if (ptStr != string.Empty) {
string pt = ptStr.Replace("(", string.Empty).Trim();
var x = new Length(double.Parse(pt.Split(',')[0]), lengthUnit);
var y = new Length(double.Parse(pt.Split(',')[1]), lengthUnit);
var x = new Length(double.Parse(pt.Split(ListSeparator)[0]), lengthUnit);
var y = new Length(double.Parse(pt.Split(ListSeparator)[1]), lengthUnit);
var point = new Point3d(x.As(desiredUnit), y.As(desiredUnit), 0);
point.Transform(map);
points.Add(point);
Expand Down

0 comments on commit bb4e3cc

Please sign in to comment.