I am fairly new to python. But I have been asked to write a tool that will allow the user to pan to a specific location and hit a button that creates a PDF of the view as well as showing the attribute values from a layerin the view. I can create the PDF of the view no problem. I am have difficulty with selecting and outputting the points from the layer.
newinputfile ="mypointfile"
arcpy.env.overwriteOutput = true
definput = arcpy.GetParameterAsText(0)
if definput == '#" or not definput":
definput = newinputfile;
env.workspace = "d:/Myprojects/DefWorkspace/projdata.gdb"
arcpy.AddMessage("starting")
mxd = arcpy.mapping.MapDocument("CURRENT")
layers = arcpy.mapping.ListLayers(mxd)
for layer in layers:
if layer.longName == newinputfile:
arcpy.addMessage("found layer")
# here is where I lose it
arcpy.SelectLayerByLocation_management( ???, ???
arcpy.mapping.ExportToPDF(mxd,"outputPDF")
# somehow add the selected point attributes the PDF
#Done.
Thanks for looking