Can I define multiple definition queries for a single layer using python?

08-07-2020 05:27 AM
New Contributor III

I am familiar with using python to get and/or set a (single) definition query for a map layer. 

However, in Pro you can specify multiple different definition queries for a single layer (although only one, or none, can be active at any given time).  When I use the definitionQuery property of the layer object, I can get, or set, the currently active query.

But I would like to be able to create lots of different definition Queries for a given layer using python (and then get / set them using python as well).  Is there a way to do this that I'm missing?

We are getting around this at the moment by using python to create query expression (EXP) files and then importing them all in one go using the GUI.

0 Kudos
2 Replies
MVP Esteemed Contributor

See my response in .  It is possible, you just need to use the CIM components.

New Contributor

I am sorry, but I didn't figure out how to create multiple queries on the same layer by reading your comment :( 

0 Kudos