Hi Katie,
There is an example codes to find maxized graphs and add plots from selected graphs to a newly created graph on one layer. But this example need Origin8.
void testGraphs()
{
// find maximized graphs
vector<string> vsGraphs;
foreach(GraphPage gp in Project.GraphPages)
{
if( PAGE_MAXIMIZED == gp.GetShow() )
vsGraphs.Add( gp.GetName() );
}
GraphPage gpNew;
gpNew.Create("Origin");
GraphLayer glNew = gpNew.Layers();
// add plots from selected graph to one new graph in one layer
for(int nn = 0; nn < vsGraphs.GetSize(); nn++)
{
Page pg(vsGraphs[nn]);
foreach(Layer lay in pg.Layers)
{
GraphLayer gl(lay);
Tree tr;
bool bWasGroup = gl.UngroupPlots();
gl.GetLayerContents(tr, GETLC_DATAPLOTS | GETLC_NO_LIMITS);
int nPlots = glNew.AddPlots(tr.FirstNode, ADDPLOTSFROMTREE_NEW | ADDPLOTSFROMTREE_IMPLICIT_STYLEHOLDERS); // returns total number of data plots in the layer
}
}
}
Iris