<?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 Update cursor on layer with attachments - Arcpy Runtime Error in Spatial Data Science Questions</title>
    <link>https://community.esri.com/t5/spatial-data-science-questions/update-cursor-on-layer-with-attachments-arcpy/m-p/120479#M317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I am trying to use an update cursor to update the geometry of several thousand features that were collected in ArcCollector (basically snapping lines to points based on a field in the line layers attributes). The features that were collected in ArcCollector have attachments and attachment relation tables, and it appears that this is causing some trouble when I run my arcpy script.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I get the following error when I try to open an UpdateCursor in Arcpy on the layer:&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="margin: 0in; margin-left: .375in; font-family: 'andale mono'; font-size: 11.0pt;"&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-family: 'andale mono'; font-size: 11.0pt;"&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 6, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-family: 'andale mono'; font-size: 11.0pt;"&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;RuntimeError: Objects in this class cannot be updated outside an edit session [Pipes]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I'm working in ArcGIS Pro.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;If I remove the attachments and attachment relations table from the geodatabase, I can run the script no problem. An alternative would be to run the script on just the geometry, then replace the geometry layer in the geodatabase that contains the attachment table and attachments. But this doesn't actually seem to work when I try to go about it in the catalog view.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I'm guessing this has something to do with the geodatabase version, or something along those lines. Any insight would be greatly appreciated. Thank you,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Mar 2019 14:41:52 GMT</pubDate>
    <dc:creator>TylerSchlachter</dc:creator>
    <dc:date>2019-03-12T14:41:52Z</dc:date>
    <item>
      <title>Update cursor on layer with attachments - Arcpy Runtime Error</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/update-cursor-on-layer-with-attachments-arcpy/m-p/120479#M317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I am trying to use an update cursor to update the geometry of several thousand features that were collected in ArcCollector (basically snapping lines to points based on a field in the line layers attributes). The features that were collected in ArcCollector have attachments and attachment relation tables, and it appears that this is causing some trouble when I run my arcpy script.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I get the following error when I try to open an UpdateCursor in Arcpy on the layer:&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="margin: 0in; margin-left: .375in; font-family: 'andale mono'; font-size: 11.0pt;"&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-family: 'andale mono'; font-size: 11.0pt;"&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 6, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-left: .375in; font-family: 'andale mono'; font-size: 11.0pt;"&gt;&lt;SPAN style="font-family: andale mono, monospace;"&gt;RuntimeError: Objects in this class cannot be updated outside an edit session [Pipes]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I'm working in ArcGIS Pro.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;If I remove the attachments and attachment relations table from the geodatabase, I can run the script no problem. An alternative would be to run the script on just the geometry, then replace the geometry layer in the geodatabase that contains the attachment table and attachments. But this doesn't actually seem to work when I try to go about it in the catalog view.&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;I'm guessing this has something to do with the geodatabase version, or something along those lines. Any insight would be greatly appreciated. Thank you,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2019 14:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/update-cursor-on-layer-with-attachments-arcpy/m-p/120479#M317</guid>
      <dc:creator>TylerSchlachter</dc:creator>
      <dc:date>2019-03-12T14:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on layer with attachments - Arcpy Runtime Error</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/update-cursor-on-layer-with-attachments-arcpy/m-p/120480#M318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tyler -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if in ArcPro using the arcgis module&amp;nbsp; look into the &lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.managers.html?highlight=start%20edit#version"&gt;Version&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/A&gt;operation in he submodules &lt;A href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.managers.html?highlight=start%20edit"&gt;arcgis.features.managers&lt;/A&gt;&amp;nbsp;it has the option to start a edit session. There are also other various editing module here as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can modify your current script to open an edit session (arcpy). Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;arcpy.env.workspace = workspace&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #008000; font-family: 'courier new', courier, monospace; "&gt;#start an edit session&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;edit = arcpy.da.Editor(workspace)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;# Edit session is started without an undo/redo stack for versioned data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;# (for second argument, use False for unversioned data): startEditing ({with_undo}, {multiuser_mode})&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;edit.startEditing(True, True)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;print ("start an edit session")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;# Start an edit operation&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;edit.startOperation()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier, monospace; "&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2019 15:11:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/update-cursor-on-layer-with-attachments-arcpy/m-p/120480#M318</guid>
      <dc:creator>JakeSimms1</dc:creator>
      <dc:date>2019-03-12T15:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor on layer with attachments - Arcpy Runtime Error</title>
      <link>https://community.esri.com/t5/spatial-data-science-questions/update-cursor-on-layer-with-attachments-arcpy/m-p/120481#M319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This worked. I wrapped the update cursor in an edit session. Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:42:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-data-science-questions/update-cursor-on-layer-with-attachments-arcpy/m-p/120481#M319</guid>
      <dc:creator>TylerSchlachter</dc:creator>
      <dc:date>2019-03-12T17:42:13Z</dc:date>
    </item>
  </channel>
</rss>

