<?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.InsertCursor only inserting last row in list of data in ArcAPI Questions</title>
    <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716401#M3</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you send a screenshot of the contents of the lines list? &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Oct 2017 13:32:05 GMT</pubDate>
    <dc:creator>MitchHolley1</dc:creator>
    <dc:date>2017-10-18T13:32:05Z</dc:date>
    <item>
      <title>arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716399#M1</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm working on a script that gathers a bunch of line geometry (created using arcpy.Polyline function) into a list (called lines in the script), and then inserts this geometry into an empty polygon featureclass (called outln_m in the script). However, for some reason, only the last item in the list is there in the output polyline featureclass after the script runs, and I'm baffled. Can anyone shed some light on what might be causing this? I checked and all my cursor/row objects are being deleted before creating a new cursor. I tried wrapping the whole thing in an editor session but that did not change the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="380315" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/380315_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the result of my debugging print statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="380316" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/380316_pastedImage_2.png" style="width: 620px; height: 510px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see the list contains 25 items, but only one record is written to the output featureclass after running the list through a for-loop. That record happens to always be the last item in the list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for any help! I'm sure I'm missing something obvious.. I just can't see it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 20:40:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716399#M1</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-17T20:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716400#M2</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sharing with &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌ for more visibility since this is ArcPy related.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share a bit more about your geometries?&amp;nbsp; The fact that the __repr__ shows "geoprocessing describe ..." makes me think you don't have ArcPy geometries since they typical have a __repr__ of "Polyline object at...".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 21:23:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716400#M2</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-10-17T21:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716401#M3</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you send a screenshot of the contents of the lines list? &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 13:32:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716401#M3</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-10-18T13:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716402#M4</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmmm try adding a cursor.reset() in your code next time you run it... I have found a few sketchy situations where using cursors once results in either the last element being used the next time, or an empty value... I think it is a generator/list thing, but a reset to make sure it is at the beginning can't hurt.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sadly their cursor examples are lacking in those things that are 'code killers'&lt;/P&gt;&lt;P&gt;Examples of things that cause code failures would be more useful than just the success stories&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 14:08:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716402#M4</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-18T14:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716403#M5</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Holley, the contents of the list is printed out by the script (one line per item in the list) as seen in my original post. I've added a print statement for the raw list as well, see below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/380359_pastedImage_1.png" style="width: 620px; height: 596px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 15:18:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716403#M5</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-18T15:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716404#M6</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need to insert actual coordinate values and not geometry objects.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 15:24:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716404#M6</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-10-18T15:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716405#M7</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua, yupp. The entire script is tool long I think, here are the relevant excerpts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I create empty lists (including one for lines), then I start a cursor to go through a points featureclass and find start and end points for a transect line I draw. Then I produce the line array object using those points.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: gray; background-color: inherit; border: none;"&gt;##Step&amp;nbsp;through&amp;nbsp;each&amp;nbsp;point&amp;nbsp;in&amp;nbsp;temp_inpt_lyr.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"Stepping&amp;nbsp;through&amp;nbsp;each&amp;nbsp;top&amp;nbsp;of&amp;nbsp;dam&amp;nbsp;point&amp;nbsp;and&amp;nbsp;finding&amp;nbsp;bottom&amp;nbsp;of&amp;nbsp;dam&amp;nbsp;point&amp;nbsp;and&amp;nbsp;corresponding&amp;nbsp;elevation..."&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;bt_points,&amp;nbsp;txt_data,&amp;nbsp;lines&amp;nbsp;=&amp;nbsp;[],&amp;nbsp;[],&amp;nbsp;[]&amp;nbsp;##bottom&amp;nbsp;points&amp;nbsp;geometry,&amp;nbsp;output&amp;nbsp;data&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;csv&amp;nbsp;table,&amp;nbsp;and&amp;nbsp;line&amp;nbsp;geometry&amp;nbsp;are&amp;nbsp;stored&amp;nbsp;in&amp;nbsp;these&amp;nbsp;lists.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;cursor&amp;nbsp;=&amp;nbsp;arcpy.da.SearchCursor(temp_inpt_lyr,&amp;nbsp;[&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"START_X"&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"START_Y"&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"UNIT_VECTOR_X"&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"UNIT_VECTOR_Y"&lt;/SPAN&gt;,&amp;nbsp;fid])&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;row&amp;nbsp;in&amp;nbsp;cursor:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(row[4])&amp;nbsp;##Print&amp;nbsp;the&amp;nbsp;dam&amp;nbsp;id&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;current&amp;nbsp;point.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;st_point&amp;nbsp;=&amp;nbsp;arcpy.Point(row[0],&amp;nbsp;row[1])&amp;nbsp;##starting&amp;nbsp;point&amp;nbsp;(START_X,&amp;nbsp;START_Y).&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ed_point&amp;nbsp;=&amp;nbsp;arcpy.Point(linext*row[2]+row[0],&amp;nbsp;linext*row[3]+row[1])&amp;nbsp;##Point&amp;nbsp;at&amp;nbsp;end&amp;nbsp;of&amp;nbsp;line&amp;nbsp;drawn&amp;nbsp;from&amp;nbsp;st_point&amp;nbsp;to&amp;nbsp;linext&amp;nbsp;map&amp;nbsp;units&amp;nbsp;in&amp;nbsp;the&amp;nbsp;opposite&amp;nbsp;direction&amp;nbsp;of&amp;nbsp;the&amp;nbsp;line&amp;nbsp;from&amp;nbsp;the&amp;nbsp;same&amp;nbsp;point&amp;nbsp;to&amp;nbsp;the&amp;nbsp;nearest&amp;nbsp;polygon&amp;nbsp;(of&amp;nbsp;dam&amp;nbsp;surface&amp;nbsp;area)&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;using&lt;/SPAN&gt;&amp;nbsp;unit&amp;nbsp;vector.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;line_arr&amp;nbsp;=&amp;nbsp;arcpy.Array([st_point,&amp;nbsp;ed_point])&amp;nbsp;##Array&amp;nbsp;object&amp;nbsp;to&amp;nbsp;contain&amp;nbsp;the&amp;nbsp;st_point&amp;nbsp;and&amp;nbsp;ed_point&amp;nbsp;coordinates&amp;nbsp;that&amp;nbsp;define&amp;nbsp;the&amp;nbsp;transect&amp;nbsp;line&amp;nbsp;used&amp;nbsp;to&amp;nbsp;profile&amp;nbsp;the&amp;nbsp;dam&amp;nbsp;and&amp;nbsp;identify&amp;nbsp;the&amp;nbsp;bottom&amp;nbsp;of&amp;nbsp;dam.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;I then do some other stuff that isn't relevant to the lines geometry (just a bunch of processing reading the geometry and using data from it).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;Then I use vectors to find a new point, and more importantly for the problem I'm having, I copy create a line object that contains the line geometry and append that to the lines list. After this it goes into the code in my original post.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;magnitude&amp;nbsp;=&amp;nbsp;slp_profile[bod][0]&amp;nbsp;##Find&amp;nbsp;magnitude&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;vector&amp;nbsp;bod.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;bt_points.append([arcpy.Point(magnitude*row[2]+st_point.X,&amp;nbsp;magnitude*row[3]+st_point.Y),&amp;nbsp;row[4],&amp;nbsp;elv_profile[bod][1]])&amp;nbsp;##Store&amp;nbsp;bottom&amp;nbsp;of&amp;nbsp;dam&amp;nbsp;point&amp;nbsp;geometry,&amp;nbsp;DAMNO,&amp;nbsp;and&amp;nbsp;elevation&amp;nbsp;in&amp;nbsp;list&amp;nbsp;bt_points.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;line&amp;nbsp;=&amp;nbsp;arcpy.Polyline(line_arr,&amp;nbsp;temp_inpt_lyr_spref)&amp;nbsp;##Have&amp;nbsp;to&amp;nbsp;create&amp;nbsp;line&amp;nbsp;object&amp;nbsp;anew,&amp;nbsp;not&amp;nbsp;sure&amp;nbsp;why&amp;nbsp;but&amp;nbsp;line&amp;nbsp;object&amp;nbsp;loses&amp;nbsp;information&amp;nbsp;after&amp;nbsp;being&amp;nbsp;input&amp;nbsp;into&amp;nbsp;InterpolateShape&amp;nbsp;tool.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;lines.append([line,&amp;nbsp;row[4]])&amp;nbsp;##Add&amp;nbsp;lines&amp;nbsp;to&amp;nbsp;polyline&amp;nbsp;geometry&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;output&amp;nbsp;transect&amp;nbsp;featureclass.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;Code in my original post (plus a little extra setting up fields).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: gray; background-color: inherit; border: none;"&gt;##Create&amp;nbsp;output&amp;nbsp;featureclass&amp;nbsp;to&amp;nbsp;be&amp;nbsp;populated&amp;nbsp;with&amp;nbsp;transect&amp;nbsp;lines&amp;nbsp;moving&amp;nbsp;away&amp;nbsp;from&amp;nbsp;dams&amp;nbsp;in&amp;nbsp;downstream&amp;nbsp;direction&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"Writing&amp;nbsp;output&amp;nbsp;transect&amp;nbsp;line&amp;nbsp;featureclass"&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;outln_m&amp;nbsp;=&amp;nbsp;arcpy.management.CreateFeatureclass(&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"in_memory"&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"{}_Transect"&lt;/SPAN&gt;.format(outpt_name),&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"POLYLINE"&lt;/SPAN&gt;,&amp;nbsp;spatial_reference&amp;nbsp;=&amp;nbsp;temp_inpt_lyr_spref)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.management.AddField(outln_m,&amp;nbsp;fid,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"TEXT"&lt;/SPAN&gt;,&amp;nbsp;field_length&amp;nbsp;=&amp;nbsp;6)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(lines)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(len(lines))&amp;nbsp;#DEBUG#&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: gray; background-color: inherit; border: none;"&gt;##Populate&amp;nbsp;output&amp;nbsp;transect&amp;nbsp;line&amp;nbsp;featureclass&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;workspace&amp;nbsp;=&amp;nbsp;r&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"in_memory"&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;with&amp;nbsp;arcpy.da.Editor(workspace)&amp;nbsp;as&amp;nbsp;edit:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cursor&amp;nbsp;=&amp;nbsp;arcpy.da.InsertCursor(outln_m,&amp;nbsp;[&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"SHAPE@"&lt;/SPAN&gt;,&amp;nbsp;fid])&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;row&amp;nbsp;in&amp;nbsp;lines:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(row)&amp;nbsp;#DEBUG#&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cursor.insertRow(row)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;del&amp;nbsp;cursor,&amp;nbsp;row&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(arcpy.management.GetCount(outln_m))&amp;nbsp;#DEBUG#&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;Sorry, it's a lot of code.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 15:29:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716405#M7</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-18T15:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716406#M8</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But I do the same for a point featureclass, bt_points, and it works just fine using the exact same code (except it uses point geometry instead of Polyline geometry objects).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;##Populate&amp;nbsp;output&amp;nbsp;bottom&amp;nbsp;of&amp;nbsp;dam&amp;nbsp;point&amp;nbsp;featureclass&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;cursor&amp;nbsp;=&amp;nbsp;arcpy.da.InsertCursor(outpt,&amp;nbsp;[&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"SHAPE@"&lt;/SPAN&gt;,&amp;nbsp;fid,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"BottomOfDam_Elevation"&lt;/SPAN&gt;])&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;row&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;in&lt;/SPAN&gt;&amp;nbsp;bt_points:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cursor.insertRow(row)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;del&lt;/SPAN&gt;&amp;nbsp;cursor,&amp;nbsp;row&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 15:32:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716406#M8</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-18T15:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716407#M9</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay... are you trying to insert OBJECTID values? &amp;nbsp;The cursor has a field name of&amp;nbsp;&lt;STRONG&gt;fid&lt;/STRONG&gt;. &amp;nbsp;Or is that just a text type field?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 15:41:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716407#M9</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-10-18T15:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716408#M10</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The fid is just a text object with a unique id for each item - but not the object id. It's something like 'D 1403'.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:26:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716408#M10</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-18T16:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716409#M11</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan, does that method work for da.InsertCursors? I am getting an error message, I can also not find any satisfactory documentation of this method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:34:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716409#M11</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-18T16:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716410#M12</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your original question says you're trying to insert poly&lt;STRONG&gt;line&lt;/STRONG&gt; geometries into a poly&lt;STRONG&gt;gon&lt;/STRONG&gt; feature class. Is that correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716410#M12</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2017-10-18T16:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716411#M13</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh sorry, my mistake. No, it is a polyline featureclass.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:45:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716411#M13</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-18T16:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716412#M14</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In-memory workspaces aren't full blown workspaces, i.e., they don't support all of the functionality of geodatabase workspaces.&amp;nbsp; Just to rule out something with using in-memory workspaces, try dumping everything to a file geodatabase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:52:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716412#M14</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-10-18T16:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716413#M15</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying that at the moment, I'm seeing some odd behavior.. I have saved the outln featureclass to a geodatabase instead of in_memory, and when I print GetCount() after running through the InsertCursor, there are 0 features. But.. when I look at this featureclass in my geodatabase there are 25 records, one for each item in the list lines. Now.. I'm using outln as input to InterpolateShape to create a 3D Line, and the output of that tool is still empty, just as the GetCount() print statement suggests. Something really strange is going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;##Create&amp;nbsp;output&amp;nbsp;featureclass&amp;nbsp;to&amp;nbsp;be&amp;nbsp;populated&amp;nbsp;with&amp;nbsp;transect&amp;nbsp;lines&amp;nbsp;moving&amp;nbsp;away&amp;nbsp;from&amp;nbsp;dams&amp;nbsp;in&amp;nbsp;downstream&amp;nbsp;direction&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"Writing&amp;nbsp;output&amp;nbsp;transect&amp;nbsp;line&amp;nbsp;featureclass"&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;outln&amp;nbsp;=&amp;nbsp;arcpy.management.CreateFeatureclass(outpt_path,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"{}_Transect_Temp"&lt;/SPAN&gt;.format(outpt_name),&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"POLYLINE"&lt;/SPAN&gt;,&amp;nbsp;spatial_reference&amp;nbsp;=&amp;nbsp;temp_inpt_lyr_spref)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.management.AddField(outln,&amp;nbsp;fid,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"TEXT"&lt;/SPAN&gt;,&amp;nbsp;field_length&amp;nbsp;=&amp;nbsp;&lt;SPAN class="" style="color: black; background-color: inherit; border: none;"&gt;6&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(len(lines))&amp;nbsp;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;#DEBUG#&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;##Populate&amp;nbsp;output&amp;nbsp;transect&amp;nbsp;line&amp;nbsp;featureclass&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;cursor&amp;nbsp;=&amp;nbsp;arcpy.da.InsertCursor(outln,&amp;nbsp;[&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"SHAPE@"&lt;/SPAN&gt;,&amp;nbsp;fid])&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;row&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;in&lt;/SPAN&gt;&amp;nbsp;lines:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage(row)&amp;nbsp;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;#DEBUG#&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cursor.insertRow(row)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(arcpy.management.GetCount(outln))&amp;nbsp;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;#DEBUG#&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.ddd.InterpolateShape(indem,&amp;nbsp;outln,&amp;nbsp;r&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"{}\{}_Transect"&lt;/SPAN&gt;.format(outpt_path,&amp;nbsp;outpt_name))&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;del&lt;/SPAN&gt;&amp;nbsp;row,&amp;nbsp;cursor&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Oct 2017 16:59:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716413#M15</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-18T16:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716414#M16</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try deleting the row and cursor before running the InterpolateShape tool.&amp;nbsp; I have found sometimes there is a delay in flushing the cursor back to disk.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 16:07:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716414#M16</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-10-19T16:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716415#M17</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried it, but the problem persists. I thought the with.. as.. statement will automatically clear the cursor and row?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;##Create&amp;nbsp;output&amp;nbsp;featureclass&amp;nbsp;to&amp;nbsp;be&amp;nbsp;populated&amp;nbsp;with&amp;nbsp;bottom&amp;nbsp;of&amp;nbsp;dam&amp;nbsp;points,&amp;nbsp;dam&amp;nbsp;id,&amp;nbsp;and&amp;nbsp;elevation&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"Writing&amp;nbsp;output&amp;nbsp;dam&amp;nbsp;elevation&amp;nbsp;featureclass"&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;outpt&amp;nbsp;=&amp;nbsp;arcpy.management.CreateFeatureclass(outpt_path,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"{}_BottomOfDam"&lt;/SPAN&gt;.format(outpt_name),&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"POINT"&lt;/SPAN&gt;,&amp;nbsp;spatial_reference&amp;nbsp;=&amp;nbsp;temp_inpt_lyr_spref)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.management.AddField(outpt,&amp;nbsp;fid,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"TEXT"&lt;/SPAN&gt;,&amp;nbsp;field_length&amp;nbsp;=&amp;nbsp;&lt;SPAN class="" style="color: black; background-color: inherit; border: none;"&gt;6&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.management.AddField(outpt,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"BottomOfDam_Elevation"&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"DOUBLE"&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;##Populate&amp;nbsp;output&amp;nbsp;bottom&amp;nbsp;of&amp;nbsp;dam&amp;nbsp;point&amp;nbsp;featureclass&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;with&amp;nbsp;arcpy.da.InsertCursor(outpt,&amp;nbsp;[&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"SHAPE@"&lt;/SPAN&gt;,&amp;nbsp;fid,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"BottomOfDam_Elevation"&lt;/SPAN&gt;])&amp;nbsp;as&amp;nbsp;cursor:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;row&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;in&lt;/SPAN&gt;&amp;nbsp;bt_points:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cursor.insertRow(row)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;del&lt;/SPAN&gt;&amp;nbsp;cursor,&amp;nbsp;row&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;##Create&amp;nbsp;output&amp;nbsp;featureclass&amp;nbsp;to&amp;nbsp;be&amp;nbsp;populated&amp;nbsp;with&amp;nbsp;transect&amp;nbsp;lines&amp;nbsp;moving&amp;nbsp;away&amp;nbsp;from&amp;nbsp;dams&amp;nbsp;in&amp;nbsp;downstream&amp;nbsp;direction&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.AddMessage(&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"Writing&amp;nbsp;output&amp;nbsp;transect&amp;nbsp;line&amp;nbsp;featureclass"&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;outln&amp;nbsp;=&amp;nbsp;arcpy.management.CreateFeatureclass(outpt_path,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"{}_Transect_Temp"&lt;/SPAN&gt;.format(outpt_name),&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"POLYLINE"&lt;/SPAN&gt;,&amp;nbsp;spatial_reference&amp;nbsp;=&amp;nbsp;temp_inpt_lyr_spref)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.management.AddField(outln,&amp;nbsp;fid,&amp;nbsp;&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"TEXT"&lt;/SPAN&gt;,&amp;nbsp;field_length&amp;nbsp;=&amp;nbsp;&lt;SPAN class="" style="color: black; background-color: inherit; border: none;"&gt;6&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #008200; background-color: inherit; border: none;"&gt;##Populate&amp;nbsp;output&amp;nbsp;transect&amp;nbsp;line&amp;nbsp;featureclass&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;with&amp;nbsp;arcpy.da.InsertCursor(outln,&amp;nbsp;[&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"SHAPE@"&lt;/SPAN&gt;,&amp;nbsp;fid])&amp;nbsp;as&amp;nbsp;cursor:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;for&lt;/SPAN&gt;&amp;nbsp;row&amp;nbsp;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;in&lt;/SPAN&gt;&amp;nbsp;lines:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cursor.insertRow(row)&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&lt;SPAN class="" style="color: #006699; background-color: inherit; border: none; font-weight: bold;"&gt;del&lt;/SPAN&gt;&amp;nbsp;cursor,&amp;nbsp;row&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: inherit; background-color: #ffffff; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f8f8f8; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: none;"&gt;arcpy.ddd.InterpolateShape(indem,&amp;nbsp;outln,&amp;nbsp;r&lt;SPAN class="" style="color: blue; background-color: inherit; border: none;"&gt;"{}\{}_Transect"&lt;/SPAN&gt;.format(outpt_path,&amp;nbsp;outpt_name))&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 17:53:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716415#M17</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-19T17:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716416#M18</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You shouldn't loop over an insert cursor. &amp;nbsp;Instead, set the cursor to a variable and pass each item of your list to the variable to execute.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;items &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'item1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'item2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'item3'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

cursor &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;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'fields'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; item &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; items&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor&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>Sun, 12 Dec 2021 06:40:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716416#M18</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2021-12-12T06:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.InsertCursor only inserting last row in list of data</title>
      <link>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716417#M19</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #edeff2; color: #000000;"&gt;Okay, I've found the problem, and it's not a bug or anything complicated, just an oversight. Earlier in the script, in order to minimize processing time I set a custom extent around each input point to work with only a small piece of the larger input raster. I forgot to reset the extent to arcpy.env.extent = "MAXOF" at the end of this processing, and so it was stuck on the extent of the last item processed. GetCount and InterpolateShape both honor the processing extent, while the InsertCursor (or rather the list of geometry objects I feed it) does not. Problem solved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #edeff2; color: #000000;"&gt;*EDIT 10/24/2017*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #edeff2; color: #000000;"&gt;^ I was in a rush when I posted this, thank you all for the suggestions and help on cracking this!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Oct 2017 13:19:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcapi-questions/arcpy-da-insertcursor-only-inserting-last-row-in/m-p/716417#M19</guid>
      <dc:creator>HannesZiegler2</dc:creator>
      <dc:date>2017-10-20T13:19:04Z</dc:date>
    </item>
  </channel>
</rss>

