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
| Property | Type | Access | Description |
|---|---|---|---|
| Rotation | double | get; set | The rotation of the primitive, in degrees. |
| X1Location | int | get; set | The X coordinate of the first corner of the rectangle, in internal units (10,000 per mil). |
| X2Location | int | get; set | The X coordinate of the second corner of the rectangle, in internal units (10,000 per mil). |
| XLocation | int | get; set | The X coordinate of the primitive's reference point, in internal units (10,000 per mil). |
| Y1Location | int | get; set | The Y coordinate of the first corner of the rectangle, in internal units (10,000 per mil). |
| Y2Location | int | get; set | The Y coordinate of the second corner of the rectangle, in internal units (10,000 per mil). |
| YLocation | int | get; set | The 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
| Method | Returns | Description |
|---|---|---|
| IsRedundant | bool | Returns whether the primitive is redundant. |
| RotateAroundXY | void | Rotates the primitive about a point by an angle. |
| SetState_XSizeYSize | bool | Recalculates 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argX | int | value | The X coordinate of the point to rotate about, in internal units (10,000 per mil). |
argY | int | value | The Y coordinate of the point to rotate about, in internal units (10,000 per mil). |
argngle | double | value | The 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
- From IPCB_Primitive: AllowGlobalEdit, BeginModify, Board, BoundingRectangle, BoundingRectangleChildren, BoundingRectangleForPainting, BoundingRectangleForSelection, CancelModify, Component, Coordinate, DescriptorString, DetailString, Dimension, DrawAsPreview, DRCError, Enabled, Enabled_Direct, Enabled_vComponent, Enabled_vCoordinate, Enabled_vDimension, Enabled_vNet, Enabled_vPolygon, EnableDraw, EndModify, Export_ToParameters, FlipXY, GraphicallyInvalidate, Handle, Identifier, InBoard, InComponent, InCoordinate, Index, InDimension, InNet, InPolygon, InSelectionMemory, IsAssyTestPoint_Bottom, IsAssyTestPoint_Top, IsElectricalPrim, IsFreePrimitive, IsHidden, IsKeepout, IsPreRoute, IsSaveable, IsTenting, IsTenting_Bottom, IsTenting_Top, IsTestPoint_Bottom, IsTestPoint_Top, Layer, MiscFlag1, MiscFlag2, MiscFlag3, Moveable, MoveByXY, MoveToXY, Net, ObjectID, ObjectIDString, PadCacheRobotFlag, PasteMaskExpansion, Polygon, PolygonOutline, PowerPlaneClearance, PowerPlaneConnectStyle, PowerPlaneReliefExpansion, Preview, ReliefAirGap, ReliefConductorWidth, ReliefEntries, Replicate, RequiredParamterSpace, RotateBy, Selected, SolderMaskExpansion, SwapLayerPairs, TearDrop, UnionIndex, UniqueId, UniqueID, Used, UserRouted, V7Layer, ViewableObjectID