<?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: Using Arcpy, how to add selected features to FC AND attributes? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-arcpy-how-to-add-selected-features-to-fc-and/m-p/231596#M17963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Arek!&amp;nbsp; I'm not quite there yet, but still working on it.&amp;nbsp; I appreciate your assistance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Aug 2013 20:59:48 GMT</pubDate>
    <dc:creator>KirstenFrost_Andersen</dc:creator>
    <dc:date>2013-08-06T20:59:48Z</dc:date>
    <item>
      <title>Using Arcpy, how to add selected features to FC AND attributes?</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-how-to-add-selected-features-to-fc-and/m-p/231594#M17961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This should be pretty simple, but I'm not finding a good answer in Help or Google.&amp;nbsp; I have a section of features from a feature class.&amp;nbsp; I want to essentially create one feature from them and add them to another existing feature class along with one or two attributes.&amp;nbsp; I'm attempting to create a tool in ArcMap 10.0 that allows my users to select the features, open the tool, add the information about the soon-to-be-created feature into the text boxes in the tool and when they click OK, have it create a new feature out of the selected geometry (polygon) in my other FC with attributes filled out from the user's specifications.&amp;nbsp; It looks like arcpy.CopyFeatures_management() will create a new feature in a NEW feature class, but how do I tell it what attributes to use and to add to an EXISTING feature class?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any direction.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 23:10:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-how-to-add-selected-features-to-fc-and/m-p/231594#M17961</guid>
      <dc:creator>KirstenFrost_Andersen</dc:creator>
      <dc:date>2013-08-01T23:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcpy, how to add selected features to FC AND attributes?</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-how-to-add-selected-features-to-fc-and/m-p/231595#M17962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can try delete existing fields (arpcy.DeleteField_management) from copied featureclass, then adding your attributes (arcpy.AddField_management), putting new values with arcpy.CalculateField_management, and at last appending to existing featureclass (arcpy.Append_management). So it will look something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.CopyFeatures_management(lyr, tmp_fc)
f_list = arcpy.ListFields(tmp_fc)
for f in f_list:
&amp;nbsp; if f.type not in ('OID', 'Geometry'):
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteField_management(tmp_fc, f) #delete all fields except of geometry and FID

arcpy.AddField_management(tmp_fc, field1, 'TEXT')
arcpy.AddField_management(tmp_fc, field2, 'LONG') # adding fields you need
...
arcpy.CalculateField_management(tmp_fc, filed1, value1)
arcpy.CalculateField_management(tmp_fc, filed2, value2)
...

arcpy.Append_management(tmp_fc, out_fc, *params)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope it helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Arek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:44:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-how-to-add-selected-features-to-fc-and/m-p/231595#M17962</guid>
      <dc:creator>ArkadiuszMatoszka</dc:creator>
      <dc:date>2021-12-11T11:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcpy, how to add selected features to FC AND attributes?</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-how-to-add-selected-features-to-fc-and/m-p/231596#M17963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Arek!&amp;nbsp; I'm not quite there yet, but still working on it.&amp;nbsp; I appreciate your assistance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2013 20:59:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-how-to-add-selected-features-to-fc-and/m-p/231596#M17963</guid>
      <dc:creator>KirstenFrost_Andersen</dc:creator>
      <dc:date>2013-08-06T20:59:48Z</dc:date>
    </item>
  </channel>
</rss>

