check if Curve is in a graph layer and return its plot index if true
int curve_in_layer_get_index( const curvebase & cuv, const GraphLayer & gl )
plot index if in layer, or -1 if not
EX1
//This example return the index of the specified column in all Graphs in current folder. void curve_in_layer_get_index_ex1() { Worksheet wks = Project.ActiveLayer(); if(!wks) return; Curve crv(wks, 1); Folder fld = wks.GetPage().GetFolder(); //go through all pages in folder to check GraphPage foreach(PageBase page in fld.Pages) { if(EXIST_PLOT == page.GetType()) { GraphPage gp = page; GraphLayer gl = gp.Layers(0); int nIndex = curve_in_layer_get_index(crv, gl); //if curve is in the layer, output some information such as:curve name, graph name, and index. if( nIndex >= 0 ) { string strCurve = crv.GetName(); string strGraph = page.GetName(); printf("The index of %s curve in %s window is %d\n", strCurve, strGraph, nIndex); } } } }
origin.h