I have created one script which set a defination query at certain location in script.
I use lyr.definitionquery = "some expression"
After running the script i want to remove the definition query . But not getting any hint to do it.
asked Aug 19, 2016 at 10:04
2 Answers 2
Just clear that property:
lyr.definitionQuery = None
None
is the python for NULL
, so making it = None will clear the query.
answered Aug 19, 2016 at 10:12
-
2I always do it using ""2016年08月19日 10:29:43 +00:00Commented Aug 19, 2016 at 10:29
-
Yes you can also do it using
""
but I don't think it matters. I've developed a habit of using Nulls over empty strings, but either works.2016年08月19日 10:51:24 +00:00Commented Aug 19, 2016 at 10:51
I use an empty string to clear a definition query from a layer:
lyr.definitionQuery = ""
answered Sep 5, 2016 at 9:25
lang-py
definitionquery
should bedefinitionQuery