
# IPCB_Region interface

A solid polygonal region on a PCB document, such as a copper region, a cutout, a named region, a board cutout or a cavity.

```csharp
public interface IPCB_Region : IPCB_Primitive
```

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

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

**Derived:** [IPCB_BoardRegion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardRegion.md), [IPCB_ComponentBody](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ComponentBody.md), [IPCB_Region2](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Region2.md), [IPCB_SplitPlaneRegion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SplitPlaneRegion.md)

## Remarks

A region can also be used in a footprint as a fill of any polygonal shape. `Kind` determines what the region is.

The shape of a region is an outline contour with any number of hole contours: [`GetMainContour`](#getmaincontour) returns the outline, [`GetHoleCount`](#getholecount) and [`GetHole`](#gethole) the holes, and [`GeometricPolygon`](#geometricpolygon) the whole shape.

## Properties

| Property | Type | Access | Description |
| --- | --- | --- | --- |
| [Area](#area) | `long` | get | The area enclosed by the region's outline. |
| [CavityHeight](#cavityheight) | `int` | get; set | The region's cavity height, in internal units (10,000 per mil). |
| [GeometricPolygon](#geometricpolygon) | [IPCB_GeometricPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_GeometricPolygon.md) | get; set | The region's shape as a geometric polygon, with the outline and all holes. |
| [Kind](#kind) | [TRegionKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TRegionKind.md) | get; set | The kind of the region, which determines what it is on the board. |
| [Name](#name) | `string` | get; set | The region's name. |

### Area

The area enclosed by the region's outline.

```csharp
long GetState_Area();
```

**Type:** `long` · **Access:** read-only

The value is recalculated from the current shape each time it is read. Only the outline contour is measured: the areas of the holes are not subtracted.

### CavityHeight

The region's cavity height, in internal units (10,000 per mil).

```csharp
int GetState_CavityHeight();
void SetState_CavityHeight(int argValue);
```

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

### GeometricPolygon

The region's shape as a geometric polygon, with the outline and all holes.

```csharp
IPCB_GeometricPolygon GetGeometricPolygon();
void SetGeometricPolygon(IPCB_GeometricPolygon argGeometricPolygon);
```

**Type:** [IPCB_GeometricPolygon](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_GeometricPolygon.md) · **Access:** read/write

The accessors are extension methods of `IPCB_RegionHelper` (`using PCB;`).

Assigning a polygon replaces the region's outline and all its holes with a copy of the polygon's contours; the first contour that is not a hole becomes the outline. `Area` is recalculated.

### Kind

The kind of the region, which determines what it is on the board.

```csharp
TRegionKind GetState_Kind();
void SetState_Kind(TRegionKind argValue);
```

**Type:** [TRegionKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TRegionKind.md) · **Access:** read/write

The accessors are extension methods of `IPCB_RegionHelper` (`using PCB;`).

The default is `TRegionKind.eRegionKind_Copper`.

**See also:** [TRegionKind](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/TRegionKind.md)

### Name

The region's name.

```csharp
string GetState_Name();
void SetState_Name(string argValue);
```

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

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [GetHole](#gethole) | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | Returns a hole contour of the region. |
| [GetHoleCount](#getholecount) | `int` | Returns the number of hole contours in the region. |
| [GetMainContour](#getmaincontour) | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | Returns the outline contour of the region. |
| [IsSimpleRegion](#issimpleregion) | `bool` | Returns whether the region is an ordinary region rather than a board region. |
| [RotateAroundXY](#rotatearoundxy) | `void` | Rotates the region about the given point. |
| [SetOutlineContour](#setoutlinecontour) | `void` | Replaces the region's outline with the given contour. |

### GetHole

Returns a hole contour of the region.

```csharp
IPCB_Contour GetHole(int argI);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argI` | `int` | value | The zero-based index of the hole, from 0 to [`GetHoleCount`](#getholecount) minus 1. |

**Returns:** [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md)

Extension method of `IPCB_RegionHelper` (`using PCB;`).

### GetHoleCount

Returns the number of hole contours in the region.

```csharp
int GetHoleCount();
```

**Returns:** `int`

The value is one less than the number of contours of the shape, so it is -1 for a region without an outline.

### GetMainContour

Returns the outline contour of the region.

```csharp
IPCB_Contour GetMainContour();
```

**Returns:** [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md)

Extension method of `IPCB_RegionHelper` (`using PCB;`).

**Examples:** [Extension_CreatePCBLib](https://github.com/AltiumDeveloper/ad-sdk-examples/blob/5b144f54740a53ec578b3b6c3f902b831e0b1144/Extension_CreatePCBLib/Source%20Code/Commands.cs#L97)

### IsSimpleRegion

Returns whether the region is an ordinary region rather than a board region.

```csharp
bool IsSimpleRegion();
```

**Returns:** `bool`

Returns false for a board region ([`IPCB_BoardRegion`](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_BoardRegion.md)) and true for every other region.

### RotateAroundXY

Rotates the region about the given point.

```csharp
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 outline and all holes of the region are rotated.

### SetOutlineContour

Replaces the region's outline with the given contour.

```csharp
void SetOutlineContour(IPCB_Contour argContour);
void SetOutlineContour(object argContour);
```

| Parameter | Type | Passing | Description |
| --- | --- | --- | --- |
| `argContour` | [IPCB_Contour](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_Contour.md) | value | The new outline contour. |

**Returns:** nothing (`void`)

The first overload is an extension method of `IPCB_RegionHelper` (`using PCB;`) with typed parameters; the second is declared by the interface.

All holes of the region are removed, and `Area` is recalculated.

## Inherited members

- 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)

## Returned by

[IPCB_CustomPadShape.RegionShapeOnLayer](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_CustomPadShape.md#regionshapeonlayer), [IPCB_SplitPlane.GetNegativeRegion](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_SplitPlane.md#getnegativeregion)

## Accepted by

[IPCB_ContourMaker.MakeContour_6](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker.md#makecontour_6), [IPCB_ContourMaker2.MakeContour_16](https://altiumdeveloper.github.io/ad-sdk-docs/reference/pcb/IPCB_ContourMaker2.md#makecontour_16)
