<?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 Flash Selected Feature? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129681#M10075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anyone know how to Flash a Selected Feature using Python or to call the ArcObjects function through Python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a process set up to allow the user to easily Query a Layer and then Zoom to the Selected Feature, immediately after zooming to the feature though, I want the feature to Flash the same as it would through the Identify Window in order to draw the user's attention to it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried creating a crude version of it using SelectLayerByAttribute, but it's god-awful slow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
def crudeFlash(FeatureLayer, Query):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("Current")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df = arcpy.mapping.ListDataFrames(mxd)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(FeatureLayer, "NEW_SELECTION", Query)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.zoomToSelectedFeatures()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(FeatureLayer, "CLEAR_SELECTION")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(FeatureLayer, "NEW_SELECTION", Query)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(FeatureLayer, "CLEAR_SELECTION")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;gt;&amp;gt;&amp;gt; crudeFlash("MyLayer", '"NAME" = ' + "'MyFeature'")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I don't want to just leave the feature selected is that I don't want to create a situation where the User might then run some sort of GeoProcess and it only executes against the single selected feature.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jun 2014 19:50:07 GMT</pubDate>
    <dc:creator>JohnDye</dc:creator>
    <dc:date>2014-06-09T19:50:07Z</dc:date>
    <item>
      <title>Flash Selected Feature?</title>
      <link>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129681#M10075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anyone know how to Flash a Selected Feature using Python or to call the ArcObjects function through Python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a process set up to allow the user to easily Query a Layer and then Zoom to the Selected Feature, immediately after zooming to the feature though, I want the feature to Flash the same as it would through the Identify Window in order to draw the user's attention to it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried creating a crude version of it using SelectLayerByAttribute, but it's god-awful slow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
def crudeFlash(FeatureLayer, Query):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("Current")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df = arcpy.mapping.ListDataFrames(mxd)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(FeatureLayer, "NEW_SELECTION", Query)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.zoomToSelectedFeatures()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(FeatureLayer, "CLEAR_SELECTION")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(FeatureLayer, "NEW_SELECTION", Query)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management(FeatureLayer, "CLEAR_SELECTION")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;gt;&amp;gt;&amp;gt; crudeFlash("MyLayer", '"NAME" = ' + "'MyFeature'")
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I don't want to just leave the feature selected is that I don't want to create a situation where the User might then run some sort of GeoProcess and it only executes against the single selected feature.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2014 19:50:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129681#M10075</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2014-06-09T19:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Selected Feature?</title>
      <link>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129682#M10076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could try using the geometry and a search cursor instead.&amp;nbsp; It should be much faster and not involve selecting any features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;zoomToGeom = [row[0] for row in arcpy.da.SearchCursor(FeatureLayer,["SHAPE@"],query)][0]
df.extent = zoomToGeom&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You may have to run an arcpy.RefreshActiveView() afterwards if your view doesn't automatically refresh.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it zooms in too much, you can adjust it with something like this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.scale *= 1.25&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:18:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129682#M10076</guid>
      <dc:creator>MattEiben</dc:creator>
      <dc:date>2021-12-11T07:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Selected Feature?</title>
      <link>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129683#M10077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Matt,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That was a nice little improvement over df.zoomToSelectedFeatures() but I'm looking for a method to actually flash the selected feature as you can in ArcMap through the identify window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It generates a little crosshair on the screen and then flashes the feature in a kind of dark-green color.&lt;/SPAN&gt;&lt;BR /&gt;&lt;IMG src="http://resources.arcgis.com/en/help/main/10.1/00s5/GUID-F42D7805-6D58-44D1-A210-A5457CD2213D-web.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 18:39:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129683#M10077</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2014-06-10T18:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Selected Feature?</title>
      <link>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129684#M10078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As Sol was referencing, there seems to be a way to do this through the ArcObjects SDK as referenced at the bottom of this thread (Using C#):&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/23523-Programatically-PanTo-ZoomTo-and-then-Flash-features"&gt;http://forums.arcgis.com/threads/23523-Programatically-PanTo-ZoomTo-and-then-Flash-features&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't been able to find an equivalent in ArcPy yet though.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2014 19:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flash-selected-feature/m-p/129684#M10078</guid>
      <dc:creator>MattEiben</dc:creator>
      <dc:date>2014-06-10T19:54:36Z</dc:date>
    </item>
  </channel>
</rss>

