Here's an interesting question (at least I think it's interesting).
Does anyone know of a good way for a Python script to detect which ArcGIS Application it is being excecuted from?
I have a couple of tools in a Python Toolbox, several of which produce Feature Class outputs. I would like to detect in the script whether or not the script tool is being executed from within ArcMap, and if so to automatically pop a layer into the data frame referencing the result FC. If not, just create the FC and that's it.
putting a layer into the DF in the Current MXD is easy enough, but I'm not sure how to allow the script to detect if it is being executed in ArcMap, Catalog, Scene, Globe, ect, so that I can build the logic appropriately.
Any one got any clever ideas?
Does anyone know of a good way for a Python script to detect which ArcGIS Application it is being excecuted from?
I have a couple of tools in a Python Toolbox, several of which produce Feature Class outputs. I would like to detect in the script whether or not the script tool is being executed from within ArcMap, and if so to automatically pop a layer into the data frame referencing the result FC. If not, just create the FC and that's it.
putting a layer into the DF in the Current MXD is easy enough, but I'm not sure how to allow the script to detect if it is being executed in ArcMap, Catalog, Scene, Globe, ect, so that I can build the logic appropriately.
Any one got any clever ideas?