IPCB_RegionShape interface
The outline of a shaped object as an editable list of segments.
public interface IPCB_RegionShape
Namespace: PCB · Assembly: Altium.SDK.Interfaces
Remarks
Regions (including component bodies), polygons, split planes and confinement constraint rules provide this interface. Each segment is a PolySegment.
For a region, the segments and the region's shape are kept separately: after changing the segments, call UpdateContourFromShape so that the region's shape follows them.
Properties
| Property | Type | Access | Description |
|---|---|---|---|
| ShapeSegment | PolySegment | get; set | A segment of the outline. |
| ShapeSegmentCount | int | get; set | The number of segments of the outline. |
ShapeSegment
A segment of the outline.
PolySegment GetState_ShapeSegment(int argI);
void SetState_ShapeSegment(int argI, PolySegment argValue);
Type: PolySegment · Access: read/write · Index: argI (int): The zero-based index of the segment. For a region it runs from 0 to ShapeSegmentCount, where the last index is the closing segment, which repeats the first one as a line segment; for a polygon or a split plane it runs from 0 to ShapeSegmentCount - 1.
The accessors are extension methods of IPCB_RegionShapeHelper (using PCB;).
For a region, a polygon or a split plane, reading a segment outside the valid range returns a segment with all values zero, assigning one outside the range does nothing, and assigning the first segment also updates the closing segment after the last one.
ShapeSegmentCount
The number of segments of the outline.
int GetState_ShapeSegmentCount();
void SetState_ShapeSegmentCount(int argValue);
Type: int · Access: read/write
Assigning a value keeps the existing segments up to the new number, and sets the closing segment after the last one to repeat the first segment as a line segment.
Methods
| Method | Returns | Description |
|---|---|---|
| UpdateContourFromShape | void | Rebuilds a region's shape from its segments. |
| UpdateShapeFromContour | void | Rebuilds a region's segments from its current shape. |
UpdateContourFromShape
Rebuilds a region's shape from its segments.
void UpdateContourFromShape(bool argConserveExistingHoles);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argConserveExistingHoles | bool | value | True to keep the holes of the region, false to remove them and keep only the outline. |
Returns: nothing (void)
The outline of the region is recreated from the segments, with arcs approximated by straight segments, and its area is recalculated. For a polygon or a split plane the call does nothing; for a confinement constraint it raises an error.
UpdateShapeFromContour
Rebuilds a region's segments from its current shape.
void UpdateShapeFromContour();
Returns: nothing (void)
For a polygon or a split plane the call does nothing; for a confinement constraint it raises an error.