<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Select features using geometry objects in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233188#M18074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tested making a reference as suggested with no change in results - nothing gets selected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't believe the "DOQQImport" needs to be referenced. The layer is in the TOC, and I've used layers in other scripts without making such a reference. As a test I tried the following. I used an existing point layer ("somePtLayer") and manually selected one of its features that is covered by my DOQQImport polygon layer. I changed the code to use the point layer and the script successfully selected the correct polygons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
##myPt = arcpy.Point((df.extent.XMax+df.extent.XMin)/2, (df.extent.YMax+df.extent.YMin)/2)
##arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPt.X, myPt.Y))
##myPtGeometry = arcpy.PointGeometry(myPt)
##arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPtGeometry.firstPoint.X, myPtGeometry.firstPoint.Y))
##arcpy.SelectLayerByLocation_management ("DOQQImport", "COMPLETELY_CONTAINS", myPtGeometry)
arcpy.SelectLayerByLocation_management ("DOQQImport", "COMPLETELY_CONTAINS", "somePtLayer")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm thinking that while geometries can be used for geoprocessing, maybe they can't be used this way to make selections. Technically, selectByLocation isn't geoprocessing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 11:47:39 GMT</pubDate>
    <dc:creator>ScottOatley</dc:creator>
    <dc:date>2021-12-11T11:47:39Z</dc:date>
    <item>
      <title>Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233181#M18067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm writing some arcpy to select polygons that contain the centroid of my current data frame extent. Here's my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
myPt = arcpy.Point((df.extent.XMax+df.extent.XMin)/2, (df.extent.YMax+df.extent.YMin)/2)
myPtGeometry = arcpy.PointGeometry(myPt)

arcpy.SelectLayerByLocation_management ("DOQQImport", "COMPLETELY_CONTAINS", myPtGeometry)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code runs without error, and the coordinates of myPt/myPtGeometry are correct. Yet, nothing gets selected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing some coding step, or can you not use geometry this way?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 19:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233181#M18067</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2013-06-07T19:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233182#M18068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you running it with your python window on (in ArcMap) to see if it's doing anything.&amp;nbsp; Write some print statements for myPt and myPtGeometry variables to see if your geometry point has coordinates.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe try also including ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;DOQQImport = arcpy.mapping.ListLayers(mxd, "DOQQImport", df)&lt;/PRE&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then this... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
DOQQImport = arcpy.mapping.ListLayers(mxd, "DOQQImport", df)
myPt = arcpy.Point((df.extent.XMax+df.extent.XMin)/2, (df.extent.YMax+df.extent.YMin)/2)
myPtGeometry = arcpy.PointGeometry(myPt)
arcpy.SelectLayerByLocation_management (DOQQImport, "COMPLETELY_CONTAINS", myPtGeometry)&lt;/PRE&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you need to specifically reference a dataset.&amp;nbsp; My thought is that because&amp;nbsp; "DOQQImport" is not referenced the tool fails.&amp;nbsp; The python window will give you an error if this is so.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233182#M18068</guid>
      <dc:creator>danielchaboya</dc:creator>
      <dc:date>2021-12-11T11:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233183#M18069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I updated my code to include printing out x and y values of myPt and myPtGeometry with an AddMessage (I'm running the script from a toolbox). Both are correct, matching what I read on the screen with my cursor at the center of my data frame.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
