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)?
I checked the MapFrame object and the Layout object, but did not see any properties that would tell me which map frame is active.
Solved! Go to Solution.
This propery has not yet been exposed but thank you for bringing this to our attention - we will expose it in an upcoming release.
This propery has not yet been exposed but thank you for bringing this to our attention - we will expose it in an upcoming release.
Sounds good. Thank you Jeff.
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);