0

I'm quiet new to ArcObjects and I need some help. My main issue is that I have an external WPF application (a video player exactly), and from that application I want to perform the following actions in the current instance of ArcMap:

  • From my application get the currently running instance of ArcGIS desktop or ArcMap
  • Send coordinates and display a bitmap at that location

Frankly I don't know from where I should start, so here are my questions:

  1. Is it possible to access the current running session of ArcGIS from a third party program?
  2. Is it possible to send coordinates to ArcGIS this way?
  3. Should I convert my application to an AddIn? How can i perform that, if you have any useful indications it will be great.

1 Answer 1

3

Massi,

You would use automation to drive ArcMap from another application. For example I have developed extensions that are referenced by MS Access which will open up ArcMap, load an MXD fire off a select by attribute query and zoom to the selected extent. This can all be achieved using automation. Look at this page, there is an explanation and sample code.

But I notice you state you have a WPF application. I have no experience in using WPF but there is a page about it here discussing its uses and limitations.

Below is some VB6 code I used in Access to connect\start ArcMap, this will get you going.

' Get a count on how many instances of ArcMap are running
Dim pApp As IApplication
Dim pDocument As IDocument
Dim pAppROT As AppROT
Dim AppROTCount As Integer
Dim AppROTCountInt As Integer
Set pAppROT = New AppROT
Let AppROTCount = pAppROT.Count
Let AppROTCountInt = pAppROT.Count
Dim b As Boolean
Dim pWindowPos As IWindowPosition

If AppROTCount = 0 Then
    ' No instances of any ESRI applications are running
    ' Start Arcmap...
Else
    Set pApp = pAppROT.Item(0)
    If TypeOf pApp Is IMxApplication Then
        ' OK user has ArcMap open, access document title
        Dim DocTitle As String
        Let DocTitle = pApp.Document.Title
    End If
End If
7
  • Hi Thanks for your light, but with automation is it possible to not start arcmap but only send informations to the curent renuing arcmap?
    – Massi Dah
    Commented Jun 2, 2013 at 19:47
  • Yes you could connect to an existing session of arcmap
    – Hornbydd
    Commented Jun 3, 2013 at 8:58
  • And can you share with, how to perform such action?
    – Massi Dah
    Commented Jun 3, 2013 at 9:07
  • 1
    +1 You may also need to do some hacking, as described in Man the Message Pumps. Commented Jun 4, 2013 at 15:16
  • I've done this by implementing an ArcMap extension, exposing a COM interface with methods I wanted to perform cross-process. Then, through AppROT, which gives you reference to the running ArcMap instance (IApplication), I access my extension and call methods on the defined interface. These calls are marshalled via the message loop.
    – Petr Krebs
    Commented Jun 4, 2013 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.