Quantcast
Channel: Forums - Geoprocessing
Viewing all articles
Browse latest Browse all 1952

Is Modelbuilder the *only* way to rename fields - not succeeding in Python

$
0
0
Probably doing it incorrectly, but following the samples in which I try Python:

Code:

import arcpy
fi = arcpy.FieldInfo()
fi.addField("Name", "Name2", "VISIBLE", "")
arcpy.MakeFeatureLayer_management("TheFC, "foo5", "","", fi)
arcpy.CopyFeatures_management("foo5", "hoo1")

Does NOT persist renaming the fields. Hoo1 still has the old names. According to what I have read, it shouldn't. Is modelbuilder the *only* way renaming works? Is it possible by using ArcPy field methods? What am I doing incorrectly (this time)?

Viewing all articles
Browse latest Browse all 1952

Trending Articles