var layout = LayoutView.Active.Layout; var mf = layout.GetElementsAsFlattenedList().OfType<MapFrame>() .First(mf => mf.Name == mapFrame); var autoCamera = mf.GetAutoCamera(); autoCamera.Source = AutoCameraSource.MapFrameLink; autoCamera.AutoCameraType = AutoCameraType.Extent; autoCamera.MapFrameLinkName = mapFrameLink; if (mf.ValidateAutoCamera(autoCamera) && !mf.IsMapSeriesMapFrame()) mf.SetAutoCamera(autoCamera);
var layout = LayoutView.Active.Layout; var mf = layout.GetElementsAsFlattenedList().OfType<MapFrame>() .First(mf => mf.Name == mapFrame); var autoCamera = mf.GetAutoCamera(); autoCamera.Source = AutoCameraSource.MapFrameLink; autoCamera.AutoCameraType = AutoCameraType.Center; autoCamera.MapFrameLinkName = mapFrameLink; var states = mf.Map.GetLayersAsFlattenedList().First(l => l.Name == "State_Polygons"); autoCamera.IntersectLayerPath = states.URI; if (mf.ValidateAutoCamera(autoCamera) && !mf.IsMapSeriesMapFrame()) mf.SetAutoCamera(autoCamera);
var layout = LayoutView.Active.Layout; var mf = layout.GetElementsAsFlattenedList().OfType<MapFrame>() .First(mf => mf.Name == mapFrame); var autoCamera = mf.GetAutoCamera(); autoCamera.Source = AutoCameraSource.MapFrameLink; autoCamera.AutoCameraType = AutoCameraType.CenterAndScale; autoCamera.MapFrameLinkName = mapFrameLink; var states = mf.Map.GetLayersAsFlattenedList().First(l => l.Name == "State_Polygons"); autoCamera.IntersectLayerPath = states.URI; if (mf.ValidateAutoCamera(autoCamera) && !mf.IsMapSeriesMapFrame()) mf.SetAutoCamera(autoCamera);
var layout = LayoutView.Active.Layout; var mf = layout.GetElementsAsFlattenedList().OfType<MapFrame>() .First(mf => mf.Name == mapFrame); var autoCamera = mf.GetAutoCamera(); autoCamera.Source = AutoCameraSource.MapFrameLink; autoCamera.AutoCameraType = AutoCameraType.Scale; autoCamera.MapFrameLinkName = mapFrameLink; var states = mf.Map.GetLayersAsFlattenedList().First(l => l.Name == "State_Polygons"); autoCamera.IntersectLayerPath = states.URI; if (mf.ValidateAutoCamera(autoCamera) && !mf.IsMapSeriesMapFrame()) mf.SetAutoCamera(autoCamera);
Target Platforms: Windows 11, Windows 10