Select to view content in your preferred language

Feasibility of using an external GUI to interact with ArcPro similar to using the python console pane?

943
5
Jump to solution
06-07-2022 05:11 PM
Glasnoct
Regular Contributor

Is it possible to interact with an open ArcPro session by means other than the GP tools or python console? I'm currently running scripts through either of those things but I got to thinking today as I was learning about tkinter whether or not there is a way press a button within a custom gui that would be able to send commands to an open ArcPro session much like pasting it manually into the console would be. We're currently dealing with an innumerable amount of unique features that could more easily be worked with if all it took was a single button press to, say, run an item-specific da.SelectByAttributes that returns that exact item from previously stored data as opposed to clicking my way through the select by attributes pane or via a GP tool or via the python console.

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Oh, Pro has/does/will supported Add-ins... See here.

Add-ins are authored using .NET along with Esri’s Desktop Application Markup Language (DAML)—an XML language created by Esri. DAML describes the customizations; .NET classes provide the custom behavior. The ArcGIS Pro software development kit (SDK) includes an Add-In Wizard that integrates with Microsoft Visual Studio to simplify development.

An alternative to this and is pure python is creating python script tools. create-a-python-script-tool 

View solution in original post

0 Kudos
5 Replies
by Anonymous User
Not applicable

I think the ArcGIS Pro SDK Corehost or A Pro addin would be the vessel you’re describing. Lots of samples, but not as easy to find things  as googling ‘arcpy xyz’ or ‘arcgis js api xyz’ is. 

0 Kudos
Glasnoct
Regular Contributor

Add-ins aren't supported in ArcPro nor planned to be, unless I've missed something. 

I looked at Corehost a bit but it looks over my head unless there's some minimally viable code I can get away with to be able to pass python through to the instance.

0 Kudos
by Anonymous User
Not applicable

Oh, Pro has/does/will supported Add-ins... See here.

Add-ins are authored using .NET along with Esri’s Desktop Application Markup Language (DAML)—an XML language created by Esri. DAML describes the customizations; .NET classes provide the custom behavior. The ArcGIS Pro software development kit (SDK) includes an Add-In Wizard that integrates with Microsoft Visual Studio to simplify development.

An alternative to this and is pure python is creating python script tools. create-a-python-script-tool 

0 Kudos
Glasnoct
Regular Contributor

Ah, I see there are .Net add-ins. I know when I search add-ins and python the latest ESRI response on python add-ins is there are no plans to support them. And I already use script tools but I'm looking for an alternative for what would essentially be micro-scripts.

 

I suppose I'll have to dig into this .Net add-in stuff but I don't know the first thing about .Net so that's going be a bear. I'm wondering if I can make an add-in that listens/receives from the python GUI and just passes it to the python env within the instance...

0 Kudos
Glasnoct
Regular Contributor

I just thought of a possible alternative.

- create script tool that reads from a placeholder file
- python GUI overwrites the button's function to the file
- script tool reads the line from the placeholder file and acts accordingly.

That sounds like a decent workaround though it still involves clicking the GUI, clicking the script tool button, and clicking run. It would be nice if I could call and run the script tool via a single hotkey (like accelerators but without having to hit the run button or pull up the GP pane). Guess I could get around that with PyAutoGui.

0 Kudos