myPt = arcpy.Point((df.extent.XMax+df.extent.XMin)/2, (df.extent.YMax+df.extent.YMin)/2)
arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPt.X, myPt.Y))
myPtGeometry = arcpy.PointGeometry(myPt)
arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPtGeometry.firstPoint.X, myPtGeometry.firstPoint.Y))
arcpy.SelectLayerByLocation_management ("DOQQImport", "COMPLETELY_CONTAINS", myPtGeometry)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The layer I'm trying this with is in a group. I tried moving it outside the group, but still nothing gets selected.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233183#M18069</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2021-12-11T11:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233184#M18070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I updated my code to include printing out x and y values of myPt and myPtGeometry with an AddMessage (I'm running the script from a toolbox). Both are correct, matching what I read on the screen with my cursor at the center of my data frame.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
myPt = arcpy.Point((df.extent.XMax+df.extent.XMin)/2, (df.extent.YMax+df.extent.YMin)/2)
arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPt.X, myPt.Y))
myPtGeometry = arcpy.PointGeometry(myPt)
arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPtGeometry.firstPoint.X, myPtGeometry.firstPoint.Y))
arcpy.SelectLayerByLocation_management ("DOQQImport", "COMPLETELY_CONTAINS", myPtGeometry)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The layer I'm trying this with is in a group. I tried moving it outside the group, but still nothing gets selected.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you run the tool within ArcMap and with the python window open?&amp;nbsp; I still think the issue has to do with your "DOQQImport" dataset.&amp;nbsp; It has to first be referenced before it can be used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233184#M18070</guid>
      <dc:creator>danielchaboya</dc:creator>
      <dc:date>2021-12-11T11:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233185#M18071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You may have to use arcpy.RefreshActiveView ??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 22:01:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233185#M18071</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-06-07T22:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233186#M18072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Daniel is right, I wasn't paying attention although you will likely also need RefreshActiveView to make the selection visible in your map's data frame...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this is your complete code, looks like you did a good job setting the objects for map, data frame (the 1st one, or only data frame in the map?), and the geometry object. But what is "DOQQImport"? I didn't test the following, but think if you get a reference to this (as Daniel said), this may work (is DOQQImport the exact layer name in the map's TOC?) -- also, I believe in this case the overlap type INTERSECT will give you virtually the same results as COMPLETELY_CONTAINS, so I'd just go with the default:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Highlighted in red are the critical changes to your code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

# need a 'handle' on all 3:&amp;nbsp; 'current' mxd, 1st data frame, DOQQ layer
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
DOQQImport = arcpy.mapping.ListLayers(mxd, "DOQQImport", df)

# your geometry object to select by looks fine
myPt = arcpy.Point((df.extent.XMax+df.extent.XMin)/2, (df.extent.YMax+df.extent.YMin)/2)
arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPt.X, myPt.Y))
myPtGeometry = arcpy.PointGeometry(myPt)
arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPtGeometry.firstPoint.X, myPtGeometry.firstPoint.Y))

# execute using the fetched layer and defined geom:
arcpy.SelectLayerByLocation_management (DOQQImport, "INTERSECT", myPtGeometry)
arcpy.RefreshActiveView()

arcpy.AddMessage("\nIs this your intended polygon selection result?")
arcpy.AddMessage("(If there are overlapping polys at this location, the result should be a multiple selection.)")

