<?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 Editor confusing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686687#M53159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might even suggest not setting the edit session inside of the search. Set variable outside for search, and then call the session and then establish your search loop/update. Again, another thought.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Jul 2014 12:31:55 GMT</pubDate>
    <dc:creator>ToddUlery</dc:creator>
    <dc:date>2014-07-31T12:31:55Z</dc:date>
    <item>
      <title>Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686669#M53141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still new to arcpy and python. PLEASE can somebody explain why the first two lines of code create a runtime error, but the last two lines run fine?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14067096532091717" jivemacro_uid="_14067096532091717"&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; with arcpy.da.Editor(workspace) as edit:&lt;/P&gt;
&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.startEditing(False, True)&lt;/P&gt;
&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;Runtime error &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 2, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;AttributeError: 'Workspace Operation object' object has no attribute 'startEditing'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; edit = arcpy.da.Editor(workspace)&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; edit.startEditing(False, True)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THX!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 08:43:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686669#M53141</guid>
      <dc:creator>Geography</dc:creator>
      <dc:date>2014-07-30T08:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686670#M53142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From my reading, the with statement handles the appropriate start operations so you second line is superfluous as shown in Example 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 08:57:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686670#M53142</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-30T08:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686671#M53143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply Dan!! I though so, too. However, if I want to run the code (cf. below) I get another runtime error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;&amp;gt;&amp;gt;&amp;gt; with arcpy.da.Editor(workspace) as edit:&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(workspace+fc, ["Shape@","LineType"]) as ic:&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in fl:&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&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; ic.insertRow(f)&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&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; &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Runtime error &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Traceback (most recent call last):&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 4, in &amp;lt;module&amp;gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;RuntimeError: An edit operation is required.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using the with statement together with the edit.startOperation() also fails with the following runtime error - so I'm confused.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;&amp;gt;&amp;gt;&amp;gt; with arcpy.da.Editor(workspace) as edit:&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(workspace+fc, ["Shape@","LineType"]) as ic:&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in fl:&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&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; edit.startOperation()&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&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; ic.insertRow(f)&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&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; edit.stopOperation()&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&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; &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Runtime error &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Traceback (most recent call last):&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 4, in &amp;lt;module&amp;gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;AttributeError: 'Workspace Operation object' object has no attribute 'startOperation'&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw. Sorry but how do I format code in the answer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 09:27:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686671#M53143</guid>
      <dc:creator>Geography</dc:creator>
      <dc:date>2014-07-30T09:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686672#M53144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have a thing about with statements &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt; check the syntax in the arcpy.da.insertcursor of the help file for using insertcursors&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 09:40:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686672#M53144</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-30T09:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686673#M53145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please don't get mad at me, but I did cross check with the help file before, and the insertcursor seems to be okay, because it works nicely when I use it without the with edit statement. So PLEASE what am I missing? (FYI: I need to open an edit session, because I want to edit a feature class which is part of a topology feature data set.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 09:56:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686673#M53145</guid>
      <dc:creator>Geography</dc:creator>
      <dc:date>2014-07-30T09:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686674#M53146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can't help you with the latter part...thought you were editing simple features &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 13:15:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686674#M53146</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-30T13:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686675#M53147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never mind thanks anyway!! I think I'll post the entire code tomorrow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 14:12:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686675#M53147</guid>
      <dc:creator>Geography</dc:creator>
      <dc:date>2014-07-30T14:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686676#M53148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post the part of your code where you set the environement/workspace? I would like to look at that part.&lt;BR /&gt;Just to get more clarity on the situation.&lt;BR /&gt;The error is telling me that there is an issue there. An issue that says the object you have set does not work in an edit session.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 17:41:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686676#M53148</guid>
      <dc:creator>ToddUlery</dc:creator>
      <dc:date>2014-07-30T17:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686677#M53149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically what I want to archive: Create single lines out of one selected polyline with many vertex points. I do a cut, copy, and paste process as follows and it does the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14067838673489741 jive_text_macro" jivemacro_uid="_14067838673489741"&gt;
