【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.14.1.3 create_rect_object
Contents
Description
Create a new rectangle graphic object in the given layer
Syntax
GraphObject create_rect_object( GraphLayer grl, double left = 0.3, double top = 0.3, double dx = 0.4, double dy = 0.4 )
Parameters
- grl
- [modify] the layer to add the rect, layer is modified as a result of adding an object
- left
- [input] rect's left position in fraction of the layer's bounding box
- top
- [input] rect's top position in fraction of the layer's bounding box
- dx
- [input] rect's width in fraction of the layer's bounding box
- dy
- [input] rect's height in fraction of the layer's bounding box
Return
graphic obejct, invalid object if failed
Examples
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()); } } }
Remark
See Also
Header to Include
origin.h