<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Move Arc graphic in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/move-arc-graphic/m-p/333633#M1662</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have Arc graphic and i like to move.I am using next code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esri.ArcGISRuntime.Geometry.PointCollection points_Move_Arc = new Esri.ArcGISRuntime.Geometry.PointCollection(new SpatialReference(WKID));&lt;BR /&gt; Esri.ArcGISRuntime.Geometry.PointCollection points_End_Arc = new Esri.ArcGISRuntime.Geometry.PointCollection(new SpatialReference(WKID));&lt;/P&gt;&lt;P&gt;Polyline coords = GlobalVar.Overlay_Graphic.Graphics&lt;G&gt;.Geometry as Polyline;&lt;BR /&gt; var countCoord = coords.Parts.First().Points;&lt;BR /&gt; for (int i = 0; i &amp;lt; countCoord.Count; i++)&lt;BR /&gt; {&lt;BR /&gt; points_Move_Arc.Add(new MapPoint(Convert.ToDouble(coords.Parts.First().StartPoint.X), Convert.ToDouble(coords.Parts.First().StartPoint.Y), Convert.ToDouble(coords.Parts.First().StartPoint.Z), new SpatialReference(WKID)));&lt;BR /&gt; var second_Start = GeometryEngine.MoveGeodetic(points_Move_Arc, distance, LinearUnits.Meters, angle, AngularUnits.Degrees, GeodeticCurveType.Geodesic).First();&lt;BR /&gt; points_End_Arc.Add(new MapPoint(second_Start.X, second_Start.Y, second_Start.Z, new SpatialReference(WKID)));&lt;BR /&gt; points_Move_Arc.Clear();&lt;BR /&gt; points_Move_Arc.Add(new MapPoint(Convert.ToDouble(coords.Parts.First().EndPoint.X), Convert.ToDouble(coords.Parts.First().EndPoint.Y), Convert.ToDouble(coords.Parts.First().EndPoint.Z), new SpatialReference(WKID)));&lt;BR /&gt; var second_End = GeometryEngine.MoveGeodetic(points_Move_Arc, distance, LinearUnits.Meters, angle, AngularUnits.Degrees, GeodeticCurveType.Geodesic).First();&lt;BR /&gt; points_End_Arc.Add(new MapPoint(second_End.X, second_End.Y, second_End.Z, new SpatialReference(WKID)));&lt;BR /&gt; points_Move_Arc.Clear();&lt;BR /&gt; }&lt;BR /&gt; Arc arc = new Arc(GlobalVar.Overlay_Graphic, points_End_Arc, ClickPoint, myItemList);&lt;BR /&gt; arc.CreateArcMove();&lt;/G&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code for create Arc graphic is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esri.ArcGISRuntime.Geometry.PointCollection pcol = new Esri.ArcGISRuntime.Geometry.PointCollection(new SpatialReference(WKID));&lt;BR /&gt; &lt;BR /&gt; if (points_Line.Count ==2)&lt;BR /&gt; {&lt;BR /&gt; //Create point collections&lt;BR /&gt; MapPoint point=new MapPoint(x, y,z, new SpatialReference(WKID));&lt;BR /&gt; double p1x = points_Line[1].X - points_Line[0].X;&lt;BR /&gt; double p1y = points_Line[1].Y - points_Line[0].Y;&lt;BR /&gt; double p2x = point.X - points_Line[0].X;&lt;BR /&gt; double p2y = point.Y - points_Line[0].Y;&lt;BR /&gt; double slice = 2 * Math.PI / 360;&lt;BR /&gt; CalculateAngle calculateAngle1 = new CalculateAngle(p1x, p1y);&lt;BR /&gt; CalculateAngle calculateAngle2 = new CalculateAngle(p2x, p2y);&lt;BR /&gt; double angle1 = calculateAngle1.Azimute();&lt;BR /&gt; double angle2 = calculateAngle2.Azimute();&lt;BR /&gt; double startAngle, endAngle, viewAngle;&lt;/P&gt;&lt;P&gt;//double radius = Math.Sqrt((p1x * p1x) + (p1y * p1y));&lt;BR /&gt; Polyline polyline = new Polyline(points_Line);&lt;BR /&gt; double radius = Math.Round(GeometryEngine.LengthGeodetic(polyline, LinearUnits.Meters, GeodeticCurveType.Geodesic), 2);&lt;BR /&gt; Graphic graphicRad = new Graphic(polyline, lineSymbol);&lt;BR /&gt; _overlay_PolylineRevers.Graphics.Add(graphicRad);&lt;/P&gt;&lt;P&gt;if (angle1 &amp;gt;= angle2)&lt;BR /&gt; {&lt;BR /&gt; startAngle = angle2;&lt;BR /&gt; endAngle = angle1;&lt;BR /&gt; viewAngle = angle2;&lt;BR /&gt; for (double i = endAngle; i &amp;gt;= startAngle; i--)&lt;BR /&gt; {&lt;BR /&gt; double rad = slice * i;&lt;BR /&gt; double px = points_Line[0].X + radius * Math.Sin(rad);&lt;BR /&gt; double py = points_Line[0].Y + radius * Math.Cos(rad);&lt;BR /&gt; pcol.Add(new MapPoint(px, py, new SpatialReference(WKID))); &lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; startAngle = angle1;&lt;BR /&gt; endAngle = angle2;&lt;BR /&gt; viewAngle = angle2;&lt;BR /&gt; for (double i = startAngle; i &amp;lt;= endAngle; i++)&lt;BR /&gt; {&lt;BR /&gt; double rad = slice * i;&lt;BR /&gt; double px = points_Line[0].X + radius * Math.Sin(rad);&lt;BR /&gt; double py = points_Line[0].Y + radius * Math.Cos(rad);&lt;BR /&gt; pcol.Add(new MapPoint(px, py, new SpatialReference(WKID))); &lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; //Put first point on arc&lt;BR /&gt; ////Graphic _pointStart = new Graphic(new MapPoint(pcol[0].X, pcol[0].Y, new SpatialReference(WKID)), redCircleSymbol);&lt;BR /&gt; ////_overlay_Polyline.Graphics.Add(_pointStart);&lt;BR /&gt; //////Put second point on arc&lt;BR /&gt; ////Graphic _pointEnd = new Graphic(new MapPoint(pcol[pcol.Count - 1].X, pcol[pcol.Count - 1].Y, new SpatialReference(WKID)), redCircleSymbol);&lt;BR /&gt; ////_overlay_Polyline.Graphics.Add(_pointEnd);&lt;BR /&gt; Polyline p = new Polyline(pcol);&lt;BR /&gt; // Create the graphic with polyline and symbol&lt;BR /&gt; Graphic graphicPoly = new Graphic(p, lineSymbol);&lt;BR /&gt; // Add graphic to the graphics overlay&lt;BR /&gt; //_overlay_Graphic.Graphics.Add(graphicPoly);&lt;BR /&gt; Random r = new Random();&lt;BR /&gt; // string id = "Arc." + r.Next(1, 100);&lt;BR /&gt; //Add atribute&lt;BR /&gt; string id = GlobalVar.CountGraphic.ToString();&lt;BR /&gt; graphicPoly.Attributes.Add("UID", id);&lt;BR /&gt; graphicPoly.Attributes.Add("Label", " ");&lt;BR /&gt; graphicPoly.Attributes.Add("Type", "arc");&lt;BR /&gt; graphicPoly.Attributes.Add("Xcenter", GlobalVar.Points_Arc[0].X.ToString());&lt;BR /&gt; graphicPoly.Attributes.Add("Ycenter", GlobalVar.Points_Arc[0].Y.ToString());&lt;BR /&gt; _overlay_Polyline.Graphics.Add(graphicPoly); &lt;BR /&gt; if (GlobalVar.CountA3P == 0)&lt;BR /&gt; {&lt;BR /&gt; //Add layer&lt;BR /&gt; // Legend constLeg = new Legend(myItemList, Form.lstItem, _overlay_Polyline, "Construction", true, 0);&lt;BR /&gt; Legend constLeg = new Legend(myItemList, Form.lstItem, _overlay_Polyline, GlobalVar.Overlay_Graphic_Label, "Construction", "ConstructionGraphic", "ConstructionLabel", true, 0);&lt;/P&gt;&lt;P&gt;constLeg.CreatConstruction();&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before move Arc graph look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/437316_pastedImage_1.png" /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After move look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/437317_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to solved this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Feb 2019 21:33:18 GMT</pubDate>
    <dc:creator>KiroAndreev1</dc:creator>
    <dc:date>2019-02-13T21:33:18Z</dc:date>
    <item>
      <title>Move Arc graphic</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/move-arc-graphic/m-p/333633#M1662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have Arc graphic and i like to move.I am using next code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esri.ArcGISRuntime.Geometry.PointCollection points_Move_Arc = new Esri.ArcGISRuntime.Geometry.PointCollection(new SpatialReference(WKID));&lt;BR /&gt; Esri.ArcGISRuntime.Geometry.PointCollection points_End_Arc = new Esri.ArcGISRuntime.Geometry.PointCollection(new SpatialReference(WKID));&lt;/P&gt;&lt;P&gt;Polyline coords = GlobalVar.Overlay_Graphic.Graphics&lt;G&gt;.Geometry as Polyline;&lt;BR /&gt; var countCoord = coords.Parts.First().Points;&lt;BR /&gt; for (int i = 0; i &amp;lt; countCoord.Count; i++)&lt;BR /&gt; {&lt;BR /&gt; points_Move_Arc.Add(new MapPoint(Convert.ToDouble(coords.Parts.First().StartPoint.X), Convert.ToDouble(coords.Parts.First().StartPoint.Y), Convert.ToDouble(coords.Parts.First().StartPoint.Z), new SpatialReference(WKID)));&lt;BR /&gt; var second_Start = GeometryEngine.MoveGeodetic(points_Move_Arc, distance, LinearUnits.Meters, angle, AngularUnits.Degrees, GeodeticCurveType.Geodesic).First();&lt;BR /&gt; points_End_Arc.Add(new MapPoint(second_Start.X, second_Start.Y, second_Start.Z, new SpatialReference(WKID)));&lt;BR /&gt; points_Move_Arc.Clear();&lt;BR /&gt; points_Move_Arc.Add(new MapPoint(Convert.ToDouble(coords.Parts.First().EndPoint.X), Convert.ToDouble(coords.Parts.First().EndPoint.Y), Convert.ToDouble(coords.Parts.First().EndPoint.Z), new SpatialReference(WKID)));&lt;BR /&gt; var second_End = GeometryEngine.MoveGeodetic(points_Move_Arc, distance, LinearUnits.Meters, angle, AngularUnits.Degrees, GeodeticCurveType.Geodesic).First();&lt;BR /&gt; points_End_Arc.Add(new MapPoint(second_End.X, second_End.Y, second_End.Z, new SpatialReference(WKID)));&lt;BR /&gt; points_Move_Arc.Clear();&lt;BR /&gt; }&lt;BR /&gt; Arc arc = new Arc(GlobalVar.Overlay_Graphic, points_End_Arc, ClickPoint, myItemList);&lt;BR /&gt; arc.CreateArcMove();&lt;/G&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code for create Arc graphic is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esri.ArcGISRuntime.Geometry.PointCollection pcol = new Esri.ArcGISRuntime.Geometry.PointCollection(new SpatialReference(WKID));&lt;BR /&gt; &lt;BR /&gt; if (points_Line.Count ==2)&lt;BR /&gt; {&lt;BR /&gt; //Create point collections&lt;BR /&gt; MapPoint point=new MapPoint(x, y,z, new SpatialReference(WKID));&lt;BR /&gt; double p1x = points_Line[1].X - points_Line[0].X;&lt;BR /&gt; double p1y = points_Line[1].Y - points_Line[0].Y;&lt;BR /&gt; double p2x = point.X - points_Line[0].X;&lt;BR /&gt; double p2y = point.Y - points_Line[0].Y;&lt;BR /&gt; double slice = 2 * Math.PI / 360;&lt;BR /&gt; CalculateAngle calculateAngle1 = new CalculateAngle(p1x, p1y);&lt;BR /&gt; CalculateAngle calculateAngle2 = new CalculateAngle(p2x, p2y);&lt;BR /&gt; double angle1 = calculateAngle1.Azimute();&lt;BR /&gt; double angle2 = calculateAngle2.Azimute();&lt;BR /&gt; double startAngle, endAngle, viewAngle;&lt;/P&gt;&lt;P&gt;//double radius = Math.Sqrt((p1x * p1x) + (p1y * p1y));&lt;BR /&gt; Polyline polyline = new Polyline(points_Line);&lt;BR /&gt; double radius = Math.Round(GeometryEngine.LengthGeodetic(polyline, LinearUnits.Meters, GeodeticCurveType.Geodesic), 2);&lt;BR /&gt; Graphic graphicRad = new Graphic(polyline, lineSymbol);&lt;BR /&gt; _overlay_PolylineRevers.Graphics.Add(graphicRad);&lt;/P&gt;&lt;P&gt;if (angle1 &amp;gt;= angle2)&lt;BR /&gt; {&lt;BR /&gt; startAngle = angle2;&lt;BR /&gt; endAngle = angle1;&lt;BR /&gt; viewAngle = angle2;&lt;BR /&gt; for (double i = endAngle; i &amp;gt;= startAngle; i--)&lt;BR /&gt; {&lt;BR /&gt; double rad = slice * i;&lt;BR /&gt; double px = points_Line[0].X + radius * Math.Sin(rad);&lt;BR /&gt; double py = points_Line[0].Y + radius * Math.Cos(rad);&lt;BR /&gt; pcol.Add(new MapPoint(px, py, new SpatialReference(WKID))); &lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; startAngle = angle1;&lt;BR /&gt; endAngle = angle2;&lt;BR /&gt; viewAngle = angle2;&lt;BR /&gt; for (double i = startAngle; i &amp;lt;= endAngle; i++)&lt;BR /&gt; {&lt;BR /&gt; double rad = slice * i;&lt;BR /&gt; double px = points_Line[0].X + radius * Math.Sin(rad);&lt;BR /&gt; double py = points_Line[0].Y + radius * Math.Cos(rad);&lt;BR /&gt; pcol.Add(new MapPoint(px, py, new SpatialReference(WKID))); &lt;BR /&gt; } &lt;BR /&gt; }&lt;BR /&gt; //Put first point on arc&lt;BR /&gt; ////Graphic _pointStart = new Graphic(new MapPoint(pcol[0].X, pcol[0].Y, new SpatialReference(WKID)), redCircleSymbol);&lt;BR /&gt; ////_overlay_Polyline.Graphics.Add(_pointStart);&lt;BR /&gt; //////Put second point on arc&lt;BR /&gt; ////Graphic _pointEnd = new Graphic(new MapPoint(pcol[pcol.Count - 1].X, pcol[pcol.Count - 1].Y, new SpatialReference(WKID)), redCircleSymbol);&lt;BR /&gt; ////_overlay_Polyline.Graphics.Add(_pointEnd);&lt;BR /&gt; Polyline p = new Polyline(pcol);&lt;BR /&gt; // Create the graphic with polyline and symbol&lt;BR /&gt; Graphic graphicPoly = new Graphic(p, lineSymbol);&lt;BR /&gt; // Add graphic to the graphics overlay&lt;BR /&gt; //_overlay_Graphic.Graphics.Add(graphicPoly);&lt;BR /&gt; Random r = new Random();&lt;BR /&gt; // string id = "Arc." + r.Next(1, 100);&lt;BR /&gt; //Add atribute&lt;BR /&gt; string id = GlobalVar.CountGraphic.ToString();&lt;BR /&gt; graphicPoly.Attributes.Add("UID", id);&lt;BR /&gt; graphicPoly.Attributes.Add("Label", " ");&lt;BR /&gt; graphicPoly.Attributes.Add("Type", "arc");&lt;BR /&gt; graphicPoly.Attributes.Add("Xcenter", GlobalVar.Points_Arc[0].X.ToString());&lt;BR /&gt; graphicPoly.Attributes.Add("Ycenter", GlobalVar.Points_Arc[0].Y.ToString());&lt;BR /&gt; _overlay_Polyline.Graphics.Add(graphicPoly); &lt;BR /&gt; if (GlobalVar.CountA3P == 0)&lt;BR /&gt; {&lt;BR /&gt; //Add layer&lt;BR /&gt; // Legend constLeg = new Legend(myItemList, Form.lstItem, _overlay_Polyline, "Construction", true, 0);&lt;BR /&gt; Legend constLeg = new Legend(myItemList, Form.lstItem, _overlay_Polyline, GlobalVar.Overlay_Graphic_Label, "Construction", "ConstructionGraphic", "ConstructionLabel", true, 0);&lt;/P&gt;&lt;P&gt;constLeg.CreatConstruction();&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before move Arc graph look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/437316_pastedImage_1.png" /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After move look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/437317_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to solved this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 21:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/move-arc-graphic/m-p/333633#M1662</guid>
      <dc:creator>KiroAndreev1</dc:creator>
      <dc:date>2019-02-13T21:33:18Z</dc:date>
    </item>
  </channel>
</rss>

