Reorder plots in a specific group or all plots in GraphLayer.
int GraphLayer::ReorderPlots(const vector<uint>& vnIndices, int c1 = 0, BOOL bUndo = FALSE);
-1 if vnIndices does not exist
-2 if the size of vnIndices plus c1 is larger than the total number of plots
-3 if try to reorder a sub part of a group. Maybe you should do UngroupPlots firstly.
0 if success, or the size of vnIndices is zero
EX1
//reorder all plots // you will need to have a graph which has exactly 4 plots to use this code void test_ReorderPlots() { GraphLayer gl = Project.ActiveLayer();//gl is the active layer vector<uint> vecUI = {1,0,3,2};//vecUI contains the reorder sequence counting from 0 int nRet = gl.ReorderPlots(vecUI); printf("%d",nRet); }
EX2
//reorder a specific group in graph whose indexes starting from 2 // you will need to have a graph which has at least 2 group of plots to use this code void test_ReorderPlots() { GraphLayer gl = Project.ActiveLayer();//gl is the active layer vector<uint> vecUI = {1,0};//the group contains exactly 2 plots int nRet = gl.ReorderPlots(vecUI,2); printf("%d",nRet); }
origin.h