del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps, of course test as necessary!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:13:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233186#M18072</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-12T16:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233187#M18073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm sorry, I made an error on the ListLayers line...on all functions returning a Python list, always have to remember to specify a member of the list even if only 1 member is returned, so this is correct and think Daniel already specified the line -- I'll write it again below, also showing the use of wildcards in case you get nothing returned because the layer name in the TOC is not exact, for example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DOQQImport = arcpy.mapping.ListLayers(mxd, "*DOQQ*", df)[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again, sorry if that was misleading - and also it is desirable sometimes to loop on the list in case multiple layers are returned that you want to handle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 15:17:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233187#M18073</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-06-10T15:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233188#M18074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tested making a reference as suggested with no change in results - nothing gets selected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't believe the "DOQQImport" needs to be referenced. The layer is in the TOC, and I've used layers in other scripts without making such a reference. As a test I tried the following. I used an existing point layer ("somePtLayer") and manually selected one of its features that is covered by my DOQQImport polygon layer. I changed the code to use the point layer and the script successfully selected the correct polygons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
##myPt = arcpy.Point((df.extent.XMax+df.extent.XMin)/2, (df.extent.YMax+df.extent.YMin)/2)
##arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPt.X, myPt.Y))
##myPtGeometry = arcpy.PointGeometry(myPt)
##arcpy.AddMessage("{0}&amp;nbsp; {1}".format(myPtGeometry.firstPoint.X, myPtGeometry.firstPoint.Y))
##arcpy.SelectLayerByLocation_management ("DOQQImport", "COMPLETELY_CONTAINS", myPtGeometry)
arcpy.SelectLayerByLocation_management ("DOQQImport", "COMPLETELY_CONTAINS", "somePtLayer")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm thinking that while geometries can be used for geoprocessing, maybe they can't be used this way to make selections. Technically, selectByLocation isn't geoprocessing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233188#M18074</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2021-12-11T11:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233189#M18075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When creating the PointGeometry object, include the spatial reference of the coordinate that you are creating. Normally I do this from the sr of a another similar fc using the Describe object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers and good luck,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 07:48:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233189#M18075</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2013-06-11T07:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233190#M18076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, a very important distinction, Neil...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott, glad you solved your problem - there are however some subtleties you missed and Neil hit it right on the head. About the spatial reference, if your data frame and feature class spatial references do not match, that of course could be a reason no selection was in the result. (Another obvious reason could be no feature is otherwise available for selection, i.e., no existing feature at the select location.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my testing my data frame and layers were in the same 'frame' of reference --- that is to say, they shared the same spatial reference. So, as a simulation of the case where the spatial references do not match, I set the data frame to something 'off the wall' just to prove a point...to a Greenland UTM zone (I am in Florida.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As suspected, the select by location failed to select anything because the data frame centerpoint is on a different coord system...however, the documentation for Select Layer By Location allows you to set the output coord sys environment variable to overcome this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.outputCoordinateSystem&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some minor modifications of your code allow the select by location to execute successfully to make the desired selection, with the critical line in bold text below. With the output coord sys environment variable set to the spatial reference of the data frame, the select layer by location tool essentially projects on-the-fly the feature layer I use (parcels) from ArcMap's TOC (of the current map doc) to match the data frame spatial ref, which is of course the same 'reference' of the point object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd)[0]
 
parcels = arcpy.mapping.ListLayers(mxd, '*parcel*', df)[0]
sr_dataframe = df.spatialReference
sr_featureclass = arcpy.Describe(parcels).spatialReference

&lt;STRONG&gt;arcpy.env.outputCoordinateSystem = sr_dataframe&lt;/STRONG&gt;

myPt = arcpy.Point((df.extent.XMax + df.extent.XMin)/2.0, (df.extent.YMax + df.extent.YMin)/2.0)
myPtGeometry = arcpy.PointGeometry(myPt)

arcpy.AddMessage("\nThe fetched parcel layer from the TOC, {0}".format(parcels.name))
arcpy.AddMessage("\nThe data frame spatial reference name:&amp;nbsp; {0}".format(sr_dataframe.name))
arcpy.AddMessage("\nThe feature class (to select by) spatial reference name:&amp;nbsp; {0}".format(sr_featureclass.name))
arcpy.AddMessage("\nThe data frame centerpoint (myPt) - X: {0}&amp;nbsp; Y: {1}".format(myPt.X, myPt.Y))
arcpy.AddMessage("\nThe geometry (myPtGeometry) - {0}&amp;nbsp; {1}".format(myPtGeometry.firstPoint.X, myPtGeometry.firstPoint.Y))
arcpy.AddMessage("\n...now proceeding with the selection, please wait...\n")
 
arcpy.SelectLayerByLocation_management(parcels, 'INTERSECT', myPtGeometry)
arcpy.RefreshActiveView()
 
del mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So in 'my GIS', these are the relevant 'AddMessage' execution msgs I got running as a script tool from ArcMap with the parcel layer loaded in the current doc - notice the 'read' spatial ref names (obviously different) and that the actual point geometry obj is in the data frame reference as expected:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;**********************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The fetched parcel layer from the TOC, PARCEL_PUBLIC&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The data frame spatial reference name: Greenland_1996_UTM_Zone_23N&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The feature class (to select by) spatial reference name: NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901_Feet&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The data frame centerpoint (myPt) - X: -3358568.40446 Y: 3292414.02514&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The geometry (myPtGeometry) - -3358568.40446 3292414.02514&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...now proceeding with the selection, please wait...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;**********************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps, an important lesson I think in the spatial ref obj technique and geoprocessing -- great catch, Neil!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...the critical documentation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#0000CD&amp;quot;;"&gt;Select Layer By Location (Data Management) &lt;BR /&gt;Desktop Â» Geoprocessing Â» Tool reference Â» Data Management toolbox&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000072000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000072000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Output Coordinate System (Environment setting)&lt;BR /&gt;Desktop Â» Geoprocessing Â» Environment settings&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000005000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000005000000&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233190#M18076</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T11:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233191#M18077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings and thanks for the help so far.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had high hopes regarding the spatial reference issue, but I'm still not getting this to work. I've got the code updated to match Wayne's example.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]

DOQQImport = arcpy.mapping.ListLayers(mxd, 'DOQQImport', df)[0]
sr_dataframe = df.spatialReference
sr_featureclass = arcpy.Describe(DOQQImport).spatialReference

arcpy.env.outputCoordinateSystem = sr_dataframe

myPt = arcpy.Point((df.extent.XMax + df.extent.XMin)/2.0, (df.extent.YMax + df.extent.YMin)/2.0)
myPtGeometry = arcpy.PointGeometry(myPt)

##fc = 'points'
##cursor = arcpy.da.InsertCursor(fc, ["SHAPE@XY"])
##xy =(myPt.X, myPt.Y)
##cursor.insertRow([xy])

arcpy.AddMessage("\nThe fetched polygon layer from the TOC, {0}".format(DOQQImport.name))
arcpy.AddMessage("\nThe data frame spatial reference name:&amp;nbsp; {0}".format(sr_dataframe.name))
arcpy.AddMessage("\nThe feature class (to select by) spatial reference name:&amp;nbsp; {0}".format(sr_featureclass.name))
arcpy.AddMessage("\nThe data frame centerpoint (myPt) - X: {0}&amp;nbsp; Y: {1}".format(myPt.X, myPt.Y))
arcpy.AddMessage("\nThe geometry (myPtGeometry) - {0}&amp;nbsp; {1}".format(myPtGeometry.firstPoint.X, myPtGeometry.firstPoint.Y))
arcpy.AddMessage("\n...now proceeding with the selection, please wait...\n")

arcpy.SelectLayerByLocation_management(DOQQImport, 'INTERSECT', myPtGeometry)
arcpy.RefreshActiveView()

