The Esri Community
Services & Programs
GeoNet Resource Hub
to create and rate content, and to follow, bookmark, and share content with other members.
Discussion created by
on Sep 27, 2011
on Sep 30, 2011 by enigma2522
Show 0 Likes
Are there any samples which show interaction with ArcMap such as getting a reference to IApplication and interacting with things such as selected features?
This content has been marked as final.
Show 1 comment
(Required, will not be published)
Sep 30, 2011 9:53 AM
I managed to solve the issue. Here is my solution:
ESRI.ArcGIS.ArcMapUI.IMxDocument mxDoc = null;
ESRI.ArcGIS.Framework.IApplication app = null;
//get instance of the running AppRot
ESRI.ArcGIS.Framework.IAppROT appRot = new ESRI.ArcGIS.Framework.AppROTClass();
//Loop through running application
for (int i = 0; i < appRot.Count; i++)
app = (ESRI.ArcGIS.Framework.IApplication)appRot.get_Item(i);
mxDoc = app.Document as ESRI.ArcGIS.ArcMapUI.IMxDocument;
//find correct instance by job name in application caption
if (mxDoc != null && app.Caption.ToLower().Contains("job_" + JobID))
i = appRot.Count;
app = null;
mxDoc = null;
Show 0 Likes
Retrieving data ...
ArcGIS Desktop 10.4 - The search window has disappeared
ArcMap Search Window Missing
Update Source Option for Services Hosted in ArcGIS Online & Portal
FIX YOUR TRACE TOOL!!
Resetting your ArcGIS application profile