Select to view content in your preferred language

Problem with simple definition query expression

2257
10
04-28-2017 02:41 AM
KONPETROV
Frequent Contributor

I am trying to assign a value to two shapefiles in the first data frame of my .mxd with definition query, but it seems that cannot be done.

Any suggestion? Thanks

Here is the code:

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for lyr in arcpy.mapping.ListLayers(mxd):  
    if lyr.name == "waste":  
        lyr.definitionQuery == "Code = 'IT1300021'"
0 Kudos
10 Replies
DanPatterson_Retired
MVP Emeritus

abandoned likely... converting to discussion

0 Kudos