<?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: How to check if in an Edit Session using python and arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344479#M27015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect! Just what I was looking for. Something that actually works and answers the problem. There are a lot of false leads in this thread that I had already tried.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2018 11:00:01 GMT</pubDate>
    <dc:creator>KimOllivier</dc:creator>
    <dc:date>2018-02-15T11:00:01Z</dc:date>
    <item>
      <title>How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344457#M26993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;I am currently working on a tool that uses the updateCursor function but the tool needs to be in an edit session to use. However some who may use the tool may end up not being in an edit session before running the tool and get an error. Rather than come ask me every time about the error, I'd like to implement an if statement in the script in the beginning that checks if the user is currently in an edit session, if they are then run tool. if not, a dialogue box explaining they need to be in an edit session and ask if they want the script to turn editor on. Formatted as such:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#if edit session is on:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#run tool&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#elif edit session is off:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#dialogue box explaining user has to be in edit session and asking if they want the script to turn editor on (Yes or no option):&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#if yes:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#run tool&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#if no:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#quit&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;I am trying to do this &lt;SPAN style="border: 0px; font-weight: bold;"&gt;&lt;STRONG&gt;without using&lt;/STRONG&gt;&lt;/SPAN&gt; the work done by Mark Cederholm as referenced in this post: &lt;A href="http://gis.stackexchange.com/questions/80/accessing-arcobjects-from-python" style="color: #358daa; border: 0px;" rel="nofollow noopener noreferrer" target="_blank"&gt;How do I access ArcObjects from Python?&lt;/A&gt;, and code examples provided by Matt Wilkie in his "Snippits.py" file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:13:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344457#M26993</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-11T16:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344458#M26994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you read up on the &lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/editor.htm"&gt;Editor in the help&lt;/A&gt;? &lt;/STRONG&gt;It would be best to run your functionality from a tool in arctoolbox, to ensure or validate that you are in an edit session than relying on the user getting into an edit session manually&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2017 21:26:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344458#M26994</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-03-08T21:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344459#M26995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan, I was thinking along the lines of the format I have below. This way users wouldn't have to turn editor on manually but just have to simply click yes or no. Would this work?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; isEditing &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; run tool
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; isEditing &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; dialogue box pops up informing user to be &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; edit session &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; ask &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; they want script to turn it on &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; them&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; yes&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; no&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:13:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344459#M26995</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-11T16:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344460#M26996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would just bail .... totally untested of course.&lt;/P&gt;&lt;DIV&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# -*- coding: UTF-8 -*-&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; sys
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;#edit_me = sys.argv[1]&lt;/SPAN&gt;
fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\GIS\array_projects\data\Pro_base.gdb\Line"&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
edit &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; edit&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"you are in an edit session"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"you aren't in an edit session"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;exit&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:13:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344460#M26996</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T16:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344461#M26997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good idea, unfortunately it doesn't seem to work.&amp;nbsp; I just tested a file and enterprise geodatabase, and &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;arcpy.da.Editor&lt;/SPAN&gt; appears to only be aware of itself, i.e., &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;isEditing()&lt;/SPAN&gt; only returns &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;True&lt;/SPAN&gt; if the instantiated editor object starts an edit session.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 16:40:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344461#M26997</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-03-09T16:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344462#M26998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If an edit session doesn't exist, when exactly does the user see the error?&amp;nbsp; Right away, or is it after the tool has ran for a while?&amp;nbsp; What is the function or method call that is generating the error?&amp;nbsp; What specifically is the error?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 16:42:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344462#M26998</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-03-09T16:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344463#M26999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua, so the error pops up milliseconds to like 2 seconds after you start running the tool. The tool is a custom export tool that has the function updateCursor function, which updates the fields to a particular value rather than leaving the blank fields as null values. The error states that updateCursor can not be used outside of the edit session and the rest of the tool does not run. Hence why I want to create this check to see if edit session is active and if not, to provide a prompt for the user that enables the user to select 'Yes' or 'No' to allow the script to turn an edit session on and then run the tool. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 16:50:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344463#M26999</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-03-09T16:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344464#M27000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yea we ran into this question&amp;nbsp;a couple weeks ago&amp;nbsp;where the Map Document and the arcpy Editor object aren't aware of each others editting status and their isn't a way to pythonicly check if an edit session is going on in the map document without using ArcObjects.&amp;nbsp; I pointed them to the below post but I'm not sure if they got anywhere with it or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/190456-arcpydaeditor-setup-for-tool"&gt;https://community.esri.com/thread/190456-arcpydaeditor-setup-for-tool&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://gis.stackexchange.com/questions/61708/checking-via-arcpy-if-arcmap-is-in-edit-session"&gt;http://gis.stackexchange.com/questions/61708/checking-via-arcpy-if-arcmap-is-in-edit-session&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 16:56:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344464#M27000</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-09T16:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344465#M27001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/iamurray"&gt;iamurray&lt;/A&gt;‌ provided some good links, I suggest you read over them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given the tools generates an error anywhere from "milliseconds to like 2 seconds," which is pretty quick (it isn't like it runs for tens of minutes and then errors out), I would go with a try except block.&amp;nbsp; Python handles EAFP (easier to ask forgiveness than permission) much better than other languages, so generating exceptions and handling them isn't seen as a big deal.&amp;nbsp; Unlike some of the code examples in the StackExchange thread that Ian referenced, you really don't want to trap all exceptions with a generic except clause.&amp;nbsp; It is better to trap the specific exception relating to edit sessions because you want other errors to still propagate through to the user.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 17:14:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344465#M27001</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-03-09T17:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344466#M27002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder if instead of trying to check if an edit session is going on, just check if a LOCK file is&amp;nbsp;present for that workspace the file you are hoping to edit is in for the file in question.&amp;nbsp; A file GDB creates a LOCK file of the same name regardless of whether it is being editted within an ArcMap Edit Session or using an Editor Object(FeatureClassName.ed.lock).&amp;nbsp; Its not perfect since obviously more than one person can be accessing the dataset and create a lock on it, but at least you can check if the data is being editted at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just spitballing here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 17:27:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344466#M27002</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-09T17:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344467#M27003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've never worked with exceptions before so I was wondering if you have an example of what it may look like and the formatting of the script&amp;nbsp;so I may try that out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 17:33:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344467#M27003</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-03-09T17:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344468#M27004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua, so it's actually a Runtime Error that says "Objects in this class cannot be updated outside an edit session [lists the feature class]." Then it says "Failed to execute (ToolName)." So there wasn't an error code you get and so I'm wondering if using exceptions would work then?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 17:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344468#M27004</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-03-09T17:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344469#M27005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something along the lines of:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# path to feature class&lt;/SPAN&gt;
fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# list of fields&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cur&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cur&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# functional code&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; RuntimeError &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; err&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"cannot be updated outside an edit session"&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; err&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddMessage&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"No edit session exists"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;raise&lt;/SPAN&gt; err‍‍‍‍‍‍‍‍‍‍‍‍
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:13:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344469#M27005</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T16:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344470#M27006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I believe doing it this way may actually work in a sense to get the Message Box using the python add-ins module. However, one issue I am having is doing the check to see which value from the message box the user selected. This is the first thing that happens when the user selects to use this tool. This is an add-in portion of the tool. Any help on figuring out how to call on the value in the Message Box will be helpful. The mb_type here is 4 so that the message box type is yes/no. Other mb_types and information about python add-ins can be found&amp;nbsp;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/The_pythonaddins_module/014p00000021000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;. So my issue is figuring out how to see if the Message Box value the user selected was a yes or a no.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; pythonaddins
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

toolPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'path to toolboox.tbx'&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'some workspace'&lt;/SPAN&gt;
editor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; editor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'true'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GPToolDialog&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;toolPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CustomExportTool'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; editor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'false'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"You must be in an edit session to run the Custom Export Tool. If you wish to turn an edit session on, please click 'yes'. If you do not wish to turn an edit session on, please click 'no'."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Turn Editor On?"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; MessageBox &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'yes'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GPToolDialog&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;toolPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CustomExportTool'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; MessageBox &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'no'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:13:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344470#M27006</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-11T16:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344471#M27007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The message box function returns a string, so provide a variable for the return string to get stored in:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;msg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"You must be in an edit session to run the Custom Export Tool. If you wish to turn an edit session on, please click 'yes'. If you do not wish to turn an edit session on, please click 'no'."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Turn Editor On?"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&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;BR /&gt;&amp;nbsp;Then check the value stored in the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 17:23:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344471#M27007</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-03-10T17:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344472#M27008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And would you define this variable at the beginning or where would you implement that variable in the code I have?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 17:37:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344472#M27008</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-03-10T17:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344473#M27009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Joshua&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just tried what you suggested but the Message Box did not pop up and so the value could not be stored. Any solutions on fixing this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 20:03:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344473#M27009</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-03-10T20:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344474#M27010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua is this what you had in mind?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; pythonaddins
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os

toolPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'path to toolboox.tbx'&lt;/SPAN&gt;
workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'some workspace'&lt;/SPAN&gt;
editor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Editor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; editor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'true'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GPToolDialog&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;toolPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CustomExportTool'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; editor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'false'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"You must be in an edit session to run the Custom Export Tool. If you wish to turn an edit session on, please click 'yes'. If you do not wish to turn an edit session on, please click 'no'."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Turn Editor On?"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; msg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"You must be in an edit session to run the Custom Export Tool. If you wish to turn an edit session on, please click 'yes'. If you do not wish to turn an edit session on, please click 'no'."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Turn Editor On?"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; msg &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'yes'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;startEditing&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GPToolDialog&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;toolPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CustomExportTool'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; msg &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'no'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:14:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344474#M27010</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-11T16:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344475#M27011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Several comments:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;As has been discussed throughout this thread, calling &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;isEditing&lt;/SPAN&gt; will always return &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;False&lt;/SPAN&gt; unless an edit session was started by calling &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;startEditing&lt;/SPAN&gt; because the Editor is only aware of itself, i.e., it can't tell if another edit session is already open on a workspace.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Even if the Editor was aware of more than itself, the code still wouldn't work because what is returned from calling &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;isEditing&lt;/SPAN&gt; are Python booleans, not strings.&amp;nbsp; The code would have to read:&amp;nbsp;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt; if editor.isEditing == True:&lt;/SPAN&gt; or simply &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;if editor.isEditing:&lt;/SPAN&gt; .&amp;nbsp; The same goes for how you are checking for false.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;When checking the return value from the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;MessageBox&lt;/SPAN&gt;, string comparisons are case sensitive.&amp;nbsp; Neither of the conditions as written will ever be met because what is returned is &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;'Yes'&lt;/SPAN&gt; or &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;'No'&lt;/SPAN&gt; .&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Mar 2017 15:45:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344475#M27011</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-03-11T15:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if in an Edit Session using python and arcpy</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344476#M27012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua, I am currently working on another tool where setting the user input equal to a variable is crucial. Is this the right way to do it in terms of setting the variable equal to something the user can do an input and then a conditional to check on what they input?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; editor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GPToolDialog&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;toolPath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CustomExportTool'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; editor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEditing &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&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="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; msg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&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="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; msg &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Yes'&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:14:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-in-an-edit-session-using-python/m-p/344476#M27012</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-11T16:14:04Z</dc:date>
    </item>
  </channel>
</rss>

