Skip to content

Instantly share code, notes, and snippets.

View hunterwei's full-sized avatar

Hunter Wei hunterwei

View GitHub Profile
@hunterwei
hunterwei / CopyValueFromOneFeatureToAnother.py
Created January 18, 2018 00:01
ArcPy snippet to copy values from one feature class to another feature class
import arcpy
rows = arcpy.InsertCursor("TARGET_FEATURE")
sourcerows = arcpy.SearchCursor("SOURCE_FEATURE")
fields = arcpy.ListFields("SOURCE_FEATURE")
for sourcerow in sourcerows:
row = rows.newRow()
for field in fields:
if field.name != "OBJECTID":
row.setValue(field.name, sourcerow.getValue(field.name))