Using a C# .Net add-in I need to run a custom python script tool from my toolbox from with-in the map in Pro. The sample "CallScriptFromNet" will not work because it runs the Python script from outside of the Pro environment. I have things in the script that uses many layers from the "CURRENT" map so it fails running it the way the sample shows. The script works great when I run it from the toolbox, but I cannot figure out how to run it from the .Net add-in. I am thinking I need to use some sort of combination of getting a Geoprocessing Project Item and Executing it?
Solved! Go to Solution.
Here is a link to my project if you want and have time to take a look :
In test1.py, almost everything is in comment because it's meant for test.
The only thing to change ot test the button is the path of the python code in the RunPyScriptButton.cs.
Our system is not letting me download from the link – you can send as zip attachment.