Hi ! I created an Add-in project using the ArcGIS Pro SDK for .NET (C#) and now I'm trying to call the Add-in methods from my Python scripts using ArcPy but I didn't find neither documentation nor examples how to achieve this, I've tried some things however it didn't work and now I'm stuck... So I'm wondering if someone knows or has any ideas how to do this ?
What type of functionality is in your C# code that you would like to call from Python?
A more typical code pattern would be to have C# code call Python using the Geoprocessing API as demonstrated in this sample:
Actually all our production line is based on ArcPy scripts, however we’re using ArcGIS Pro SDK for .Net (C#) for one specific functionality that can’t be done with ArcPy: export the annotations baselines (the polylines not the bounding box polygons) into a new Feature Class, that’s why we need to call C# code from Python.
So the functionalities that have been implemented in C# are:
Would you have any idea how we could accomplish this?
Thank you for your attention to this matter. Best regards.
Currently there's no way to call an ArcGIS Pro SDK Add-In from a python script.
So, I implemented a workaround: I created a Console Application, which will be called from a python script, like an entry-point.
Note: This workaround only works if you're working with "ArcGIS.Core" and "ArcGIS.Corehost" assemblies, it crashes for all the other assemblies (ArcGIS.Desktop.*)