del df, mxd
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It successfully runs; here's my output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;[INDENT]Executing: gotoSiteLatLong&lt;BR /&gt;Start Time: Tue Jun 11 14:38:19 2013&lt;BR /&gt;Running script gotoSiteLatLong...&lt;BR /&gt;&lt;BR /&gt;The fetched polygon layer from the TOC, DOQQImport&lt;BR /&gt;&lt;BR /&gt;The data frame spatial reference name:&amp;nbsp; NAD_1983_UTM_Zone_15N&lt;BR /&gt;&lt;BR /&gt;The feature class (to select by) spatial reference name:&amp;nbsp; GCS_WGS_1984&lt;BR /&gt;&lt;BR /&gt;The data frame centerpoint (myPt) - X: 466834.903914&amp;nbsp; Y: 4975689.29185&lt;BR /&gt;&lt;BR /&gt;The geometry (myPtGeometry) - 466834.903914&amp;nbsp; 4975689.29185&lt;BR /&gt;&lt;BR /&gt;...now proceeding with the selection, please wait...&lt;BR /&gt;&lt;BR /&gt;Completed script gotoSiteLatLong...&lt;BR /&gt;Succeeded at Tue Jun 11 14:38:24 2013 (Elapsed Time: 5.00 seconds)[/INDENT]&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I still don't get any selected polygons. I tried changing the data frame coordinate system to match the feature class with similar results. Using the commented out code,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;##fc = 'points'
##cursor = arcpy.da.InsertCursor(fc, ["SHAPE@XY"])
##xy =(myPt.X, myPt.Y)
##cursor.insertRow([xy])
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to add a point at the center of my current extent, so my geometry is indeed creating a point in the correct location. And there are polygons in my feature class (DOQQImport) that cover the point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm stumped as to what I'm missing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233191#M18077</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2021-12-11T11:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233192#M18078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hold on a sec, is not a DOQQ a raster dataset?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...or are you simply referring to a grid outline of it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 19:09:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233192#M18078</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-06-11T19:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233193#M18079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;DOQQImport is a polygon layer whose polygons represent footprints of DOQQs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 19:19:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233193#M18079</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2013-06-11T19:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233194#M18080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Whew, well that's what I thought but thought I'd better check.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a min, do you think you can export a small extent and attach it here, and I'll take a quick look at it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; It may also be a good thing to get the number of selected features - add these 2 lines:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
count = arcpy.GetCount_management(DOQQImport).getOutput(0)
arcpy.AddMessage("The number in the selection:&amp;nbsp; {0}".format(count))
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, it could take a bit for the screen to refresh in order to show you the selection, particularly if a large number of layers have to draw at a considerable extent, etc.&amp;nbsp; Sorry, have to ask:&amp;nbsp; is the layer turned on, or is it perhaps obfuscated somehow?&amp;nbsp; At least the get count command will tell you if a selection was successfully made.&amp;nbsp; (And this is alluded to in the web help on Select Layer By Location as well but I forgot about it.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233194#M18080</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T11:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233195#M18081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've attached a snippet of the DOQQImport layer. They should show up around the Minneapolis area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 19:44:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233195#M18081</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2013-06-11T19:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233196#M18082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The code worked fine...I zoomed to the layer and because of the overlapping poly nature of the layer, I got 4 selected polygons after running the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you add the 2 lines for GetCount and to report back to you the number of features selected?&amp;nbsp; Then, if a feature selection is reported, are you 'zoomed in' too far to see the selected outline?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 20:01:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233196#M18082</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-06-11T20:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233197#M18083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've been running this as a script in a toolbox. I tried again here at home starting from scratch and get the same result, no selection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I opened the python window from the geoprocessing menu and pasted the code in there as is and it successfully selected some polygons!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So why does it work in the python window, but not as a script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 02:15:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233197#M18083</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2013-06-12T02:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233198#M18084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahm.. Gentlemen,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in the code above I still do not see you doing this -&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
myPtGeometry = arcpy.PointGeometry(myPt, sr)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe that without this, the select and any other geometry method will not work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, the object has properties (X, Y etc etc) and it looks like a point, but its not quite what it seems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;N&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233198#M18084</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-11T11:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233199#M18085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Noted Neil, and try that if you wish.&amp;nbsp; However, you are not correct on this one, particularly since the same script executes correctly from the Python window, and this is documented in the webhelp for Select Layer By Location and proven in my posted code above in setting the output extent environment, honored in my test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...think Scott has a different problem, although I don't know at this point.&amp;nbsp; Could it have something to do with running 'in process' and use of 'CURRENT' - perhaps that isn't operating properly for you Scott, and the direct cause just escapes me.&amp;nbsp; Just to confirm, you are running the script tool within an ArcMap document and when you check the properties of the tool it is checked 'in process'?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wouldn't hurt to try Neil's approach, inserting the param for the output extent into the param he noted for the geom, although likely that &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;won't work any differently&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp; I tried it at 10.0 SP 5 and the output extent var works there -- whatever version you are at, could be yours is exhibited a different behavior.&amp;nbsp; I duplicated your setup in my 10.0 and no problem.... confounding little problem, maybe someone else can contribute that has had a similar problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just curious, if you place your DOQQ layer export from yesterday that you posted, place that in a new mxd and save it at full extent of the layer (with the data frame set to the GCS coord sys, not the projected one of the layer), then run the script tool, do you get a selection?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Wayne&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...this is the full code, adding Neil's suggestion - for you to test.&amp;nbsp; I thought it should work either way, setting the outputCoordinateSystem env variable or setting the spatial ref param directly on the geom object itself.&amp;nbsp; It doesn't -- with the data frame set to a different spatial reference than the layer, I observed that the &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;setting of the outputCoordinateSystem environment variable was necessary and that the spatial reference parameter setting on the geometry object was optional&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nevertheless, &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;both&lt;/SPAN&gt;&lt;SPAN&gt; are incorporated in the code below.&amp;nbsp; Also, it has the 2 lines added for GetCount/AddMessage to report back in the dialog the number of features (if any) in the selection result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]

DOQQImport = arcpy.mapping.ListLayers(mxd, 'DOQQImport', df)[0]
sr_dataframe = df.spatialReference
sr_featureclass = arcpy.Describe(DOQQImport).spatialReference

# Setting outputCoordinateSystem env var was necessary,
# but see myPtGeometry below as well.
arcpy.env.outputCoordinateSystem = sr_dataframe

myPt = arcpy.Point((df.extent.XMax + df.extent.XMin)/2.0, (df.extent.YMax + df.extent.YMin)/2.0)

# Neil suggested this...in testing, setting this was optional.
# The spatial reference obj is used on the geometry itself:
myPtGeometry = arcpy.PointGeometry(myPt, sr_dataframe)

arcpy.AddMessage("\nThe fetched polygon layer from the TOC, {0}".format(DOQQImport.name))
arcpy.AddMessage("\nThe data frame spatial reference name:&amp;nbsp; {0}".format(sr_dataframe.name))
arcpy.AddMessage("\nThe feature class (to select by) spatial reference name:&amp;nbsp; {0}".format(sr_featureclass.name))
arcpy.AddMessage("\nThe data frame centerpoint (myPt) - X: {0}&amp;nbsp; Y: {1}".format(myPt.X, myPt.Y))
arcpy.AddMessage("\nThe geometry (myPtGeometry) - {0}&amp;nbsp; {1}".format(myPtGeometry.firstPoint.X, myPtGeometry.firstPoint.Y))
arcpy.AddMessage("\n...now proceeding with the selection, please wait...\n")

arcpy.SelectLayerByLocation_management(DOQQImport, 'INTERSECT', myPtGeometry)
arcpy.RefreshActiveView()

count = arcpy.GetCount_management(DOQQImport).getOutput(0)
arcpy.AddMessage("The number in the selection:&amp;nbsp; {0}".format(count))

del df, mxd
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:47:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233199#M18085</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T11:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select features using geometry objects</title>
      <link>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233200#M18086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm currently using 10.1 SP 1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Ahm.. Gentlemen,&lt;BR /&gt;&lt;BR /&gt;in the code above I still do not see you doing this -&lt;BR /&gt;Code:&lt;BR /&gt;&lt;BR /&gt;myPtGeometry = arcpy.PointGeometry(myPt, sr)&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Even though I didn't post code with pointGeometry(myPoint, sr), I did try that with a variety of coordinate system setups and with and without the env.outputCoordinateSystem setting. No combination has worked when running the script from a toolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Incidentally, my intention is to run this from an add-in toolbar which I tried today. It doesn't run there either. I also tried importing my toolbox to the python window and running it by calling interactively. That also didn't run. Only pasting the code directly to the python prompt in the python window runs correctly. In all cases I'm using the identical code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Just to confirm, you are running the script tool within an ArcMap document and when you check the properties of the tool it is checked 'in process'?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did you add the 2 lines for GetCount and to report back to you the number of features selected? Then, if a feature selection is reported, are you 'zoomed in' too far to see the selected outline? &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried this, and 0 is my result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe it's a 10.1 issue. I'll see if I've got 10.0 available on some machine at work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jun 2013 21:30:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-features-using-geometry-objects/m-p/233200#M18086</guid>
      <dc:creator>ScottOatley</dc:creator>
      <dc:date>2013-06-12T21:30:14Z</dc:date>
    </item>
  </channel>
</rss>

