AddBoxEx Method

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:14

Description

Creates a box on the page with specified coordinates, size, and angle of rotation.

The weight is set from the personal preferences (Default box).

Syntax

Page.AddBoxEx (dim1, dim2, dim3, dim4, int5)

dim1        

X position, in mpt. 0 is left edge of the page. Add Page.GetLeftM to a value, to start from the left margin.

dim2        

Y position, in mpt. 0 is top edge of the page. Add Page.GetTopM to a value, to start from the top margin.

dim3

width, in mpt.

dim4

height, in mpt.

int5        

rotation angle, counter-clock wise, in tenths of degree

Examples

Page.AddBoxEx (Page.GetLeftM, Page.GetTopM, Page.GetColW, Page.GetModH, 0)

Inserts a 1-column wide and 1 module high box in the top left corner of the page.

x = Page.GetLeftM + Units.ToVal("1ncol")+Page.GetInterCol

Page.AddBoxEx (x, Page.GetTopM, Page.GetColW, Page.GetModH, 0)

Inserts a 1-column wide and 1 module high box, starting from the 2nd column in the top of the page.

Page.AddBoxEx (Page.GetLeftM, Page.GetTopM, Page.GetColW, Page.GetModH, 450)

Inserts a 1-column wide and 1 module high box in the top left corner of the page, rotated 45 degrees.

 

Examples of parameters

Rotation angle

0

non-rotated element

450

rotated for 45° around top left corner, counter-clockwise

-335

rotated for 33.5° around top-left corner, clockwise

 

Remarks

The method returns error code. 0 means it was successful, 1201 means the page was not available, 1202 means the page was read-only.

Context

Page designer

Rules/boxes creation related commands

AddBoxEx, AddElliEx, AddHRuleEx, AddVRuleEx, ObjSetBorderWeight, ObjSetBorderColor