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/
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.