Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to delete all of the fields from a feature class in a simple tricky way, I don't want to loop over the fields because this method is very slow in arcpy.

I'm using a polygon feature class, I tried arcpy.MultipartToSinglepart_management but the feature class result saved all the fields.

Does anyone have any ideas?

share|improve this question
Check out this thread, it may give you ideas: – Aaron Sep 28 '12 at 14:00
Is arcpy.ListFields() too slow? You can use that list in arcpy.DeleteField_management to delete multiple fields at once. Simply fldsToDelete = [ for x in arcpy.ListField_management() if not x.required] would generate that list of names not required which you can delete. Remember, if this is a shapefile, you need to keep one field (other than ObjectID and Shape) to be a valid shapefile. – Michalis Avraam Sep 28 '12 at 15:50
up vote 4 down vote accepted

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")


The only attributes on output are OBJECTID and SHAPE

share|improve this answer
it's little hard to get or to make void field info – geogeek Sep 28 '12 at 12:05
thanks a lot for the explanation, this is the simple way – geogeek Sep 29 '12 at 7:46

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.