<?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 Re: arcpy.da.UpdateCursor &amp;amp;quot;SHAPE@&amp;amp;quot; error when updating M-values in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184810#M14242</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scott and Ed: This issue will be resolved in the next release of ArcGIS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Sep 2015 17:52:00 GMT</pubDate>
    <dc:creator>ShaunWalbridge</dc:creator>
    <dc:date>2015-09-08T17:52:00Z</dc:date>
    <item>
      <title>arcpy.da.UpdateCursor SHAPE@ error when updating M-values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184808#M14240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;When updating M-values in a feature class using the data access module, I encounter the error below when I run the following code on a selected segment in ArcMap using a Python Add-In call to a Python tool. However, the M-values still update. I am wondering if this is a bug. I also tried this using "SHAPE@JSON" and got the same error, but the M-values still updated. Anybody else have this issue, or have some insight on why this error is being thrown?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am doing this inside an ArcMap edit session (ESRI Editor). After I run the da.updateCursor, I do some other non 'da' updates, so the commits get pushed through SDE to the underlying SQLServer database. I am on 10.2.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import json, math 
lin_ref = {'MILEPOST_FR': 1, 'MILEPOST_TO': 10} 
with arcpy.da.UpdateCursor(segmentfc,["SHAPE@"]) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; json_obj = json.loads(row[0].JSON)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mp_to = len(json_obj['paths'][0]) - 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fulldist = row[0].getLength('PLANAR', 'FEET')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; conversionfactor = (math.fabs(lin_ref['MILEPOST_TO'] 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - lin_ref['MILEPOST_FR']) / fulldist)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i,v in enumerate(json_obj['paths'][0]):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; json_obj['paths'][0]&lt;I&gt;[2] = float(lin_ref['MILEPOST_FR'])&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # distance in map units between last vertex and current vertex
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x1vert = json_obj['paths'][0]&lt;I&gt;[0] - json_obj['paths'][0][i-1][0]&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y1vert = json_obj['paths'][0]&lt;I&gt;[1] - json_obj['paths'][0][i-1][1]&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vertdist = math.sqrt(x1vert**2 + y1vert**2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vert_lrdist = vertdist * conversionfactor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; json_obj['paths'][0]&lt;I&gt;[2] =&amp;nbsp; json_obj['paths'][0][i-1][2] + float(vert_lrdist)&lt;/I&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for feature in json_obj['paths']:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pline = arcpy.Polyline(arcpy.Array(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [arcpy.Point(X=coords[0], Y=coords[1], M=coords[2])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for coords in feature]), row[0].spatialReference, False, True)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = pline
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&amp;nbsp; 

Traceback (most recent call last):&amp;nbsp;&amp;nbsp; 
File "&amp;lt;string&amp;gt;", line 1896, in execute SystemError: error return without exception set&lt;/PRE&gt;&lt;P class="plain"&gt;&lt;/P&gt;&lt;P class="plain"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;The line where the error occurs is &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;cursor.updateRow(row)&lt;/PRE&gt;&lt;DIV style="display: none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:22:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184808#M14240</guid>
      <dc:creator>EdFarrell</dc:creator>
      <dc:date>2021-12-11T09:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.UpdateCursor &amp;quot;SHAPE@&amp;quot; error when updating M-values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184809#M14241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever solve your problem? I'm having a similar issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 15:52:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184809#M14241</guid>
      <dc:creator>ScottDavis</dc:creator>
      <dc:date>2015-09-03T15:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.UpdateCursor &amp;quot;SHAPE@&amp;quot; error when updating M-values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184810#M14242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scott and Ed: This issue will be resolved in the next release of ArcGIS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 17:52:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184810#M14242</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2015-09-08T17:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.UpdateCursor &amp;quot;SHAPE@&amp;quot; error when updating M-values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184811#M14243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What was the next release of ArcGIS and would this be patched in 10.2.1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2016 21:58:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184811#M14243</guid>
      <dc:creator>SteveClark</dc:creator>
      <dc:date>2016-04-12T21:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.UpdateCursor &amp;quot;SHAPE@&amp;quot; error when updating M-values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184812#M14244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Old thread...but&lt;/P&gt;&lt;P&gt;I believe 10.4.0 was released after Sept 2015, so maybe, per Shaun "This issue will be resolved in the next release of ArcGIS."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10.4.1&amp;nbsp; was rumored to be released in June, before the UC....but I typically take that as a target date and don't hold them to it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 00:17:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184812#M14244</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-04-13T00:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.UpdateCursor SHAPE@ error when updating M-values</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184813#M14245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the issue was resolved in 10.4.0. It isn't identified as a candidate for service packs, so won't make it into 10.2.1. That said, there is a workaround -- write to a FGDB data source instead of a Shapefile.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 19:37:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-updatecursor-shape-error-when-updating-m/m-p/184813#M14245</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2016-04-13T19:37:49Z</dc:date>
    </item>
  </channel>
</rss>

