<?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: Edit shapefile using modelbuilder in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/edit-shapefile-using-modelbuilder/m-p/4944#M63</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1. Create new model in a Toolbox&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To update values within fields using ModelBuilder, using tools in 10.0 'Data Management Tools':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. 'Make Feature Layer' in 'Layers and Table Views'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. 'Select Layer By Attribute' in 'Layers and Table Views'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. 'Calculate Field' in 'Fields'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That should do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Sep 2013 13:14:04 GMT</pubDate>
    <dc:creator>ScottMoyer</dc:creator>
    <dc:date>2013-09-11T13:14:04Z</dc:date>
    <item>
      <title>Edit shapefile using modelbuilder</title>
      <link>https://community.esri.com/t5/mapping-questions/edit-shapefile-using-modelbuilder/m-p/4943#M62</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have got the folloving problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to change some of the values of one attribute in my point shapefile. I want to do it in modelbuilder, but I dont know how. I have found a script which can do it in python. The script is as following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
... 
... features = arcpy.UpdateCursor(r"C:\Users\peter.valent\Documents\ArcGIS\Data\Vah po LM\test_points.shp")
... for feature in features:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.precipitation = value
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; features.updateRow(feature)
... del feature,features&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I put to modelbuilder:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Expression:&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;myfcn(r"%file_name%","%value%")&lt;/PRE&gt;&lt;BR /&gt;&lt;STRONG&gt;Code Block:&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

def myfcn(path,value):
features = arcpy.UpdateCursor(path)
for feature in features:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.precipitation = value
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; features.updateRow(feature)
del feature,features&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:11:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/edit-shapefile-using-modelbuilder/m-p/4943#M62</guid>
      <dc:creator>PV1</dc:creator>
      <dc:date>2021-12-10T20:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Edit shapefile using modelbuilder</title>
      <link>https://community.esri.com/t5/mapping-questions/edit-shapefile-using-modelbuilder/m-p/4944#M63</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1. Create new model in a Toolbox&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To update values within fields using ModelBuilder, using tools in 10.0 'Data Management Tools':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. 'Make Feature Layer' in 'Layers and Table Views'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. 'Select Layer By Attribute' in 'Layers and Table Views'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. 'Calculate Field' in 'Fields'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That should do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 13:14:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/edit-shapefile-using-modelbuilder/m-p/4944#M63</guid>
      <dc:creator>ScottMoyer</dc:creator>
      <dc:date>2013-09-11T13:14:04Z</dc:date>
    </item>
  </channel>
</rss>

