<?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 How to end editing in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166567#M8051</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have one problem trying to create points in the middle of all sides of polygons, creating points is not a problem in itself, but the subsequent assignment of the name to which polygon belongs.&lt;/P&gt;&lt;P&gt;Here is an example of where I create points:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private async Task ListFilter(CancelableProgressorSource cps, uint steps, FeatureClass fc, FeatureLayer lyrList, QueryFilter queryFilter, string text, FeatureLayer points, string field)
        {
            await QueuedTask.Run(() =&amp;gt;
            {
                FeatureClass listFc = lyrList.GetTable() as FeatureClass;
                var polyCursor = fc.Search(queryFilter);
                cps.Progressor.Max = (uint)steps;
                cps.Progressor.Message = "Probíhá ";
                var createOperation = new EditOperation();
                createOperation.Name = "Generovani bodu";
                createOperation.SelectNewFeatures = false;
                while (polyCursor.MoveNext() &amp;amp;&amp;amp; !cps.Progressor.CancellationToken.IsCancellationRequested)
                {
                    cps.Progressor.Value += 1;
                    cps.Progressor.Status = cps.Progressor.Value + @" z " + cps.Progressor.Max + @" hotovo.";
                    var polyFeature1 = polyCursor.Current as Feature;
                    var polygonGeometry1 = polyFeature1.GetShape() as Polygon;
                    TableDefinition tableDefinition = listFc.GetDefinition();
                    int nameIndex = tableDefinition.FindField(text);
                    Row row = polyCursor.Current;
                    string nameNom = row.GetOriginalValue(nameIndex) as String;
                    var polylineBorder = new PolylineBuilder(polygonGeometry1).ToGeometry();
                    ReadOnlyPointCollection pts = polylineBorder.Points;
                    int quarterPts = polylineBorder.PointCount / 4;
                    int halfPts = polylineBorder.PointCount / 2;
                    List&amp;lt;MapPoint&amp;gt; pointList = new List&amp;lt;MapPoint&amp;gt;()
                    {
                        pts[0], pts[quarterPts], pts[halfPts], pts[quarterPts * 3]
                    }; 
                    foreach (var aMapPoint in pointList)
                    {
                        createOperation.Create(points, aMapPoint);
                    }
                    createOperation.Execute();
                    var spatialQueryInter = new SpatialQueryFilter()
                    {
                        FilterGeometry = polygonGeometry1,
                        SpatialRelationship = SpatialRelationship.Touches,
                    };
                    var polyCursor2 = points.Search(spatialQueryInter);
                    while (polyCursor2.MoveNext())
                    {
                        Row row1 = polyCursor2.Current;
                        row1[field] = nameNom.ToString();
                        row1.Store();// here it throws an error:ArcGIS.Core.Data.GeodatabaseRowException: 'Cannot call Store on a recycled row while editing.'

                    }

                }
            }, cps.Progressor);
        }&lt;/LI-CODE&gt;&lt;P&gt;So it occurred to me before naming the edit itself, but I don't know how or I don't know if it's a good solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will be happy for any help or advice.&lt;/P&gt;&lt;P&gt;Thank you David&lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 11:32:57 GMT</pubDate>
    <dc:creator>DavidMrázek</dc:creator>
    <dc:date>2022-04-21T11:32:57Z</dc:date>
    <item>
      <title>How to end editing</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166567#M8051</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have one problem trying to create points in the middle of all sides of polygons, creating points is not a problem in itself, but the subsequent assignment of the name to which polygon belongs.&lt;/P&gt;&lt;P&gt;Here is an example of where I create points:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private async Task ListFilter(CancelableProgressorSource cps, uint steps, FeatureClass fc, FeatureLayer lyrList, QueryFilter queryFilter, string text, FeatureLayer points, string field)
        {
            await QueuedTask.Run(() =&amp;gt;
            {
                FeatureClass listFc = lyrList.GetTable() as FeatureClass;
                var polyCursor = fc.Search(queryFilter);
                cps.Progressor.Max = (uint)steps;
                cps.Progressor.Message = "Probíhá ";
                var createOperation = new EditOperation();
                createOperation.Name = "Generovani bodu";
                createOperation.SelectNewFeatures = false;
                while (polyCursor.MoveNext() &amp;amp;&amp;amp; !cps.Progressor.CancellationToken.IsCancellationRequested)
                {
                    cps.Progressor.Value += 1;
                    cps.Progressor.Status = cps.Progressor.Value + @" z " + cps.Progressor.Max + @" hotovo.";
                    var polyFeature1 = polyCursor.Current as Feature;
                    var polygonGeometry1 = polyFeature1.GetShape() as Polygon;
                    TableDefinition tableDefinition = listFc.GetDefinition();
                    int nameIndex = tableDefinition.FindField(text);
                    Row row = polyCursor.Current;
                    string nameNom = row.GetOriginalValue(nameIndex) as String;
                    var polylineBorder = new PolylineBuilder(polygonGeometry1).ToGeometry();
                    ReadOnlyPointCollection pts = polylineBorder.Points;
                    int quarterPts = polylineBorder.PointCount / 4;
                    int halfPts = polylineBorder.PointCount / 2;
                    List&amp;lt;MapPoint&amp;gt; pointList = new List&amp;lt;MapPoint&amp;gt;()
                    {
                        pts[0], pts[quarterPts], pts[halfPts], pts[quarterPts * 3]
                    }; 
                    foreach (var aMapPoint in pointList)
                    {
                        createOperation.Create(points, aMapPoint);
                    }
                    createOperation.Execute();
                    var spatialQueryInter = new SpatialQueryFilter()
                    {
                        FilterGeometry = polygonGeometry1,
                        SpatialRelationship = SpatialRelationship.Touches,
                    };
                    var polyCursor2 = points.Search(spatialQueryInter);
                    while (polyCursor2.MoveNext())
                    {
                        Row row1 = polyCursor2.Current;
                        row1[field] = nameNom.ToString();
                        row1.Store();// here it throws an error:ArcGIS.Core.Data.GeodatabaseRowException: 'Cannot call Store on a recycled row while editing.'

                    }

                }
            }, cps.Progressor);
        }&lt;/LI-CODE&gt;&lt;P&gt;So it occurred to me before naming the edit itself, but I don't know how or I don't know if it's a good solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will be happy for any help or advice.&lt;/P&gt;&lt;P&gt;Thank you David&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 11:32:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166567#M8051</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-04-21T11:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to end editing</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166599#M8053</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;First thing, move 18-19 line before line 12. This is performance issue.&lt;/P&gt;&lt;P&gt;Second thing, EditOperation Execute method could be called only once. You call it in a cycle. There is 2 solution methods:&lt;/P&gt;&lt;P&gt;- move createOperation inside cycle.&lt;/P&gt;&lt;P&gt;- move Execute calling outside cycle.&lt;/P&gt;&lt;P&gt;Third thing. Store in 45 line could be used in EditOperation with callback. Mixing of different EditOperation approaches is not legal. You can use Modify method from EditOperation and call Execute after Modify (depending on the way you choose in second sugesstion).&amp;nbsp;&lt;/P&gt;&lt;P&gt;In some cases you can use chained operation.&lt;/P&gt;&lt;P&gt;More information here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#performing-edits-in-pro" target="_self"&gt;https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#performing-edits-in-pro&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 13:32:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166599#M8053</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-04-21T13:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to end editing</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166613#M8054</link>
      <description>&lt;P&gt;On line #40, set the recyclingCursor to `false`. It should store the row without exception.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var polyCursor2 = points.Search(spatialQueryInter, false);&lt;/LI-CODE&gt;&lt;P&gt;Additional info on &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-geodatabase#recycling" target="_self"&gt;recycling cursor.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 13:57:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166613#M8054</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2022-04-21T13:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to end editing</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166937#M8056</link>
      <description>&lt;P&gt;The link helped me a lot, thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 09:42:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-end-editing/m-p/1166937#M8056</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-04-22T09:42:02Z</dc:date>
    </item>
  </channel>
</rss>

