I'm having trouble finding help for getting fields to be input parameters from specified layers. When the script is opened I'd like the user to be able to select a layer to use and then be able to choose a field from that layer's attribute table. Does that have to be done in the validation section? The way this will work is layer one will be a polygon field and a field needs to be specified that will be copied to the receiving field of layer two, which would be a feature within the polygon area of layer one. I've got a working script, but I don't want the layers and fields to have to be hard coded.
My script starts with this:
My script starts with this:
Code:
import arcpy, os, time
from datetime import datetime
from datetime import timedelta
#set map doc and the layer to be used
LayerOne = arcpy.GetParameterAsText(0)
FieldTransfer = arcpy.GetParameterAsText(1)
LayerTwo = acrpy.GetParameterAsText(2)
FieldRecieve = arcpy.GetParameterAsText(3)
mxd = arcpy.mapping.MapDocument("Current")
mapLyr1 = arcpy.mapping.ListLayers(mxd, "%s") %LayerOne [0]
mapLyr2 = arcpy.mapping.ListLayers(mxd, "%s") %LayerTwo [0]