Pretty straight forward. I am building a tool that outputs an Excel file with XYZ data pertaining to a polyline route. Parameters include:
Input Points (points have been generated along a line fc every 1 meter)
Output Location for Excel sheet
The tool takes the input points, make a copy, SUPPOSED TO DELETE ALL FIELDS EXCEPT OBJECT ID, uses Add XY tool, then uses Extract Value to get the elevation, and finally exports the table to an Excel file. So the issue is when i am trying to delete all the fields except Object ID. All i get is a runtime error: error executing tool. I have tried many versions of my code to delete the fields. Here is one example:
SaveList = ["OBJECTID", "OBJECT_ID", "ObjectID"]
for feild in arcpy.ListFields(Copied_Points):
if feild.name not in SaveList:
Any thoughts on how to make this work? Thanks guys/gals.