Hi,
I have a problem when running a Python code from a toolbox. The purpose of my code is to apply definition queries to layers in an ArcGIS Pro projec (aprx), then zoom to the a specific extent using:
mf.camera.setExtent(new_ext)
The code works fine when I use the python window within ArcGIS Pro and set the ArcGIS Project to "CURRENT":
aprx = arcpy.mp.ArcGISProject('CURRENT')
However, it does not work when I move the code to a toolbox and run it. Of course I change the ArcGIS Project from "CURRENT" to the exact Path of the aprx file.
Your help is greatly appreciated!
Regards,
Moath