&lt;P&gt;# (cut)&lt;/P&gt;
&lt;P&gt;arcpy.SplitLine_management("FGK_t0_Line","line_tmpvar")&lt;/P&gt;
&lt;P&gt;arcpy.DeleteFeatures_management("FGK_t0_Line")&lt;/P&gt;
&lt;P&gt;env = EnvVar()&lt;/P&gt;
&lt;P&gt;cmd = Commands()&lt;/P&gt;
&lt;P&gt;# container for all lines (copy)&lt;/P&gt;
&lt;P&gt;fl=[]&lt;/P&gt;
&lt;P&gt;with arcpy.da.SearchCursor("line_tmpvar",["Shape@","LineType"]) as sc:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; for row in sc:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fl.append(row)&lt;/P&gt;
&lt;P&gt;# start edit session to insert (paste), because of topograpy relationship/feature dataset&lt;/P&gt;
&lt;P&gt;cmd.clsAllSelections()&lt;/P&gt;
&lt;P&gt;edit = arcpy.da.Editor(env.wd)&lt;/P&gt;
&lt;P&gt;edit.startEditing(False, True)&lt;/P&gt;
&lt;P&gt;edit.startOperation()&lt;/P&gt;
&lt;P&gt;with arcpy.da.InsertCursor(env.wd+r"\\TopoTestSet\\FGK_t0_Line", ["Shape@","LineType"]) as ic:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in fl:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ic.insertRow(f)&lt;/P&gt;
&lt;P&gt;edit.stopOperation()&lt;/P&gt;
&lt;P&gt;edit.stopEditing(True)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I would like to use the with edit command instead of the lines 13, 14, 15, 19 and 20. Therefore, I was trying to use it as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14067844153048169 jive_text_macro" jivemacro_uid="_14067844153048169"&gt;
&lt;P&gt;# (cut)&lt;/P&gt;
&lt;P&gt;arcpy.SplitLine_management("FGK_t0_Line","line_tmpvar")&lt;/P&gt;
&lt;P&gt;arcpy.DeleteFeatures_management("FGK_t0_Line")&lt;/P&gt;
&lt;P&gt;env = EnvVar()&lt;/P&gt;
&lt;P&gt;cmd = Commands()&lt;/P&gt;
&lt;P&gt;# container for all lines (copy)&lt;/P&gt;
&lt;P&gt;fl=[]&lt;/P&gt;
&lt;P&gt;with arcpy.da.SearchCursor("line_tmpvar",["Shape@","LineType"]) as sc:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; for row in sc:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fl.append(row)&lt;/P&gt;
&lt;P&gt;# start edit session to insert (paste), because of topograpy relationship/feature dataset&lt;/P&gt;
&lt;P&gt;cmd.clsAllSelections()&lt;/P&gt;
&lt;P&gt;with arcpy.da.Editor(env.wd) as edit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(env.wd+r"\\TopoTestSet\\FGK_t0_Line", ["Shape@","LineType"]) as ic:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in fl:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.startOperation()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ic.insertRow(f)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.stopOperation()&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It always fails with the runtime error:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14067845418189749 jive_text_macro" jivemacro_uid="_14067845418189749"&gt;
&lt;P&gt;Runtime error &lt;/P&gt;
&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 16, in &amp;lt;module&amp;gt;&lt;/P&gt;
&lt;P&gt;AttributeError: 'Workspace Operation object' object has no attribute 'startOperation'&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see I have all my environment settings saved in an object called "env", which worked in the first part. So what am I doing wrong?&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14067848974901249 jive_text_macro" jivemacro_uid="_14067848974901249"&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; print env.wd&lt;/P&gt;
&lt;P&gt;C:\Data\DigitestV02.gdb&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 05:35:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686677#M53149</guid>
      <dc:creator>Geography</dc:creator>
      <dc:date>2014-07-31T05:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686678#M53150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;Edit operations must be controlled within the context of an edit session, and edit operations cannot be nested within other edit operations.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;Refer: &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000005000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000005000000"&gt;ArcGIS Help 10.1&lt;/A&gt;‌&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;try calling edit.startEditing @ line 14.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 06:43:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686678#M53150</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-07-31T06:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686679#M53151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Riyas!! So you're suggesting I should avoid the insertcursor, because the help files talk about &lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt; Edit sessions and cursors&lt;/P&gt;
