<?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 arcpy.polyline not creating line in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201676#M15508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm going crazy and hoping someone can help.&amp;nbsp; I'm trying to bring in a point feature class, go row by row (using a .da.searchcursor), add two points into an array, and create a polyline from them. Then use an da.update cursor to add that line segment into a line feature class.&amp;nbsp; Then go to the next row and do the same until I have made a number of line segments from the point features.&amp;nbsp; I have tried this a ton of different ways, all with the same result, an updated line feature class that has the added rows, but NO lines draw and the length field for all segments are 0.&amp;nbsp; I've altered this to just run the points and add the points to a new point feature and that works just fine.&amp;nbsp; This code has also been updated to incorporate the .da.cursors (I have similar code running off the old cursors that work, i'm just trying to update it and the .polyline is not working right).&amp;nbsp; Does anyone have any ideas or things to try?&amp;nbsp; I'm going crazy. TIA!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcpy

&lt;SPAN style="color: #808080;"&gt;# Set environments / workspace. Workspace will be a parameter in tool.  This parameter should point to a gdb that has all the effort point feature classes
&lt;/SPAN&gt;arcpy.env.workspace = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb"
&lt;/SPAN&gt;arcpy.env.overwriteOutput = &lt;SPAN style="color: #cc7832;"&gt;True&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# input point fc
&lt;/SPAN&gt;fc = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb\SurveyPointsUTM19_TestSet_Short_6"
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;arcpy.MakeFeatureLayer_management(fc&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"fc_lyr"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;# Sort the table by fileid and eventno and create a new fc called fc_sort
&lt;/SPAN&gt;sort_fields = [[&lt;SPAN style="color: #6a8759;"&gt;"FILEID"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"ASCENDING"&lt;/SPAN&gt;]&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;[&lt;SPAN style="color: #6a8759;"&gt;"EVENTNO"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"ASCENDING"&lt;/SPAN&gt;]]
fc_Sorted = arcpy.Sort_management(&lt;SPAN style="color: #6a8759;"&gt;"fc_lyr"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"fc_sort"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;sort_fields)

&lt;SPAN style="color: #808080;"&gt;# Create the search cursor
&lt;/SPAN&gt;fields = [&lt;SPAN style="color: #6a8759;"&gt;"SHAPE@"&lt;/SPAN&gt;]
&lt;SPAN style="color: #cc7832;"&gt;with &lt;/SPAN&gt;arcpy.da.SearchCursor(fc_Sorted&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;fields) &lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;cur:
    &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;cur:
        geom1 = row[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;].getPart()
        cur.next()
        geom2 = row[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;].getPart()
        array = arcpy.Array()
        array.add(geom1)
        array.add(geom2)
        polyline = arcpy.Polyline(array&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;arcpy.SpatialReference(&lt;SPAN style="color: #6897bb;"&gt;26919&lt;/SPAN&gt;))
        &lt;SPAN style="color: #cc7832;"&gt;with &lt;/SPAN&gt;arcpy.da.InsertCursor(&lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb\OnEffortLinesTEST"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'SHAPE@'&lt;/SPAN&gt;) &lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;insertCursor:
            insertCursor.insertRow([polyline])&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        &lt;/SPAN&gt;array.removeAll()
        &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;insertCursor
&lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;cur&lt;/PRE&gt;&lt;P&gt;The result is all the points used draw and are correct (the fc_Sorted /fc_sort), and the line feature class seems to updated in that rows are added, but no lines draw and the Length field is 0.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/501385_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 10:01:32 GMT</pubDate>
    <dc:creator>BrookeHodge</dc:creator>
    <dc:date>2021-12-11T10:01:32Z</dc:date>
    <item>
      <title>arcpy.polyline not creating line</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201676#M15508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm going crazy and hoping someone can help.&amp;nbsp; I'm trying to bring in a point feature class, go row by row (using a .da.searchcursor), add two points into an array, and create a polyline from them. Then use an da.update cursor to add that line segment into a line feature class.&amp;nbsp; Then go to the next row and do the same until I have made a number of line segments from the point features.&amp;nbsp; I have tried this a ton of different ways, all with the same result, an updated line feature class that has the added rows, but NO lines draw and the length field for all segments are 0.&amp;nbsp; I've altered this to just run the points and add the points to a new point feature and that works just fine.&amp;nbsp; This code has also been updated to incorporate the .da.cursors (I have similar code running off the old cursors that work, i'm just trying to update it and the .polyline is not working right).&amp;nbsp; Does anyone have any ideas or things to try?&amp;nbsp; I'm going crazy. TIA!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;arcpy

&lt;SPAN style="color: #808080;"&gt;# Set environments / workspace. Workspace will be a parameter in tool.  This parameter should point to a gdb that has all the effort point feature classes
&lt;/SPAN&gt;arcpy.env.workspace = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb"
&lt;/SPAN&gt;arcpy.env.overwriteOutput = &lt;SPAN style="color: #cc7832;"&gt;True&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# input point fc
&lt;/SPAN&gt;fc = &lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb\SurveyPointsUTM19_TestSet_Short_6"
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;arcpy.MakeFeatureLayer_management(fc&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"fc_lyr"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;# Sort the table by fileid and eventno and create a new fc called fc_sort
&lt;/SPAN&gt;sort_fields = [[&lt;SPAN style="color: #6a8759;"&gt;"FILEID"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"ASCENDING"&lt;/SPAN&gt;]&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;[&lt;SPAN style="color: #6a8759;"&gt;"EVENTNO"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"ASCENDING"&lt;/SPAN&gt;]]
fc_Sorted = arcpy.Sort_management(&lt;SPAN style="color: #6a8759;"&gt;"fc_lyr"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"fc_sort"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;sort_fields)

&lt;SPAN style="color: #808080;"&gt;# Create the search cursor
&lt;/SPAN&gt;fields = [&lt;SPAN style="color: #6a8759;"&gt;"SHAPE@"&lt;/SPAN&gt;]
&lt;SPAN style="color: #cc7832;"&gt;with &lt;/SPAN&gt;arcpy.da.SearchCursor(fc_Sorted&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;fields) &lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;cur:
    &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;row &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;cur:
        geom1 = row[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;].getPart()
        cur.next()
        geom2 = row[&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;].getPart()
        array = arcpy.Array()
        array.add(geom1)
        array.add(geom2)
        polyline = arcpy.Polyline(array&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;arcpy.SpatialReference(&lt;SPAN style="color: #6897bb;"&gt;26919&lt;/SPAN&gt;))
        &lt;SPAN style="color: #cc7832;"&gt;with &lt;/SPAN&gt;arcpy.da.InsertCursor(&lt;SPAN style="color: #6a8759;"&gt;r"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb\OnEffortLinesTEST"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'SHAPE@'&lt;/SPAN&gt;) &lt;SPAN style="color: #cc7832;"&gt;as &lt;/SPAN&gt;insertCursor:
            insertCursor.insertRow([polyline])&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;        &lt;/SPAN&gt;array.removeAll()
        &lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;insertCursor
&lt;SPAN style="color: #cc7832;"&gt;del &lt;/SPAN&gt;cur&lt;/PRE&gt;&lt;P&gt;The result is all the points used draw and are correct (the fc_Sorted /fc_sort), and the line feature class seems to updated in that rows are added, but no lines draw and the Length field is 0.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/501385_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:01:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201676#M15508</guid>
      <dc:creator>BrookeHodge</dc:creator>
      <dc:date>2021-12-11T10:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.polyline not creating line</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201677#M15509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp; is you want line numbers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are adding a list ( ie ...&amp;nbsp; [polyline]&amp;nbsp; )in your 4th last line.&amp;nbsp; Have you tried taking polyline out of the list (ie dump [ ] )?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2020 19:00:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201677#M15509</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-07-27T19:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.polyline not creating line</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201678#M15510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan, thanks so much for your reply and thanks for pointing me to the code formatting info.&amp;nbsp; This was my first time posting code in a forum and I simply copied and pasted not knowing there was another way.&amp;nbsp; I think I understand what you are suggesting, and it was the original way I tried to complete this task.&amp;nbsp; Below, I tried to create a polyline from an array, shoot it into an empty list (below called featureList), then use the CopyFeatures_management to create an output feature class from the featureList list, however, that did not work either.&amp;nbsp; Below is that attempt. You may notice this is slightly different than my original post (there is an additional 'if' statement testing variables and determine if it should draw a polyline), however, I took all that out trying to simplify things until I figured out how to get any line to actually draw.&amp;nbsp; Is this what you were thinking?&amp;nbsp; Or did I misinterpret your suggestion?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="comment token"&gt;# Set environments / workspace. Workspace will be a parameter in tool.  This parameter should point to a gdb that has all the effort point feature classes&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
featureList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Set where the output featureclass will go&lt;/SPAN&gt;
fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb\SurveyPointsUTM19_TestSet_Short_6"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Make a feature Layer to work off&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"fc_lyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Sort the table by fileid and eventno and create a new fc called fc_sort&lt;/SPAN&gt;
sort_fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"FILEID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ASCENDING"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"EVENTNO"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ASCENDING"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
fc_Sorted &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Sort_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"fc_lyr"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"fc_sort"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sort_fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create the search cursor&lt;/SPAN&gt;
fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'FILEID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'BEAUFORT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'LEGTYPE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'LEGSTAGE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'VISIBLTY'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'MONTH'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'YEAR'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc_Sorted&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cur&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cur&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;# Name variables and assign values starting on first record of table&lt;/SPAN&gt;
        fileid1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        beaufort &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        legtype &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        legstage &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        visiblty &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        month &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        year &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;# Get the geometry of the point for that record&lt;/SPAN&gt;
        geom1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getPart&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;# Go to next record and name variables and assign values&lt;/SPAN&gt;
        next&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cur&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        fileid2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        geom2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getPart&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        array &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fileid1 &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; fileid2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;beaufort &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; None &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; beaufort &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;visiblty &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; None &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; visiblty &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; \
                &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; legtype &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; \
                &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;legtype &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'7'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; legstage &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; \
                &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;legtype &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'9'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; legstage &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; \
                &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;legtype &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'5'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; legstage &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            array&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;add&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;geom1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            array&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;add&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;geom2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            polyline &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Polyline&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;26919&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            featureList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polyline&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            array&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;removeAll&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;pass&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cur
outputLines &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureList&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\Users\bhodge\Dropbox (New England Aquarium)\MonumentsWork\MonumentSpeciesDiversity\DataProcessing\MichelleCData.gdb\OnEffortLines6"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:01:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201678#M15510</guid>
      <dc:creator>BrookeHodge</dc:creator>
      <dc:date>2021-12-11T10:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.polyline not creating line</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201679#M15511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're using the same point for the start and end of the line, i.e. geom1 == geom2 because you haven't updated the row.&amp;nbsp; This is probably why you get a zero length line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cur&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        geom1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getPart&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        next_row &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cur&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;next&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        geom2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; next_row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getPart&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:01:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201679#M15511</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-12-11T10:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.polyline not creating line</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201680#M15512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My goodneess you've saved my sanity!&amp;nbsp; Yes, this worked, thank you so much!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2020 14:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-polyline-not-creating-line/m-p/201680#M15512</guid>
      <dc:creator>BrookeHodge</dc:creator>
      <dc:date>2020-07-28T14:20:16Z</dc:date>
    </item>
  </channel>
</rss>

