AnsweredAssumed Answered

add fields to all my shapes in a folder

Question asked by peterverst on Apr 5, 2014
Latest reply on Apr 8, 2014 by crafty762
I want to add fields to all my shapes in a folder. I want to use a script for this.
I was looking at the forum and I found something I can use.

I am trying but cannot seem to get it to work.
This is my script and I have it in a .py file. In the folder GIS I have a subfolder TEST with 3 shape files in this subfolder I have also 3 shape files. I want to add multiple fields (???width??? ???length??? ???height??? ???code??? ???max_ton??? ???ecc??? to all shape files.

import  arcpy
inFolder = r"C:\GIS"
arcpy.env.workspace = inFolder
l = arcpy.ListFeatureClasses()
for i in l:
    arcpy.AddField_management(i, "width", "DOUBLE")

Hope someone can help me again.

Greetings Peter