I am using the CallScriptFromNet pro sdk community sample to run a python script in Pro via an addin. If i add the script through pro in a toolbox it runs fine but if i build an addin that runs it from the CallScriptFromNet example it errors on the "CURRENT" value of arcpy.mp.ArcGISProject. Is there something in the way it's being run from an addin that makes the python script run differently? Has anyone found a solution for this?
CallScriptFromNet example: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geoprocessing/CallScriptFromNet
My Updated .py Script:
from arcpy import env
aprx = arcpy.mp.ArcGISProject("CURRENT")
aprxFolder = aprx.homeFolder
mname = aprx.activeMap.name
m = aprx.listMaps(mname)