<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to: Read value from &amp;quot;Shape_Length&amp;quot; field, create table that increments from 0 to &amp;quot;Shape_Length&amp;quot; value. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227796#M17665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you put shape_length into a list so row will be a tuple.&amp;nbsp; did you try&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;row[0]&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;'Shape_Length'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jun 2020 15:52:34 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2020-06-04T15:52:34Z</dc:date>
    <item>
      <title>How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227795#M17664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a script and a portion of said script requires that I build a table that starts at 0 and increments by 1 until reaching the value of "Shape_Length" from a feature class. I have line work that I wish to read the "Shape_Length" from and I am having troubles getting the syntax correct.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Route &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateRoutes_lr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Input_Linework&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Linework_Field&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Output_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Store value in SHAPE_LENGTH from Route&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;Route&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Shape_Length'&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;as&lt;/SPAN&gt; cursor&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; Cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        Max_Value   &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Shape_Length'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; row
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor
    
&lt;SPAN class="comment token"&gt;# Create table with two fields, RouteID and Chainage&lt;/SPAN&gt;
Route_Table     &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateTable_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Output_WS&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Output_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Append additional rows to table in increments of 1 and end at the exact value of&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# the Max_Value&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;'RouteID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Chainage'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
Pop_Table       &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;Route_Table&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;for&lt;/SPAN&gt; x &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&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; Max_Value&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    Pop_Table&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Linework_Field&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; x‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get an error on line 6:&lt;/P&gt;&lt;P&gt;AttributeError: 'tuple' object has no attribute 'getValue'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried reading through the page:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/analyze/python/data-access-using-cursors.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/analyze/python/data-access-using-cursors.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Accessing data using cursors—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I messed around with the code a bit but this is where I am at now and can't determine how to move forward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:05:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227795#M17664</guid>
      <dc:creator>ConnorMcivor</dc:creator>
      <dc:date>2021-12-11T11:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227796#M17665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you put shape_length into a list so row will be a tuple.&amp;nbsp; did you try&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;row[0]&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;'Shape_Length'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 15:52:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227796#M17665</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-06-04T15:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227797#M17666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are getting an AttributeError because you are instantiating Data Access cursors but using the old cursor syntax with them.&amp;nbsp; Review the documentation for the Data Access cursors to see how to interact with them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 16:36:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227797#M17666</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-06-04T16:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227798#M17667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The 'row' in a search cursor is returned as a tuple and the elements there in are indexed just like a list.&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r'C&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;\path\to\featureClass
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;'predir'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'name'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'postdir'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'posttype'&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&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; cursor&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; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;''' returns multi-element tuples:

('W', 'ARBOR PARK', None, 'DR')
('S', 'FLORABUND', None, 'LN')
('S', '8000', 'W', None)
('W', 'GETTYSBURG', None, 'DR')
('S', 'PATRICIA', None, 'CIR')
('W', 'HELEN', None, 'DR')
('W', 'LUCADIA', None, 'WAY')
('S', 'RITSON', None, 'LN')
('W', 'MAYTIME', None, 'DR')
....
'''&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In your case you only have row[0] and as &lt;A href="https://community.esri.com/migrated-users/3420" target="_blank"&gt;Joshua Bixby&lt;/A&gt;‌ notes you'll want to adjust your code to something like this:&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;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&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@LENGTH'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&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; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;''' returns a single element tuples:

(292.1710851770351,)
(484.15425925311877,)
(293.22981473912614,)
(262.00460512592036,)
(666.3035654334589,)
(4628.563366540029,)
(174.6003202336956,)
....

'''&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'll let you you work on getting the max value...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:05:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227798#M17667</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T11:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227799#M17668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To answer what Dan had said, I originally had it in that specific format. However I was faced with a different error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AttributeError: 'float' object has no attribute 'getValue'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that the Shape_Length field is a 'float' format data type but i am unsure as to why it wont let me store the value to be used later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To respond to Joshua, I believe that your comment aligns with Dan's?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To answer Joe, I am aware that the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;'row' in a search cursor is returned as a tuple and that it is indexed, hence the approach of what Joe had mentioned. For clarification in regard to your final statement "&lt;SPAN&gt;I'll let you you work on getting the max value...", t&lt;/SPAN&gt;&lt;/SPAN&gt;he prerequisite for the tool I'm developing is a poly-line feature class with 1 row/feature of data, so the Max_Value is just the variable I store it as in order to append it to the table in line 17.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the feedback guys I really appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 20:02:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227799#M17668</guid>
      <dc:creator>ConnorMcivor</dc:creator>
      <dc:date>2020-06-04T20:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227800#M17669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it now guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am stuck on another part now but I am certain Ill be able to troubleshoot the rest. I was never great at the Cursors in school and it has now been a while since I have scripted. I am slowly relearning these things. Thank you all for your guidance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The fixed code:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# Store value in SHAPE_LENGTH from Route&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;Route&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Shape_Length'&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;as&lt;/SPAN&gt; Cursor&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; Cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        Max_Value &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="keyword token"&gt;del&lt;/SPAN&gt; row
