In a custom ArcMap command implemented in .NET C# I create a new data frame this way:
// mxDocument is IMxDocument IMap newMap = mxDocument.Maps.Create(); // create new data frame newMap.Name = "I can name it as I want: " + Guid.NewGuid(); mxDocument.Maps.Add(newMap); mxDocument.ActiveView = (IActiveView)newMap; // activate new data frame mxDocument.UpdateContents();
However, compared to the data frame created with standard ArcMap means, there is something wrong with my data frame:
- ArcMap doesn't show property page for the data frame (right click - Properties)
- It's not possible to remove my data frame from ArcMap (right click - Remove)
Do I have to add some initialization code for IMap created with IMaps.Create (IMaps2.Create)?
The help for the method is quite laconic: "Creates a new map"...
I use ArcGIS version 10.2.2.