I have a database of orders, with geo data attached.
I want the subset of features related to a specific order to be highlighted on screen (for starters in ArcMap, but later in Flex)
in a python geoprocessing script I use SelectLayerByAttribute, and this seems to work. (I printed the GetCount and got 11 reported).
However, I do not see the selection being hilighted in the map. (since I have to search multiple layers later, a script seems unavoidable)
should a selection made in this way be automatically visible in arcMap (and selected in table view) ? If not, how do I achieve this effect, i.e. that a selection made in the geoprocessing script is visible by the user firing off the script ?
code :
# -*- coding: utf-8 -*-
# Import arcpy module
import arcpy
#input parameters
Order_To_Find = arcpy.GetParameterAsText(0)
try:
mxd = arcpy.mapping.MapDocument(r"E:\GIS\GIS_projecten\034_Werkorders\04_Map\orders.mxd")
whereclause = " \"ORDERNUMMER\" LIKE \'%CEM MIGRATIE_ 17%\' "
for lyr in arcpy.mapping.ListLayers(mxd):
print lyr.name
if lyr.name == "MUT_E_ASSET_GEO_ACT_P":
arcpy.SelectLayerByAttribute_management(lyr,"NEW_SELECTION",whereclause)
except:
print arcpy.GetMessages()