Select to view content in your preferred language

Remote control from external Application through SDK

613
3
Jump to solution
09-23-2022 08:26 AM
TOPOGRAPHICS
New Contributor II

Hello,

is it possible to access ArcGIS Pro Functions from ArcGISPor SDK from a external Program (CoreHost)?

For example:
1. Start ArcGIS Pro
2. Load a Project (-File)
3. Read all layers in this Project
4. Select Objects (over Attribut) in a layer and zoom to the Object

It means a Remote control to ArcGIS Pro, but not form a AddIn, but fom a external program, wiritten in c#.
Which basic steps we have to follow?

Thanks a lot for any hints!

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I attached two sample solutions that show how to remote start and remote control ArcGIS Pro from an ArcGIS Corehost application.
This sample is comprised of two samples:

  • Corehost server application that starts and controls the ArcGIS Pro client: ArcGISProConfigCoreHost
  • ArcGIS Pro client application that is started and controlled: ArcGISProConfig

To use the sample:

1. Make sure this project is available: "C:\Data\FeatureTest\FeatureTest.aprx" or change the path in the Corehost application.
1. Run the client application: ArcGISProConfigCoreHost
1. Note that the AppDomain is modified on startup to resolve the Assembly Paths for ArcGIS.Core.dll and ArcGIS.CoreHost.dll by using the ArcGIS Pro installation location.
1. The ArcGISProConfigCoreHost console application starts ArcGIS Pro with the "ArcGISProConfig" Managed Configuration

Screen1.png

1. Once ArcGISProConfig has started and is ready, ArcGISProConfigCoreHost sends the project path: "C:\Data\FeatureTest\FeatureTest.aprx" to be opened
1. ArcGISProConfig opens the project
Screen2.png
1. Once the output stops press any key to close the application.
1. Close the "ArcGISProConfig" client session (ArcGIS Pro) using the User Interface. Note that closing can be automated as well.
1. The "ArcGISProConfigCoreHost" Corehost application terminates after ArcGIS Pro has been closed.
Screen3.png

View solution in original post

0 Kudos
3 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

i think you would start ArcGIS Pro (from a console app) using a Configuration.  The Configuration extension option allows you to write custom code for the start sequence (i.e. loading a project, zoom in, add layers etc.), and then either look at instructions in a file or use some type of Inter Process Communication between you two processes.   So in essence this would allow you to automate some ArcGIS Pro (Desktop app) processing.  Here is more information on Configurations in case you are not familiar: ProConcepts Configurations · Esri/arcgis-pro-sdk Wiki (github.com)

I will try to write some sample code that shows this type of workflow and post it here.

 

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I attached two sample solutions that show how to remote start and remote control ArcGIS Pro from an ArcGIS Corehost application.
This sample is comprised of two samples:

  • Corehost server application that starts and controls the ArcGIS Pro client: ArcGISProConfigCoreHost
  • ArcGIS Pro client application that is started and controlled: ArcGISProConfig

To use the sample:

1. Make sure this project is available: "C:\Data\FeatureTest\FeatureTest.aprx" or change the path in the Corehost application.
1. Run the client application: ArcGISProConfigCoreHost
1. Note that the AppDomain is modified on startup to resolve the Assembly Paths for ArcGIS.Core.dll and ArcGIS.CoreHost.dll by using the ArcGIS Pro installation location.
1. The ArcGISProConfigCoreHost console application starts ArcGIS Pro with the "ArcGISProConfig" Managed Configuration

Screen1.png

1. Once ArcGISProConfig has started and is ready, ArcGISProConfigCoreHost sends the project path: "C:\Data\FeatureTest\FeatureTest.aprx" to be opened
1. ArcGISProConfig opens the project
Screen2.png
1. Once the output stops press any key to close the application.
1. Close the "ArcGISProConfig" client session (ArcGIS Pro) using the User Interface. Note that closing can be automated as well.
1. The "ArcGISProConfigCoreHost" Corehost application terminates after ArcGIS Pro has been closed.
Screen3.png

0 Kudos
TOPOGRAPHICS
New Contributor II

Thanks a lot for this nice Example!

0 Kudos