Is there a way to programmatically open Viewer/Magnifier etc. windows of ArcMap from Add-In? I am using 10.2, but anything 10.2+ will be fine.
1 Answer
Is this what you are looking for (ArcGIS 10.5.1)?
ESRI.ArcGIS.Framework.IApplication Application = this.Hook as ESRI.ArcGIS.Framework.IApplication;
ESRI.ArcGIS.ArcMapUI.MapViewerWindowFactory mvw = new ESRI.ArcGIS.ArcMapUI.MapViewerWindowFactoryClass();
mvw.Create(Application);
As an alternative you could use the tool to create the viewer window
//Searching the command
UID uid = new UIDClass();
uid.Value = "{709608E3-5C7E-11D2-87BB-0000F8751720}";
ESRI.ArcGIS.Framework.ICommandBars commandBars = ArcMap.Application.Document.CommandBars;
ESRI.ArcGIS.Framework.ICommandItem commandItem = commandBars.Find(uid, false, false);
//Executing the command
if (commandItem != null)
{
if (commandItem.Name == "Browse_NewMapInset")
{
commandItem.Execute();
}
}
Please have a look at the command reference here
-
yes. exactly! Actually already found it somewhere, just forgot to post here. Thank you very much, hope it helps others cause it was really hard to find. ^__^ Commented Sep 16, 2019 at 6:46