definition query and mosaic dataset from gdb ArcMap 10.1 SP1

995
1
01-29-2013 03:30 AM
IABG_mbHIABG_mbH
New Contributor II
I have a Python AddIn Combobox to select a value from the drop-down list. This value changes the definition query of the layers in mxd. This works fine for "normal" feature classes, not for a mosaic dataset. On the Layer Properties dialog box the DefinitionQuery tab is empty.
layer_lst = arcpy.mapping.ListLayers(arcpy.mapping.MapDocument("CURRENT"))

for layer in layer_lst:

   if layer.name in ('dted_hillshade','dted_dem6x6') and layer.supports("DEFINITIONQUERY"):

      layer.definitionQuery = "\"NAME\"=\'000E00N.DT2\'"
      arcpy.RefreshActiveView()


Does anyone one know a workaround to set a correct definition query for mosaic dataset?

Thanks PolyGeo, the problem encountering NIM067173 or NIM076742...
Tags (2)
0 Kudos
1 Reply
T__WayneWhitley
Frequent Contributor
Just curious, are double quotes the appropriate field delimiter in your query?  Not sure if you've checked this already or if this will be the 'fix', but if layers in the CURRENT map are not of the same workspace type, you may need to make the field delimiters 'sensitive' to the workspace and enter a line to AddFieldDelimiters...  That should make the query formed for the definitionQuery property more 'layer appropriate' instead of hard-coding the query for each with the same double quotes.

Wayne
0 Kudos