Skip to main content
View as Markdown

IPCB_Fill interface

A fill on a PCB document, a rectangular object defined by two corners and a rotation.

public interface IPCB_Fill : IPCB_RectangularPrimitive

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive → IPCB_RectangularPrimitive

Remarks​

A fill is a rectangular primitive (IPCB_RectangularPrimitive): its corners are (X1Location, Y1Location) and (X2Location, Y2Location) and its rotation is Rotation. Length, Width, LocationX and LocationY are not stored separately; they are calculated from the corners and assigning them changes the corners.

Example​

Create a new PCB document and place a rotated fill on its bottom layer.

using DXP;
using PCB;

// Create a new PCB document.
IDXPWorkSpace workspace = DXP.GlobalVars.Client.GetDXPWorkspace();
if (workspace == null)
return;
workspace.DM_CreateNewDocument("PCB");
IPCB_ServerInterface pcbServer = PCB.GlobalVars.PCBServer;
IPCB_Board board = pcbServer.GetCurrentPCBBoard();
if (board == null)
return;

// Create a fill object.
var fill = pcbServer.PCBObjectFactory(TObjectId.eFillObject, TDimensionKind.eNoDimension, TObjectCreationMode.eCreate_Default) as IPCB_Fill;
fill.SetState_X1Location(EDP.Utils.MilsToCoord(2000));
fill.SetState_Y1Location(EDP.Utils.MilsToCoord(2000));
fill.SetState_X2Location(EDP.Utils.MilsToCoord(2500));
fill.SetState_Y2Location(EDP.Utils.MilsToCoord(2500));
fill.SetState_Layer(TV6_Layer.eV6_BottomLayer);
fill.SetState_Rotation(45);

// Add the new fill to the PCB design database.
board.AddPCBObject(fill);

// Refresh the PCB document.
DXP.Utils.RunCommand("PCB:Zoom", "Action=All");

Properties​

PropertyTypeAccessDescription
Lengthintget; setThe extent of the fill in X, X2Location minus X1Location, in internal units (10,000 per mil).
LocationXintget; setThe X coordinate of the center of the fill, midway between X1Location and X2Location, in internal units (10,000 per mil).
LocationYintget; setThe Y coordinate of the center of the fill, midway between Y1Location and Y2Location, in internal units (10,000 per mil).
Widthintget; setThe extent of the fill in Y, Y2Location minus Y1Location, in internal units (10,000 per mil).

Length​

The extent of the fill in X, X2Location minus X1Location, in internal units (10,000 per mil).

int GetState_Length();
void SetState_Length(int argNewValue);

Type: int · Access: read/write

Assigning a value sets X2Location to X1Location plus the value; X1Location does not change.

LocationX​

The X coordinate of the center of the fill, midway between X1Location and X2Location, in internal units (10,000 per mil).

int GetState_LocationX();
void SetState_LocationX(int argNewValue);

Type: int · Access: read/write

Assigning a value moves the fill in X so that its center is at the new coordinate and keeps its extent in X, rounded down to an even number of internal units; afterwards X1Location is the smaller of the two X coordinates.

LocationY​

The Y coordinate of the center of the fill, midway between Y1Location and Y2Location, in internal units (10,000 per mil).

int GetState_LocationY();
void SetState_LocationY(int argNewValue);

Type: int · Access: read/write

Assigning a value moves the fill in Y so that its center is at the new coordinate and keeps its extent in Y, rounded down to an even number of internal units; afterwards Y1Location is the smaller of the two Y coordinates.

Width​

The extent of the fill in Y, Y2Location minus Y1Location, in internal units (10,000 per mil).

int GetState_Width();
void SetState_Width(int argNewValue);

Type: int · Access: read/write

Assigning a value sets Y2Location to Y1Location plus the value; Y1Location does not change.

Inherited members​

Accepted by​

IPCB_ContourMaker.MakeContour_3, IPCB_ContourMaker2.MakeContour_13