ArcGIS Pro代码修改布局方向
private void SwitchPageOrientation() { if (LayoutView.Active == null) return; var layout = LayoutView.Active.Layout; QueuedTask.Run(() => { var page = layout.GetPage(); //what is the orientation? var orientation = page.Height > page.Width ? PageOrientation.Portrait : PageOrientation.Landscape; //TODO - use orientation as needed //switch portrait->landscape or vice versa var wd = page.Width; var ht = page.Height; page.Height = wd; page.Width = ht; //Available at 3.1 layout.SetPage(page, true);//resize the page elements //Available at 3.0 and 2.x //layout.SetPage(page);<-- use this flavor for no element resizing //layout.SetPage(page, false);<-- or set the resize flag false }); }