Note: this tool is updated in XTools Pro 12.1
Definition Query Manager
Purpose
Definition Query Manager is provided for more efficient work with definition queries in ArcGIS. Extending standard queries it supports multiple definition queries applied to one layer and also allows turning selections to definition queries.
Description
Definition Query Manager provides a button on the toolbar for turning on/off current definition query applied to the selected layer (or a few selected layers) and the Query Manager itself is available from the layer context menu (Definition queries menu item) in the TOC window and from the main toolbar menu.
With this feature you can create as many queries as you need and easily switch between them.
Usage
Typical usage scenarios for the Definition Query Manager tool include:
-
Turning current definition queries on and off for the selected layer from the toolbar
-
Determining if there are definition queries currently applied to the selected layer
-
Creating multiple definition queries for one layer
-
Managing all queries for all map layers from one place
-
Switching between queries
-
Turning selections to definition queries
Turning current definition queries on and off from the toolbar
Having selected a layer with a definition query applied you can turn the query on and off pressing the button on the toolbar. If the query is currently applied then the button is highlighted as selected. This way you can always see if the definition query is currently applied to the selected layer, meaning:
- Definition query icon disabled: no definition query for the layer
- Definition query icon enabled: there is at least one definition query specified for the layer but not applied at the moment
- Definition query icon enabled and highlighted: there is a definition query currently applied to the layer
Creating new definition queries and managing queries
Definition query manager dialog is available from the layer context menu in the TOC window:
Using the Definition Query Manager you can create as many queries as you need. The manager displays all layers in the current map, you can manage definition queries for all layers from one single place.
With the Definition Query Manager dialog you can:
- Create new definition queries with a standard Query Builder dialog
- Edit existing queries with the same standard dialog
- View the selected query info (shows number of features selected by the query)
- Remove selected query or all queries
- Load/save queries
- Activate/deactivate queries
- Pan and zoom to the selected queries on the map
Last but really not least, you can name your queries. In those cases when you may have quite complicated queries it can be easier to use shorter names. These names are then displayed in the layer context menu. If there is no name specified for the query then the query itself is displayed.
New queries can be also created the usual way in the Layer Properties dialog, they will be recognized by the Definition Query Manger and added as an additional query.
Switching between definition queries
Having a few definition queries created for a layer you can promptly switch between them from the layer context menu:
For the convenient work with multiple definition queries the menu displays the names that can be shorter and more meaningful than queries itself. Besides, when you hover the mouse pointer over the query name the underlying query is displayed as well.
Turning selections to definition queries
Definition Query Manager in XTools Pro allows turning current selections to definition queries. This can be made in two ways for the layers with selected features:
- From the layer's context menu, see the screenshot above
- In the Definition Query Manager dialog, using the From Selection button in the list on the right
At that, there is a maximum limit applied to the number of selected features that you can turn to a definition query. If there are more than 2000 features selected you won't be able to make a definition query from them and a corresponding message will be prompted.
This may be considered as an additional way to create definition queries - either manually, selecting features with a mouse, or using advanced selecting capabilities in ArcMap (Select by Attributes, Select by Location, Select by Graphics).
---