Select to view content in your preferred language

ArcPy.Mapping "Update Layer" - Support Definition Query

752
1
10-12-2010 05:23 PM
Status: Already Offered
RachelLerm2
Deactivated User

When using the UpdateLayer function in ArcPyMapping, please add a parameter for the definition_query.

This parameter could be set to true, false.

True - to update the definition query using the source_layer.
False - to leave the definition query of the update_layer.

This would allow the symbology of a layer to be updated, while leaving the existing definition query.
This would be extremely useful in a mapbooks environment (a layer is used for different layouts/scale pages with different layer definition queries).

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/UpdateLayer/00s30000003p000000/

1 Comment
JeffBarrette
Status changed to: Already Offered

Closing this ArcMap issue.  There is a solution in ArcGIS Pro.

We made great improvements in Pro concerning definition queries (DQs).  Pro layers now support multiple DQs and our API allows you to not only change a DQ (like ArcMap could), but also add multiple DQs and set the active DQ.  Much of this is mentioned in the help via the following Layer members

Layer.definitionQuery  - in ArcMap and Pro

Layer.listDefinitionQueries ({wildcard})  - new in Pro

Layer.updateDefinitionQueries (definitionQueries) - new in Pro

Layer—ArcGIS Pro | Documentation

NOTE - Pro does NOT have an UpdateLayer.  Our model has changed quite a bit.  There is a similar, but different method in Pro:

Layer.pasteProperties (which has an option to paste all properties or limited collections, including DQs).  The list of options is in the Layer help link above.

I hope this helps,

Jeff