Is it possible to apply a definition query to a layer from python IDEs "Code editors" such as pyScripter?
I know that this cloud be easily done from the python window in ArcMap.
Nope. In fact, you can't apply a definition query directly to a feature class in ArcMap either. Definition queries are part of feature layers and table views, not feature classes and tables.
Yes, the steps are basically the same, just pass the MXD path to MapDocument—Help | ArcGIS Desktop instead of using "CURRENT".
Thank you Joshua, but is there any method to do that without saving layers to mxd file.
Is there a function that I can use to apply the query directly to the F.C ?
for example why I cant do this:
targetFC.definitionQuery = "[objectid] = '1'
Retrieving data ...