comet.rect

The comet.rect module is the factory for comet.CRect objects.

Methods

comet.rect.create(left, top, right, bottom)

Create a rectangle with the given side coordinates.

Parameters:
  • left (float) – Left side

  • top (float) – Top side

  • right (float) – Right side

  • bottom (float) – Bottom side

Returns:

The new rectangle

Return type:

CRect

Raises:

TypeError – When parameter types are invalid

Available:

InDesign® comet_pdf® Illustrator®

CScript:

rect::alloc

Examples:

Create a rectangle in landscape format.

rect = comet.rect.create(0.0, 0.0, 100.0, 30.0)
comet.rect.createSquare(edgeLength, x=0.0, y=0.0)

Create a square rectangle with the given edge length at the given coordinates.

Parameters:
  • edgeLength (float) – The edge length of all edges

  • x (float) – Horizontal center of the rectangle

  • y (float) – Vertical center of the rectangle

Returns:

The new rectangle

Return type:

CRect

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter edgeLength has invalid value

Available:

InDesign® comet_pdf® Illustrator®

CScript:

rect::alloc

Examples:

Create a square rectangle with an edge length of 50.0 with the center at 20.0/60.0

rect = comet.rect.createSquare(50.0, 20.0, 60.0)