How do you determine which map frame is active in a layout?

142
3
Jump to solution
03-30-2018 10:24 AM
Highlighted
New Contributor III

I would like to resize a map frame in a layout.  If the layout has more than one map frame, as in the screenshot below, how can I determine which map frame is currently the active map frame (which shows as bolded in the Contents pane)?

Select map frame in a layout with multiple map frames.

I checked the MapFrame object and the Layout object, but did not see any properties that would tell me which map frame is active.

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor

This propery has not yet been exposed but thank you for bringing this to our attention - we will expose it in an upcoming release.

View solution in original post

3 Replies
Highlighted
Esri Regular Contributor

This propery has not yet been exposed but thank you for bringing this to our attention - we will expose it in an upcoming release.

View solution in original post

Highlighted
New Contributor III

Sounds good.  Thank you Jeff.

Reply
0 Kudos
Highlighted
Esri Regular Contributor

This has been addressed for the ArcGIS Pro 2.2 release.  There is a r/o property called ActiveMapFrame on the LayoutView class.

//ActiveMapFrame
LayoutView lytView = LayoutView.Active;
if (lytView == null)
{
System.Windows.MessageBox.Show("No LayoutView");
return;
}
MapFrame mf = lytView.ActiveMapFrame;
if (mf == null)
System.Windows.MessageBox.Show("No MapFrame");
else
System.Windows.MessageBox.Show(mf.Name);

Reply
0 Kudos