Definition Query dataset

1965
2
02-03-2016 08:56 PM
TabraizAhmed
New Contributor II

hello,

I need to develop an ARCMAP Addin tool by which i could set a definition query on a dataset, i have a number of layers with same "ID" field and I have to query out each layer one by one.

KINDLY GUIDE ME WITH THIS OR ANY OTHER SOLUTION IS ALSO APPRECIABLE.

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Tabraiz,

You could accomplish this by creating a python add-in.  You would want to use the arcpy.mapping.ListLayers function to iterate through each layer in your MXD.  You can then use Layer class to apply the definition query to each layer.

0 Kudos
AndreiElobogoev
New Contributor

Hello Tabraiz,

As another option, in the XTools Pro extension to ArcGIS there is a couple of tools that you could use for this task.

- Using Copy Layer Properties: create the required query for one layer, then just copy definition query property from this layer and paste to other layers.

- There is also Definition Query Manager tool allowing to manage queries for all layers in one place, this may also facilitate working with queries for many layers.

Hope this may help,

Andrei

0 Kudos