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

675
3
Jump to solution
03-30-2018 10:24 AM
TomFlahive
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)
0 Kudos
1 Solution

Accepted Solutions
JeffBarrette
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
JeffBarrette
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.

TomFlahive
New Contributor III

Sounds good.  Thank you Jeff.

0 Kudos
JeffBarrette
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);

0 Kudos