I would like the following to select (highlight) the "project" layer that intersects the grid, and then pull a record from the selected "Grid". I do not need to save the layer.

Note: Running the script from within ArcMap in the Python Console window.

import arcpy
# Make a layer from the feature class
arcpy.MakeFeatureLayer_management("project","project_lyr")
# Then add a selection to the layer based on location to features in another feature class
arcpy.SelectLayerByLocation_management("project_lyr","INTERSECT","Grid")

This code runs and no errors are given, yet it does not select(highlight) any features. Any Idea why? Also runs really slow.

Basically I'm trying to do this:

This runs really fast almost instant, but I want to do the same using python. I just need a value from the selected feature's table, I don't need a copy of the layer.

Are you running this script from within ArcMap (i.e. in the Python console)? Or from outside ArcMap (i.e. within IDLE or another Python editor)? The only way ArcMap will "select(highlight) any features" is from within ArcMap. I suspect that you are running the script from outside ArcMap, because the import arcpy command takes awhile to run.
–
dmahrJul 4 '12 at 16:05

I'm running the script from within ArcMap in the Python Console window.
–
Tristan ForwardJul 4 '12 at 16:07

If you're running it from within ArcMap, you do not need the arcpy.MakeFeatureLayer() line, since project is already a layer. Just do arcpy.SelectLayerByLocation_management("project","INTERSECT","Grid").
–
dmahrJul 4 '12 at 16:48

Another thing I find, is that running things in the python window of ArcMap is always slower. I find that if you write the code to a .py file, add it as a script to the toolbox and then run it, the processing will go faster.