GetSelectedLayers
To get layer/sheets selection
int GetSelectedLayers( vector<int> & vnIndices, vector<string> & vsNames = NULL )
< 0 for errors but otherwise return the number of selected layers
EX1
// to get the name of selected layers int Page_GetSelectedLayers_Ex1() { WorksheetPage wp = Project.Pages(); if( !wp ) return -1; vector<string> vsNames; int nn = wp.GetSelectedLayers(NULL, vsNames); for(int ii = 0; ii < vsNames.GetSize(); ii++) out_str(vsNames[ii]); return 0; }
EX2
// to get the index of selected layers int Page_GetSelectedLayers_Ex2() { WorksheetPage wp = Project.Pages(); if( !wp ) return -1; vector<int> vns; int nn = wp.GetSelectedLayers(vns); for(int ii = 0; ii < vns.GetSize(); ii++) printf("The index is : %d\n", vns[ii]); return 0; }
origin.h