1

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 1

1

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

1
  • 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. ^__^
    – shika-kun
    Commented Sep 16, 2019 at 6:46

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.