Deleting all fields from feature class with ArcPy?

I think you could do this with MakeFeatureLayer on your original feature class, using field_info to "hide" all the fields, followed by CopyFeatures to get the features with no fields in a new feature class.

I investigated to make sure that this would work - and it did. Here are some Python snippets of doing the steps manually to get the syntax right.

arcpy.MakeFeatureLayer_management("C:/avhome/arcGISdata/Exploration.gdb/Samples","Samples_Layer","#","#","OBJECTID OBJECTID HIDDEN NONE;SHAPE SHAPE HIDDEN NONE;Dip_Angle Dip_Angle HIDDEN NONE;Strike Strike HIDDEN NONE;Rock Rock HIDDEN NONE;Description Description HIDDEN NONE")

arcpy.CopyFeatures_management("Samples_Layer","C:/avhome/arcGISdata/Exploration.gdb/SamplesNoAtts","#","0","0","0")

The only attributes on output are OBJECTID and SHAPE.

I wish that the ArcInfo Workstation command PULLITEMS had translated into an ArcGIS Desktop tool perhaps named Pull Fields or Filter Fields.


You could work around it by creating a new feature class using the geometries of the old one but without the fields. The ArcGIS Resource Center has a section on working with geometry in Python. There' a section on reading and writing geometries that should cover what you need.