Hello, Esri Team
I trying to create programmatically in ArcGIS Pro SDK C#, a Button that create and open a Page Layout ; I already could create and open the page layout but I can’t find the code to change the Page orientation (Portrait, landscape) in the classes (CIMPage Class, Layout Class, LayoutFactory Class).
Does exist some class that I can use to change the orientation property of the Page Layout?.
My code:
protected override async void OnClick()
{
Layout newLayout = await QueuedTask.Run<Layout>(() =>
{
// Create a new CIM page
CIMPage newPage = new CIMPage();
// Add properties
newPage.Width = 17;
newPage.Height = 11;
newPage.Units = LinearUnit.Inches;
// Add rulers
newPage.ShowRulers = true;
newPage.SmallestRulerDivision = 0.5;
// Apply the CIM page to a new layout and set name
newLayout = LayoutFactory.Instance.CreateLayout(newPage);
newLayout.SetName("Layout Carta");
return newLayout;
});
var layoutPane = await ProApp.Panes.CreateLayoutPaneAsync(newLayout);
MessageBox.Show("Layout Creado.");
}
Thanks