&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:05:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227800#M17669</guid>
      <dc:creator>ConnorMcivor</dc:creator>
      <dc:date>2021-12-11T11:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227801#M17670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like Max_Value refers to the maximum number of records you'll write to your table, right?&amp;nbsp; Somehow I construed it to mean the Max_Value of all the &lt;A href="mailto:SHAPE@LENGTH" rel="nofollow noopener noreferrer" target="_blank"&gt;SHAPE@LENGTH&lt;/A&gt;&amp;nbsp;token values.&amp;nbsp; My mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what is the problem?&amp;nbsp; You are getting value that happens to be a floating number, and you are applying this get.value&amp;nbsp; method&amp;nbsp;(that I'm not familiar with) to it and you are getting an error.&amp;nbsp; Can you just set your Max_Value variable this way:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;blah blah blah &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&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; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
         Max_Value &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation 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;‍&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or am I still missing what it is you are after?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:05:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227801#M17670</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T11:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227802#M17671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; "&gt;never great at the Cursors&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cursors make my truck payments...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 21:34:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227802#M17671</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-06-04T21:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227803#M17672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Max_Value is supposed to represent the value stored in the single only row of a polyline feature shape length. To better articulate my point:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Polyline feature class attribute table reads value "4263.344" in shape length field. I want to store that value in a variable so that in the next loop I can make a table that populates rows with 2 fields: "RouteID" and "Chainage"&lt;/P&gt;&lt;P&gt;RouteID will be used in order to make route events and match the routeID from the original polyline. The Chainage should start at value 0 then append a new row containing the next consecutive integer until it reaches the rounded down version of the stored "Max_Value" (Called_"Max_Round", my variables may not be descriptive enough). Then I want to append the final row with just the "Max_Value".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output table should look like:&lt;/P&gt;&lt;P&gt;ROUTEID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp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&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;4263.344&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Basically&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;am making meter by meter points along a route, adding coordinates, extracting the elevation from the DEM, resorting and renaming the fields (through "Add XY" tool, automatically calls the fields "POINT X" and "POINT Y"&amp;nbsp; etc. so i just want them renamed for the final step) and final export into an excel worksheet. I have all the other parts working fine, because I stripped them from another tool i made last year. Always getting hung up on the cursors.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;I'm stuck again trying to determine how to get the code in the table populating loop to work.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 22:23:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227803#M17672</guid>
      <dc:creator>ConnorMcivor</dc:creator>
      <dc:date>2020-06-04T22:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227804#M17673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;EM&gt;&lt;STRONG&gt;I'm stuck again trying to determine how to get the code in the table populating loop to work..(3:23)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;EM&gt;&lt;STRONG&gt;I got it now guys... (1:06)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I've lost track of the order of your posts.&amp;nbsp; Are you stuck or have you got your hands wrapped this beast?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 01:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227804#M17673</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-06-05T01:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227805#M17674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Joe for the late response. To clarify, I was stuck on one portion of the presented code snippet then got stuck on the next. I have both issues mentioned earlier. I am not sure if I should start a new thread or not for a new error I have though. I figured out how to populate the table with the values i needed. The next step was to "Make Route Events" out of them. The results are interesting: The table population works like I said, containing all values required. However when I attempt to make them into route events, the result shows only 1001 records if between&amp;nbsp;0 - 2002, and will show 2002 of the records if between 2002 and 4008 records. Simply, I have a table that includes the RouteID field and measure/chainage values from 0 - 2768, when the script runs, it will only show up to the 2002nd measure/chainages. When I run the "Make Route Events" tool outside of the script, everything runs fine, and shows all 2768 records. I have attempted a "Table to table" conversion prior to running the "Make Route Events" however that did not solve my problem. If this requires a new thread please correct me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2020 21:00:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227805#M17674</guid>
      <dc:creator>ConnorMcivor</dc:creator>
      <dc:date>2020-06-16T21:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227806#M17675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;***I have corrected both issues mentioned earlier***&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2020 21:02:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227806#M17675</guid>
      <dc:creator>ConnorMcivor</dc:creator>
      <dc:date>2020-06-16T21:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Read value from "Shape_Length" field, create table that increments from 0 to "Shape_Length" value.</title>
      <link>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227807#M17676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Conor,&lt;BR /&gt;You need to nest your cursors,&amp;nbsp; rather than having two separate cursors. Otherwise you just get the Max_Value from the last row for the route table.&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;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;frange&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;start&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; stop&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; step&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="string token"&gt;"""Range function that works with floats"""&lt;/SPAN&gt;
    r &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; start
    &lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; r &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; stop&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;yield&lt;/SPAN&gt; r
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; step &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            r &lt;SPAN class="operator token"&gt;+=&lt;/SPAN&gt; step
        &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            r &lt;SPAN class="operator token"&gt;-=&lt;/SPAN&gt; step

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;main_snippet&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;""" main processing snip"""&lt;/SPAN&gt;
    in_routes &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;lr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateRoutes&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Input_Linework&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Linework_Field&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Output_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# Create table with two fields, RouteID and Chainage&lt;/SPAN&gt;
    route_table &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Output_WS&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Output_Name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# add the fields. Missing in your script&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;route_table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'RouteID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TEXT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_length&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;route_table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Chainage'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'DOUBLE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# Populate event table using cursors&lt;/SPAN&gt;
    search_fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Linework_Field&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;
    update_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;'RouteID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Chainage'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# increments of 1&lt;/SPAN&gt;
    measure_interval &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&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;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;route_table&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; update_fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; icursor&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;in_routes&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; search_fields&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&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; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                &lt;SPAN class="comment token"&gt;# read the geometry&lt;/SPAN&gt;
                line &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;
                &lt;SPAN class="comment token"&gt;# use the measures&lt;/SPAN&gt;
                first_measure &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;line&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;firstPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;M&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                last_measure &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;line&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;lastPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;M&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                &lt;SPAN class="comment token"&gt;# step thru the meaures, by measure_interval&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; measure &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; frange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;first_measure&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; last_measure&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; measure_interval&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                    &lt;SPAN class="comment token"&gt;# insert value into route_table&lt;/SPAN&gt;
                    icursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation 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; measure&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;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&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 11:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-read-value-from-quot-shape-length-quot/m-p/227807#M17676</guid>
      <dc:creator>MarkBryant</dc:creator>
      <dc:date>2021-12-11T11:05:54Z</dc:date>
    </item>
  </channel>
</rss>

