diff --git a/Lusas_Adapter/CRUD/Create/Create.cs b/Lusas_Adapter/CRUD/Create/Create.cs index c3b18fb3..fe7ff6d5 100644 --- a/Lusas_Adapter/CRUD/Create/Create.cs +++ b/Lusas_Adapter/CRUD/Create/Create.cs @@ -340,8 +340,6 @@ private bool CreateCollection(IEnumerable edges) { if (edges != null) { - List allPoints = new List(); - //Check List is not null and Curve is not invalid (i.e. not a Line) List validEdges = edges.Where(x => CheckPropertyError(x, y => y.Curve)) .Where(x => !Engine.Adapters.Lusas.Query.InvalidEdge(x)).ToList(); @@ -355,19 +353,10 @@ private bool CreateCollection(IEnumerable edges) distinctEdges.Add(edge); } - distinctEdges = Engine.Adapters.Lusas.Query.GetDistinctEdges(distinctEdges); - - foreach (Edge edge in distinctEdges) - { - allPoints.Add(edge.Curve.IStartPoint()); - allPoints.Add(edge.Curve.IEndPoint()); - } - - List distinctPoints = Engine.Adapters.Lusas.Query.GetDistinctPoints(allPoints); + List distinctPoints = distinctEdges.Select(x => x.Curve.IStartPoint()).Union(edges.Select(x => x.Curve.IEndPoint())).ToList(); List existingPoints = ReadPoints(); - List pointsToPush = distinctPoints.Except( - existingPoints, new PointDistanceComparer()).ToList(); + List pointsToPush = distinctPoints.Except(existingPoints, new PointDistanceComparer()).ToList(); ReduceRuntime(true); @@ -378,13 +367,9 @@ private bool CreateCollection(IEnumerable edges) ReduceRuntime(false); - List lusasPoints = ReadLusasPoints(); - List points = new List(); + List points = ReadPoints(); - foreach (IFPoint point in lusasPoints) - { - points.Add(Adapters.Lusas.Convert.ToPoint(point)); - } + List lusasPoints = ReadLusasPoints(); CreateTags(distinctEdges);