Skip to main content
View as Markdown

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.

public interface IPCB_Region : IPCB_Primitive

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive

Derived: IPCB_BoardRegion, IPCB_ComponentBody, IPCB_Region2, IPCB_SplitPlaneRegion

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 returns the outline, GetHoleCount and GetHole the holes, and GeometricPolygon the whole shape.

Properties​

PropertyTypeAccessDescription
ArealonggetThe area enclosed by the region's outline.
CavityHeightintget; setThe region's cavity height, in internal units (10,000 per mil).
GeometricPolygonIPCB_GeometricPolygonget; setThe region's shape as a geometric polygon, with the outline and all holes.
KindTRegionKindget; setThe kind of the region, which determines what it is on the board.
Namestringget; setThe region's name.

Area​

The area enclosed by the region's outline.

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

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.

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

Type: IPCB_GeometricPolygon · 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.

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

Type: TRegionKind · Access: read/write

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

The default is TRegionKind.eRegionKind_Copper.

See also: TRegionKind

Name​

The region's name.

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

Type: string · Access: read/write

Methods​

MethodReturnsDescription
GetHoleIPCB_ContourReturns a hole contour of the region.
GetHoleCountintReturns the number of hole contours in the region.
GetMainContourIPCB_ContourReturns the outline contour of the region.
IsSimpleRegionboolReturns whether the region is an ordinary region rather than a board region.
RotateAroundXYvoidRotates the region about the given point.
SetOutlineContourvoidReplaces the region's outline with the given contour.

GetHole​

Returns a hole contour of the region.

IPCB_Contour GetHole(int argI);
ParameterTypePassingDescription
argIintvalueThe zero-based index of the hole, from 0 to GetHoleCount minus 1.

Returns: IPCB_Contour

Extension method of IPCB_RegionHelper (using PCB;).

GetHoleCount​

Returns the number of hole contours in the region.

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.

IPCB_Contour GetMainContour();

Returns: IPCB_Contour

Extension method of IPCB_RegionHelper (using PCB;).

Examples: Extension_CreatePCBLib

IsSimpleRegion​

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

bool IsSimpleRegion();

Returns: bool

Returns false for a board region (IPCB_BoardRegion) and true for every other region.

RotateAroundXY​

Rotates the region about the given point.

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

SetOutlineContour​

Replaces the region's outline with the given contour.

void SetOutlineContour(IPCB_Contour argContour);
void SetOutlineContour(object argContour);
ParameterTypePassingDescription
argContourIPCB_ContourvalueThe 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​

Returned by​

IPCB_CustomPadShape.RegionShapeOnLayer, IPCB_SplitPlane.GetNegativeRegion

Accepted by​

IPCB_ContourMaker.MakeContour_6, IPCB_ContourMaker2.MakeContour_16