<?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: Extract value from a one line shape file arcpy in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037522#M38630</link>
    <description>&lt;P&gt;Where do you want to extract it to?&lt;/P&gt;&lt;P&gt;Using Python Parser of Field Calculator?&lt;/P&gt;&lt;P&gt;!shape.length@&amp;lt;units&amp;gt;!&lt;/P&gt;&lt;P&gt;e.g.: For calculating length in yards&lt;/P&gt;&lt;P&gt;!shape.length@yards!&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/tables/calculate-field-examples.htm#ESRI_SECTION1_F885F6AD331240ACB2DBDDA70151146D" target="_self"&gt;Geometry Calculation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 08:48:12 GMT</pubDate>
    <dc:creator>JayantaPoddar</dc:creator>
    <dc:date>2021-03-17T08:48:12Z</dc:date>
    <item>
      <title>Extract value from a one line shape file arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037512#M38629</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a shapefile that contains one line, and I need to extract the "Shape Length" value from his attribute table using python.&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MohamadAchour_0-1615969516175.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8672i2549C82C53F71184/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MohamadAchour_0-1615969516175.png" alt="MohamadAchour_0-1615969516175.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 08:27:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037512#M38629</guid>
      <dc:creator>MohamadAchour</dc:creator>
      <dc:date>2021-03-17T08:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value from a one line shape file arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037522#M38630</link>
      <description>&lt;P&gt;Where do you want to extract it to?&lt;/P&gt;&lt;P&gt;Using Python Parser of Field Calculator?&lt;/P&gt;&lt;P&gt;!shape.length@&amp;lt;units&amp;gt;!&lt;/P&gt;&lt;P&gt;e.g.: For calculating length in yards&lt;/P&gt;&lt;P&gt;!shape.length@yards!&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/tables/calculate-field-examples.htm#ESRI_SECTION1_F885F6AD331240ACB2DBDDA70151146D" target="_self"&gt;Geometry Calculation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 08:48:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037522#M38630</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2021-03-17T08:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value from a one line shape file arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037529#M38632</link>
      <description>&lt;P&gt;I only need the value of the "shape length" cell. Then, I will use this value in the script.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 09:03:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037529#M38632</guid>
      <dc:creator>MohamadAchour</dc:creator>
      <dc:date>2021-03-17T09:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value from a one line shape file arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037531#M38634</link>
      <description>&lt;P&gt;&lt;SPAN&gt;if there is a method to calculate the length of the polyline also it can work.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 09:08:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037531#M38634</guid>
      <dc:creator>MohamadAchour</dc:creator>
      <dc:date>2021-03-17T09:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value from a one line shape file arcpy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037535#M38635</link>
      <description>&lt;P&gt;a search cursor will do the trick&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm" target="_blank"&gt;SearchCursor—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

fc = 'c:/data/your_shapefile.shp'
#look at the geometry tokens in the help url
#for more understanding
fields = ['SHAPE@LENGTH']

#open cursor
with arcpy.da.SearchCursor(fc, fields) as cursor:
    #for every row in the shapefiles attribute table
    for row in cursor:
        #row[0] is the first field specified when opening the cursor
        #next field rould be row[1]...etc

        #print the length
        print(row[0])&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 Mar 2021 09:26:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-value-from-a-one-line-shape-file-arcpy/m-p/1037535#M38635</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-17T09:26:18Z</dc:date>
    </item>
  </channel>
</rss>

