# Sequence contains no elements

Question asked by kireandreev on Nov 28, 2018
Latest reply on Nov 30, 2018 by JNery-esristaff

I developed custom arc with center, start and end point (code of arc) is:

Esri.ArcGISRuntime.Geometry.PointCollection pcol = new Esri.ArcGISRuntime.Geometry.PointCollection(SpatialReferences.WebMercator);
SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.FromRgb(0x00, 0x00, 0x00), 1);
SimpleMarkerSymbol redCircleSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Color.FromRgb(0xFF, 0x00, 0x00), 5);
if (points_Line.Count ==2)
{
//Create point collections
MapPoint point=new MapPoint(x, y,z, SpatialReferences.WebMercator);
double p1x = points_Line[1].X - points_Line[0].X;
double p1y = points_Line[1].Y - points_Line[0].Y;
double p2x = point.X - points_Line[0].X;
double p2y = point.Y - points_Line[0].Y;
double slice = 2 * Math.PI / 360;
CalculateAngle calculateAngle1 = new CalculateAngle(p1x, p1y);
CalculateAngle calculateAngle2 = new CalculateAngle(p2x, p2y);
double angle1 = calculateAngle1.Azimute();
double angle2 = calculateAngle2.Azimute();
double startAngle, endAngle, viewAngle;
Polyline polyline = new Polyline(points_Line);
double radius = Math.Round(GeometryEngine.LengthGeodetic(polyline, LinearUnits.Meters, GeodeticCurveType.Geodesic), 2);
Graphic graphicRad = new Graphic(polyline, lineSymbol);

if (angle1 >= angle2)
{
startAngle = angle2;
endAngle = angle1;
viewAngle = angle2;
for (double i = endAngle; i >= startAngle; i--)
{
double rad = slice * i;
}
}
else
{
startAngle = angle1;
endAngle = angle2;
viewAngle = angle2;
for (double i = startAngle; i <= endAngle; i++)
{
double rad = slice * i;
}
}

Polyline p = new Polyline(pcol);
// Create the graphic with polyline and symbol
Graphic graphicPoly = new Graphic(p, lineSymbol);

string id = GlobalVar.CountGraphic.ToString();

When intersect this arc with rectangle (code of rectangle) is:

var rectangle = await MyMapView.SketchEditor.StartAsync(SketchCreationMode.Rectangle, false);

appear next message:

How to solved this problem?