Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.
share|improve this question
add comment

1 Answer 1

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
share|improve this answer
    
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 Jun 2 '13 at 19:47
    
Yes you could connect to an existing session of arcmap –  Hornbydd Jun 3 '13 at 8:58
    
And can you share with, how to perform such action? –  Massi Dah Jun 3 '13 at 9:07
1  
+1 You may also need to do some hacking, as described in Man the Message Pumps. –  Kirk Kuykendall Jun 4 '13 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 Jun 4 '13 at 20:04
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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