<?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: Editing Session in ModelBuilder or Python? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210831#M16302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;background geoprocessing can cause issues as you have found.&lt;/P&gt;&lt;P&gt;Some people want it, others find that certain tasks can't be done when it is on.&lt;/P&gt;&lt;P&gt;They use different versions of python in arcmap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/groups/technical-support/blog/2013/07/29/64-bit-vs-32-bit-python-explained"&gt;https://community.esri.com/groups/technical-support/blog/2013/07/29/64-bit-vs-32-bit-python-explained&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can make sure that you are using the correct version of python each time you run a script....or you can use ArcGIS Pro which is 64-bit and one version of python&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2018 22:44:25 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-09-19T22:44:25Z</dc:date>
    <item>
      <title>Editing Session in ModelBuilder or Python?</title>
      <link>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210828#M16299</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'm trying to update a warranty field in my water meter feature class. It is supposed to add 20 years to the installation date. I used ModelBuilder to get the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import arcpy module&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Local variables:&lt;BR /&gt;WMeter = "WMeter"&lt;BR /&gt;WMeter__2_ = WMeter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Calculate Field&lt;BR /&gt;arcpy.CalculateField_management(WMeter, "WarrantyDate", "DateAdd (\"yyyy\",20,[InstallDate] )", "VB", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I have to manually enter an edit session for this script to run correctly. If I'm not in an editing session it won't update the field the "WarrantyDate" field. Is there a way with Python or ModelBuilder to make it enter into an editing session? I've attempted:&lt;/P&gt;&lt;PRE class="" style="color: #393318; background-color: #eff0f1; border: 0px; margin: 0px 0px 1em; padding: 5px;"&gt;&lt;CODE style="background-color: #eff0f1; border: 0px; font-weight: inherit;"&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;edit &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;da&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;"&gt;Editor&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;workspace&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;edit&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;startEditing&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: 13px;"&gt;False&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: 13px;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;edit&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;startOperation&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"&gt;()&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but I always get:&lt;/P&gt;&lt;P&gt;ERROR 001049: ASync operations not allowed while editing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried swapping out the true/false statements to see if it would change anything but it doesn't seem to matter if each is true or false, I get ASync either way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 15:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210828#M16299</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-09-19T15:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Session in ModelBuilder or Python?</title>
      <link>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210829#M16300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll caution you that an edit session is only required in certain circumstances, and this is probably not one of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you remove anything to do with an edit session and change your calculate field statement to:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;WMeter&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WarrantyDate"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'DateAdd("yyyy",20,[InstallDate] )'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"VB"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I assume it's getting hung up on the escaped double-quote inside the statement, but not 100% sure.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 17:38:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210829#M16300</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-09-19T17:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Session in ModelBuilder or Python?</title>
      <link>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210830#M16301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After posting my initial question I realized that I was editing a layer that is a participant in a geometric network. That would require an edit session, right? I then also tested out turning background processing on and off. If background processing was turned off, I could run the above script and it would run as expected. I guess my next step is figuring out how to get it to always run with background processing off, unless there is a better solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 18:01:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210830#M16301</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-09-19T18:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Session in ModelBuilder or Python?</title>
      <link>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210831#M16302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;background geoprocessing can cause issues as you have found.&lt;/P&gt;&lt;P&gt;Some people want it, others find that certain tasks can't be done when it is on.&lt;/P&gt;&lt;P&gt;They use different versions of python in arcmap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/groups/technical-support/blog/2013/07/29/64-bit-vs-32-bit-python-explained"&gt;https://community.esri.com/groups/technical-support/blog/2013/07/29/64-bit-vs-32-bit-python-explained&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can make sure that you are using the correct version of python each time you run a script....or you can use ArcGIS Pro which is 64-bit and one version of python&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 22:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/editing-session-in-modelbuilder-or-python/m-p/210831#M16302</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-19T22:44:25Z</dc:date>
    </item>
  </channel>
</rss>

