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 ...
survey123 time field - select seconds not just hours/minutes
Adding shapefile name to attribute table?
How to add a file name as a field in attribute table
Adding a field name and Parsing the filename in model builder
Batch add field, calculate field as filename