When you create a feature class through ArcCatalog you get a handy menu that lets you assign fields.
I'm wondering if there isn't an arcpy equivalent. There's no arguments for it in the Create Feature Class tool.
I thought maybe a field info object would do it, placed in the template variable, but this failed. I then realized that field info fields don't indicate field type or most any other field properties, so this should not have been a surprise.
>>> fi = arcpy.FieldInfo () >>> fi.addField ("TestField", "TestField", "VISIBLE", "NONE") >>> arcpy.CreateFeatureclass_management (outLoc, outName, "POLYGON", fi) Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 1806, in CreateFeatureclass raise e RuntimeError: Object: Error in executing tool >>>
Currently I add each field one at a time after creating the feature class, but I'm thinking adding the fields at the time of feature class creation would be more efficient.