Create a new rectangle graphic object in the given layer
GraphObject create_rect_object( GraphLayer grl, double left = 0.3, double top = 0.3, double dx = 0.4, double dy = 0.4 )
graphic obejct, invalid object if failed
EX1
//For this example to run, an active graph layer must exist in the project. void add_boxes(int nx = 2, int ny = 2) { GraphLayer grl = Project.ActiveLayer(); double width = 1. / (nx*2); double height = 1. / (ny*2); double incx = width * 2; // with a box width as gap double incy = height * 2; double x0 = width/2.; double y0 = height/2.; for(int ii = 0; ii < nx; ii++) { for(int jj = 0; jj < ny; jj++) { GraphObject gr = create_rect_object(grl, x0 + ii * incx, y0 + jj * incy, width, height); printf("created gr named %s\n", gr.GetName()); } } }
origin.h