Skip to main content
View as Markdown

IPCB_ConfinementConstraint interface

A room on a PCB document, a design rule that defines a region in which the components in its scope must be placed, or from which they are kept out.

public interface IPCB_ConfinementConstraint : IPCB_Rule

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive → IPCB_Rule

Remarks​

The rule kind is TRuleKind.eRule_ConfinementConstraint. The region is a polygon on one layer (ConstraintLayer), described by PointCount and Segments; assigning BoundingRectangle makes it a rectangle.

Properties​

PropertyTypeAccessDescription
BoundingRectangleCoordRectget; setThe smallest rectangle that encloses the vertices of the room's region, in internal units (10,000 per mil).
ConstraintLayerTV6_Layerget; setThe layer of the room's region.
KindTConfinementStyleget; setWhether the components in the rule's scope must be inside the region or outside it.
LockComponentsboolget; setWhether the room locks the components in its first scope (Scope1Expression).
PointCountintget; setThe number of vertices of the room's region.
SegmentsPolySegmentget; setA segment of the room's region, with its vertex and, for an arc, its center, radius and angles.
XLocationintget; setThe x-coordinate of the left edge of the room's bounding rectangle (BoundingRectangle), in internal units (10,000 per mil).
YLocationintget; setThe y-coordinate of the bottom edge of the room's bounding rectangle (BoundingRectangle), in internal units (10,000 per mil).

BoundingRectangle​

The smallest rectangle that encloses the vertices of the room's region, in internal units (10,000 per mil).

CoordRect GetState_BoundingRectangle();
void SetState_BoundingRectangle(CoordRect argBR);

Type: CoordRect · Access: read/write

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

It is all zeros when the region has no vertices. Assigning a rectangle replaces the region with a rectangle of four vertices; the corners can be given in either order.

ConstraintLayer​

The layer of the room's region.

TV6_Layer GetState_ConstraintLayer();
void SetState_ConstraintLayer(TV6_Layer argValue);

Type: TV6_Layer · Access: read/write

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

A new rule is on TV6_Layer.eV6_TopLayer. Assigning a layer also sets the rule's Layer.

Kind​

Whether the components in the rule's scope must be inside the region or outside it.

TConfinementStyle GetState_Kind();
void SetState_Kind(TConfinementStyle argValue);

Type: TConfinementStyle · Access: read/write

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

A new rule has TConfinementStyle.eConfineIn. Only components are checked against the rule: with TConfinementStyle.eConfineIn a component violates it when the region does not contain the component, with TConfinementStyle.eConfineOut when the component overlaps the region.

LockComponents​

Whether the room locks the components in its first scope (Scope1Expression).

bool GetState_LockComponents();
void SetState_LockComponents(bool argValue);

Type: bool · Access: read/write

The default is false. While it is true and the rule is enabled (DRCEnabled), the room's components cannot be moved in the PCB editor.

PointCount​

The number of vertices of the room's region.

int GetState_PointCount();
void SetState_PointCount(int argValue);

Type: int · Access: read/write

A rectangle assigned through BoundingRectangle has 4.

Segments​

A segment of the room's region, with its vertex and, for an arc, its center, radius and angles.

PolySegment GetState_Segments(int argI);
void SetState_Segments(int argI, PolySegment argValue);

Type: PolySegment · Access: read/write · Index: argI (int): The index of the segment.

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

Indexes from 0 to PointCount are accepted; reading any other index returns a segment whose values are all zero, and assigning one does nothing. Index PointCount is the closing segment, which repeats the first one. Set PointCount before assigning segments beyond the current count.

XLocation​

The x-coordinate of the left edge of the room's bounding rectangle (BoundingRectangle), in internal units (10,000 per mil).

int GetState_XLocation();
void SetState_XLocation(int argX);

Type: int · Access: read/write

YLocation​

The y-coordinate of the bottom edge of the room's bounding rectangle (BoundingRectangle), in internal units (10,000 per mil).

int GetState_YLocation();
void SetState_YLocation(int argY);

Type: int · Access: read/write

Methods​

MethodReturnsDescription
ArrangeComponentsboolArranges the components in the room's first scope (Scope1Expression) inside the room's bounding rectangle.
GetConfinedComponentsboolAdds the components of the board that are in the rule's first scope (Scope1Expression) to a list.
RotateAroundXYvoidRotates the room's region around a point.

ArrangeComponents​

Arranges the components in the room's first scope (Scope1Expression) inside the room's bounding rectangle.

bool ArrangeComponents();

Returns: bool

Only movable components (Moveable) on the top and bottom layers are arranged. Returns false when the rule is not on a board or the board has no graphical view; otherwise returns true.

GetConfinedComponents​

Adds the components of the board that are in the rule's first scope (Scope1Expression) to a list.

bool GetConfinedComponents(IInterfaceList argComponents);
bool GetConfinedComponents(object argComponents);
ParameterTypePassingDescription
argComponentsIInterfaceListvalueThe list that receives the components (IPCB_Component objects).

Returns: bool

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

Returns false, leaving the list unchanged, when the list is null or the rule is not on a board; otherwise returns true. No components are added while the rule is not enabled for checking (DRCEnabled is false).

RotateAroundXY​

Rotates the room's region around a point.

void RotateAroundXY(int argX, int argY, double argngle);
ParameterTypePassingDescription
argXintvalueThe x-coordinate of the center of rotation, in internal units (10,000 per mil).
argYintvalueThe y-coordinate of the center of rotation, in internal units (10,000 per mil).
argngledoublevalueThe rotation angle, in degrees, counterclockwise.

Returns: nothing (void)

A rotation by a whole multiple of 360 degrees does nothing.

Inherited members​