How do I make the script below accept parameter arguments correctly in ArcGIS 10? I added it to a toolbox as a script, created parameter called Fields to be Deleted: and type as Field, but when I double click it to run it, the display dows not allow for adding fields (to be deleted)? PLEASE HELP:(

# Import arcpy module
    import arcpy
    arcpy.env.workspace = "c:\\test\\Mydata.mdb"
    Drop_Field = arcpy.GetParameterAsText(0)

# Process: Delete Field (36)
    arcpy.DeleteField_management("ArcAddress", Drop_Field)

If you selected Field as the data type in your parameter, then you should get an editable drop down list. You should be able to type the name of your field in this box. If the field has typing disabled then I've misunderstood your question.

In order for the pick list to display a list of available fields, you will need to create another parameter that is the name of you data set, and then set the obtained from property for your field parameter to the name of your data source parameter.

Script Parameter Properties Screen Shot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy