I'm working with ArcGIS 10.2. I have an attribute table with many rows and I want to signal only one of this rows on map. What is the function of ArcMap that allows to do this automatically with arcpy?


If by signaling we're referring to the display of only one specific feature from your attribute table on the map, then using ArcPy this can be handled by the definitionQuery property of the associated Layer's Layer Object.

Specifying a definition query in ArcPy would look something like this:

import arcpy

Query_Attribute = "Item_No"
Query_Value = 150

my_layer = arcpy.MakeFeatureLayer_management("Path\\To\\My\\Feature Class")
my_layer.definitionQuery = Query_Attribute + " = " + str(Query_Value)

Refreshing the map display should reflect the change in the definiton query.

  • I did this but it didn't anything... It doesn´t display – S.Rai Aug 29 '16 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.