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
| Property | Type | Access | Description |
|---|---|---|---|
| Area | long | get | The area enclosed by the region's outline. |
| CavityHeight | int | get; set | The region's cavity height, in internal units (10,000 per mil). |
| GeometricPolygon | IPCB_GeometricPolygon | get; set | The region's shape as a geometric polygon, with the outline and all holes. |
| Kind | TRegionKind | get; set | The kind of the region, which determines what it is on the board. |
| Name | string | get; set | The 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
| Method | Returns | Description |
|---|---|---|
| GetHole | IPCB_Contour | Returns a hole contour of the region. |
| GetHoleCount | int | Returns the number of hole contours in the region. |
| GetMainContour | IPCB_Contour | Returns the outline contour of the region. |
| IsSimpleRegion | bool | Returns whether the region is an ordinary region rather than a board region. |
| RotateAroundXY | void | Rotates the region about the given point. |
| SetOutlineContour | void | Replaces the region's outline with the given contour. |
GetHole
Returns a hole contour of the region.
IPCB_Contour GetHole(int argI);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argI | int | value | The 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);
| 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.
void SetOutlineContour(IPCB_Contour argContour);
void SetOutlineContour(object argContour);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argContour | IPCB_Contour | 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: 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
Returned by
IPCB_CustomPadShape.RegionShapeOnLayer, IPCB_SplitPlane.GetNegativeRegion
Accepted by
IPCB_ContourMaker.MakeContour_6, IPCB_ContourMaker2.MakeContour_16