Project::GraphPages

Contents

Description

Collection of all the graph pages in the project.

 

Get a graph window by index.

 

Get a GraphPage object by name.

Syntax

Collection<GraphPage> GraphPages

GraphPage GraphPages(int index)

GraphPage GraphPages(LPCSTR lpcszName)

Parameters

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

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

Return

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


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

Examples

EX1

// This example assumes several existing graph windows
int Project_GraphPages_ex1()
{
    // Loop over all the graph pages in the project and display their names
    foreach(GraphPage gp in Project.GraphPages)
    {
        out_str(gp.GetName());
    }
    return 0;
}

EX2

// This example assumes at least one existing graph window in Origin
int Project_GraphPages_ex2()
{
        GraphPage gp = Project.GraphPages(0); // Get the first graph page
        if( gp.IsValid() )
                out_str(gp.GetName()); // Display the name of the first created graph page
        return 0;
}

EX3

// This example assumes at least one existing graph window in Origin
int Project_GraphPages_ex3(string strName = "Graph1")
{
        GraphPage gp = Project.GraphPages(strName); // Get the GraphPage for the graph window in Origin having the short name strName
        if( gp.IsValid() ) // If valid...
                out_str(gp.GetName()); // Use the GraphPage 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::LayoutPages, Project::LooseDatasetNames, Project::DatasetNames

Reference