&lt;P&gt;Cursors should be scoped to a single edit operation. This means a new cursor should be instantiated and released for each operation. This is very important when editing rows returned by a cursor because the rows are tied to a specific state of the geodatabase. Avoid using a cursor across multiple edit operations. Doing so can result in&lt;STRONG&gt; unexpected behavior and data loss&lt;/STRONG&gt;.&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when using them? If so, how could I insert multiple records then?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 07:40:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686679#M53151</guid>
      <dc:creator>Geography</dc:creator>
      <dc:date>2014-07-31T07:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686680#M53152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;once the da.*cursor is established, they use the for row in cursor syntax&amp;nbsp;&amp;nbsp; See the da.updatecursor &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/UpdateCursor/018w00000014000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/UpdateCursor/018w00000014000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;‌ example, they use "for row in cursor" syntax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 08:05:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686680#M53152</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-31T08:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686681#M53153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right Dan. You can see from my code above that I'm using it already &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;. My problem seems to be the nesting of the "with edit" and "with cursor" structure. Otherwise, are you suggesting I could do the whole "cut, copy, paste procedure" within a single updatecursor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 08:39:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686681#M53153</guid>
      <dc:creator>Geography</dc:creator>
      <dc:date>2014-07-31T08:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686682#M53154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could give it a try if all the operations are being performed on a row by row basis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 08:43:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686682#M53154</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-31T08:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686683#M53155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try replacing your code line 13 through 18 with below, suspect this should work. Also make sure you are able to edit the feature class from arcmap independent of your script just in case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.Editor(env.wd) as edit:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; use False for unversioned data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.startEditing(False, True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.startOperation()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(env.wd+r"\\TopoTestSet\\FGK_t0_Line", ["Shape@","LineType"]) as ic:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for f in fl:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ic.insertRow(f)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.stopOperation()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; edit.stopEditing(True)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 08:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686683#M53155</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-07-31T08:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686684#M53156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again many thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Riyas I tried your suggestion, unfortunately it stops with the same runtime error. I'm confident that I can access, and edit the data, because the 1st section of the above code works.&lt;/P&gt;&lt;P&gt;Dan I'll consider your suggestion more seriously - it might be an even better solution. But I've to admit that I don't know if&amp;nbsp; it's possible to update one single part feature (one row) into many single part features (many rows).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 09:41:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686684#M53156</guid>
      <dc:creator>Geography</dc:creator>
      <dc:date>2014-07-31T09:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686685#M53157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the deconstruct option within the da.updatecursor section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/UpdateCursor/018w00000014000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/UpdateCursor/018w00000014000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 10:44:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686685#M53157</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-31T10:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686686#M53158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First thought, not a solution yet, but you do need to nest your actual edits inside the edit sessions. I think its ok to have a search outside, but if there are updates, they need to go inside the operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Riyas Deen suggests this already. Just wanted to stress that at minimum it should be considered. I am looking into edits with topology feature datasets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 12:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686686#M53158</guid>
      <dc:creator>ToddUlery</dc:creator>
      <dc:date>2014-07-31T12:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686687#M53159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might even suggest not setting the edit session inside of the search. Set variable outside for search, and then call the session and then establish your search loop/update. Again, another thought.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 12:31:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686687#M53159</guid>
      <dc:creator>ToddUlery</dc:creator>
      <dc:date>2014-07-31T12:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy da Editor confusing</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686688#M53160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;Still a litle confused about the env object.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;env = EnvVar()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;I assume you are setting this within a function you created. Need to look at that.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2014 13:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-editor-confusing/m-p/686688#M53160</guid>
      <dc:creator>ToddUlery</dc:creator>
      <dc:date>2014-07-31T13:05:12Z</dc:date>
    </item>
  </channel>
</rss>

