Points Within a view

Discussion created by ubanide on Jun 6, 2012
Latest reply on Jun 7, 2012 by ubanide
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 layer
in 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"


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( ???, ???  


# somehow add the selected point attributes the PDF


Thanks  for looking