Project::LayoutPages

Description

Collection of all the layout pages in the project.

 

Get a layout window by index.

 

Get a LayoutPage object by name.

Syntax

Collection<LayoutPage> LayoutPages

LayoutPage LayoutPages(int index)

LayoutPage LayoutPages(LPCSTR lpcszName)

Parameters

index
[input] The 0-offset index of the LayoutPage object in open project.

lpcszName
[input] Name of the layout page in Origin.

Return

Returns a valid LayoutPage object for the index'th LayoutPage object in the project or an invalid LayoutPage object.

Returns a valid LayoutPage object having the short name lpcszName or an invalid LayoutPage object.

Examples

EX1

// This example assumes several existing layout windows
int Project_LayoutPages_ex1()
{
    // Loop over all the graph pages in the project and display their names
    foreach(LayoutPage lp in Project.LayoutPages)
    {
        out_str(lp.GetName());
    }
    return 0;
}

EX2

// This example assumes at least one existing layout window in Origin
int Project_LayoutPages_ex2()
{
        LayoutPage lp = Project.LayoutPages(0); // Get the first layout page
        if( lp.IsValid() )
                out_str(lp.GetName()); // Display the name of the first created layout page
        return 0;
}

EX3

// This example assumes at least one existing layout window in Origin
int Project_LayoutPages_ex3(string strName = "Layout1")
{
        LayoutPage lp = Project.LayoutPages(strName); // Get the LayoutPage for the layout window in Origin having the short name strName
        if( lp.IsValid() ) // If valid...
                out_str(lp.GetName()); // Use the LayoutPage object to display the name of the window
        return 0;
}

Remark

header to Include

origin.h

See Also

Project::Pages, Project::WorksheetPages, Project::Notes, Project::MatrixPages, Project::GraphPages, Project::LooseDatasetNames, Project::DatasetNames

Reference