
# IPCB_Fill interface

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

```csharp
public interface IPCB_Fill : IPCB_RectangularPrimitive
```

**Namespace:** PCB · **Assembly:** Altium.SDK.Interfaces

**Inherits:** [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md) → [IPCB_RectangularPrimitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md)

## Remarks

A fill is a rectangular primitive ([`IPCB_RectangularPrimitive`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md)): its corners are ([`X1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location), [`Y1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location)) and ([`X2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x2location), [`Y2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y2location)) and its rotation is `Rotation`. `Length`, `Width`, [`LocationX`](#locationx) and [`LocationY`](#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.

```csharp
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

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [Length](#length) | `int` | get; set | The extent of the fill in X, [`X2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x2location) minus [`X1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location), in internal units (10,000 per mil). |
| [LocationX](#locationx) | `int` | get; set | The X coordinate of the center of the fill, midway between [`X1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location) and [`X2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x2location), in internal units (10,000 per mil). |
| [LocationY](#locationy) | `int` | get; set | The Y coordinate of the center of the fill, midway between [`Y1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location) and [`Y2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y2location), in internal units (10,000 per mil). |
| [Width](#width) | `int` | get; set | The extent of the fill in Y, [`Y2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y2location) minus [`Y1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location), in internal units (10,000 per mil). |

### Length

The extent of the fill in X, [`X2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x2location) minus [`X1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location), in internal units (10,000 per mil).

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

**Type:** `int` · **Access:** read/write

Assigning a value sets [`X2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x2location) to [`X1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location) plus the value; [`X1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location) does not change.

### LocationX

The X coordinate of the center of the fill, midway between [`X1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location) and [`X2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x2location), in internal units (10,000 per mil).

```csharp
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`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location) is the smaller of the two X coordinates.

### LocationY

The Y coordinate of the center of the fill, midway between [`Y1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location) and [`Y2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y2location), in internal units (10,000 per mil).

```csharp
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`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location) is the smaller of the two Y coordinates.

### Width

The extent of the fill in Y, [`Y2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y2location) minus [`Y1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location), in internal units (10,000 per mil).

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

**Type:** `int` · **Access:** read/write

Assigning a value sets [`Y2Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y2location) to [`Y1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location) plus the value; [`Y1Location`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location) does not change.

## Inherited members

- From [IPCB_RectangularPrimitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md): [IsRedundant](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#isredundant), [RotateAroundXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#rotatearoundxy), [Rotation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#rotation), [SetState_XSizeYSize](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#setstate_xsizeysize), [X1Location](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x1location), [X2Location](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#x2location), [XLocation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#xlocation), [Y1Location](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y1location), [Y2Location](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#y2location), [YLocation](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_RectangularPrimitive.md#ylocation)
- From [IPCB_Primitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md): [AllowGlobalEdit](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#allowglobaledit), [BeginModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#beginmodify), [Board](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#board), [BoundingRectangle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangle), [BoundingRectangleChildren](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectanglechildren), [BoundingRectangleForPainting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforpainting), [BoundingRectangleForSelection](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#boundingrectangleforselection), [CancelModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#cancelmodify), [Component](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#component), [Coordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#coordinate), [DescriptorString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#descriptorstring), [DetailString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#detailstring), [Dimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#dimension), [DrawAsPreview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drawaspreview), [DRCError](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#drcerror), [Enabled](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled), [Enabled_Direct](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_direct), [Enabled_vComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcomponent), [Enabled_vCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vcoordinate), [Enabled_vDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vdimension), [Enabled_vNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vnet), [Enabled_vPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabled_vpolygon), [EnableDraw](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#enabledraw), [EndModify](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#endmodify), [Export_ToParameters](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#export_toparameters), [FlipXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#flipxy), [GraphicallyInvalidate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#graphicallyinvalidate), [Handle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#handle), [Identifier](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#identifier), [InBoard](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inboard), [InComponent](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incomponent), [InCoordinate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#incoordinate), [Index](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#index), [InDimension](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#indimension), [InNet](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#innet), [InPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inpolygon), [InSelectionMemory](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#inselectionmemory), [IsAssyTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_bottom), [IsAssyTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isassytestpoint_top), [IsElectricalPrim](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iselectricalprim), [IsFreePrimitive](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#isfreeprimitive), [IsHidden](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ishidden), [IsKeepout](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#iskeepout), [IsPreRoute](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#ispreroute), [IsSaveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#issaveable), [IsTenting](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting), [IsTenting_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_bottom), [IsTenting_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istenting_top), [IsTestPoint_Bottom](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_bottom), [IsTestPoint_Top](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#istestpoint_top), [Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#layer), [MiscFlag1](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag1), [MiscFlag2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag2), [MiscFlag3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#miscflag3), [Moveable](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#moveable), [MoveByXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movebyxy), [MoveToXY](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#movetoxy), [Net](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#net), [ObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectid), [ObjectIDString](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#objectidstring), [PadCacheRobotFlag](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#padcacherobotflag), [PasteMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#pastemaskexpansion), [Polygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygon), [PolygonOutline](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#polygonoutline), [PowerPlaneClearance](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneclearance), [PowerPlaneConnectStyle](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplaneconnectstyle), [PowerPlaneReliefExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#powerplanereliefexpansion), [Preview](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#preview), [ReliefAirGap](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefairgap), [ReliefConductorWidth](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefconductorwidth), [ReliefEntries](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#reliefentries), [Replicate](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#replicate), [RequiredParamterSpace](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#requiredparamterspace), [RotateBy](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#rotateby), [Selected](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#selected), [SolderMaskExpansion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#soldermaskexpansion), [SwapLayerPairs](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#swaplayerpairs), [TearDrop](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#teardrop), [UnionIndex](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#unionindex), [UniqueId](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid), [UniqueID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#uniqueid-1), [Used](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#used), [UserRouted](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#userrouted), [V7Layer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#v7layer), [ViewableObjectID](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Primitive.md#viewableobjectid)

## Accepted by

[IPCB_ContourMaker.MakeContour_3](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_3), [IPCB_ContourMaker2.MakeContour_13](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_13)
