Skip to main content
View as Markdown

IPCB_RectangularPrimitive interface

The base interface of PCB primitives whose shape is a rectangle with a rotation, such as IPCB_Fill, IPCB_Text and IPCB_EmbeddedBoard.

public interface IPCB_RectangularPrimitive : IPCB_Primitive

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive

Derived: IPCB_EmbeddedBoard, IPCB_Fill, IPCB_MultilineText, IPCB_Text, IPCB_Viewport

Remarks​

The corners (X1Location, Y1Location) and (X2Location, Y2Location) define the boundary of the rectangle, XLocation and YLocation its reference point, and Rotation its rotation. The coordinates are in internal units (10,000 per mil).

Properties​

PropertyTypeAccessDescription
Rotationdoubleget; setThe rotation of the primitive, in degrees.
X1Locationintget; setThe X coordinate of the first corner of the rectangle, in internal units (10,000 per mil).
X2Locationintget; setThe X coordinate of the second corner of the rectangle, in internal units (10,000 per mil).
XLocationintget; setThe X coordinate of the primitive's reference point, in internal units (10,000 per mil).
Y1Locationintget; setThe Y coordinate of the first corner of the rectangle, in internal units (10,000 per mil).
Y2Locationintget; setThe Y coordinate of the second corner of the rectangle, in internal units (10,000 per mil).
YLocationintget; setThe Y coordinate of the primitive's reference point, in internal units (10,000 per mil).

Rotation​

The rotation of the primitive, in degrees.

double GetState_Rotation();
void SetState_Rotation(double argRotation);

Type: double · Access: read/write

X1Location​

The X coordinate of the first corner of the rectangle, in internal units (10,000 per mil).

int GetState_X1Location();
void SetState_X1Location(int argX1);

Type: int · Access: read/write

The corners (X1Location, Y1Location) and (X2Location, Y2Location) define the boundary of the primitive.

X2Location​

The X coordinate of the second corner of the rectangle, in internal units (10,000 per mil).

int GetState_X2Location();
void SetState_X2Location(int argX2);

Type: int · Access: read/write

The corners (X1Location, Y1Location) and (X2Location, Y2Location) define the boundary of the primitive.

XLocation​

The X coordinate of the primitive's reference point, in internal units (10,000 per mil).

int GetState_XLocation();
void SetState_XLocation(int argX);

Type: int · Access: read/write

Y1Location​

The Y coordinate of the first corner of the rectangle, in internal units (10,000 per mil).

int GetState_Y1Location();
void SetState_Y1Location(int argY1);

Type: int · Access: read/write

The corners (X1Location, Y1Location) and (X2Location, Y2Location) define the boundary of the primitive.

Y2Location​

The Y coordinate of the second corner of the rectangle, in internal units (10,000 per mil).

int GetState_Y2Location();
void SetState_Y2Location(int argY2);

Type: int · Access: read/write

The corners (X1Location, Y1Location) and (X2Location, Y2Location) define the boundary of the primitive.

YLocation​

The Y coordinate of the primitive's reference point, in internal units (10,000 per mil).

int GetState_YLocation();
void SetState_YLocation(int argY);

Type: int · Access: read/write

Methods​

MethodReturnsDescription
IsRedundantboolReturns whether the primitive is redundant.
RotateAroundXYvoidRotates the primitive about a point by an angle.
SetState_XSizeYSizeboolRecalculates the stored size of the primitive.

IsRedundant​

Returns whether the primitive is redundant.

bool IsRedundant();

Returns: bool

For a fill, returns true when the rectangle has no width or no height: X1Location equals X2Location, or Y1Location equals Y2Location. For text and embedded boards the method always returns false.

RotateAroundXY​

Rotates the primitive about a point by an angle.

void RotateAroundXY(int argX, int argY, double argngle);
ParameterTypePassingDescription
argXintvalueThe X coordinate of the point to rotate about, in internal units (10,000 per mil).
argYintvalueThe Y coordinate of the point to rotate about, in internal units (10,000 per mil).
argngledoublevalueThe rotation angle, in degrees.

Returns: nothing (void)

The primitive is moved around the point and the angle is added to Rotation; the size of the primitive is then recalculated. For a fill, the center of the rectangle is rotated about the point and the corners keep their offsets from it, so passing the center (midway between X1Location and X2Location, and between Y1Location and Y2Location) rotates the fill without moving it; you can also use the Rotation property. For an embedded board the method always rotates by 90 degrees, whatever angle is passed.

SetState_XSizeYSize​

Recalculates the stored size of the primitive.

bool SetState_XSizeYSize();

Returns: bool

For a fill it also recalculates the area of the rectangle. RotateAroundXY calls this method itself.

Inherited members​