Skip to main content
View as Markdown

IPCB_Group interface

The base interface of PCB objects that contain other primitives: IPCB_Component, IPCB_LibComponent, IPCB_Net, IPCB_Polygon, IPCB_SplitPlane, IPCB_Coordinate, IPCB_Dimension and their descendant interfaces.

public interface IPCB_Group : IPCB_Primitive

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_Primitive

Derived: IPCB_Component, IPCB_Coordinate, IPCB_Dimension, IPCB_LibComponent, IPCB_Net, IPCB_Polygon, IPCB_SplitPlane

Remarks​

A group is composed of child primitives such as arcs, tracks and fills: for example, a polygon consists of tracks and arcs, and a footprint in a PCB library of arcs, pads and tracks.

GroupIterator_Create and GroupIterator_Destroy iterate over the child primitives; AddPCBObject and RemovePCBObject add and remove them. XLocation and YLocation are the reference point of the group.

Properties​

PropertyTypeAccessDescription
LayerUsedboolget; setWhether a child primitive of the group is on the given layer.
PrimitiveLockboolget; setWhether the child primitives of the group can be edited individually or only as part of the group.
XLocationintget; setThe X coordinate of the reference point of the group, in internal units (10,000 per mil).
YLocationintget; setThe Y coordinate of the reference point of the group, in internal units (10,000 per mil).

LayerUsed​

Whether a child primitive of the group is on the given layer.

bool GetState_LayerUsed(TV6_Layer argL);
void SetState_LayerUsed(TV6_Layer argL, bool argValue);

Type: bool · Access: read/write · Index: argL (TV6_Layer)

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

The value is valid after SetState_LayersUsedArray has run. Until the layer usage of the group has been built (by SetState_LayersUsedArray or by assigning a value), reading returns false.

PrimitiveLock​

Whether the child primitives of the group can be edited individually or only as part of the group.

bool GetState_PrimitiveLock();
void SetState_PrimitiveLock(bool argValue);

Type: bool · Access: read/write

XLocation​

The X coordinate of the reference point of the group, in internal units (10,000 per mil).

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

Type: int · Access: read/write

Assigning a different value moves the group with MoveToXY, keeping its Y coordinate.

Examples: Extension_PCBUndoRedo, Extension_PcbLibComponentToSTEP, Extension_PlaceAndMovePcbComponent

YLocation​

The Y coordinate of the reference point of the group, in internal units (10,000 per mil).

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

Type: int · Access: read/write

Assigning a different value moves the group with MoveToXY, keeping its X coordinate.

Examples: Extension_PcbLibComponentToSTEP, Extension_PlaceAndMovePcbComponent

Methods​

MethodReturnsDescription
AddPCBObjectvoidAdds a primitive to the group as a child primitive.
FastSetState_XSizeYSizebool
FreePrimitivesvoidDestroys all child primitives of the group and leaves the group empty.
GetPrimitiveAtIPCB_PrimitiveReturns the child primitive at the given position among the group's children of the given object kind.
GetPrimitiveCountintReturns the number of child primitives of the group whose object kind is in the given set.
GroupIterator_CreateIPCB_GroupIteratorCreates an iterator over the child primitives of the group.
GroupIterator_DestroyvoidReleases an iterator created by GroupIterator_Create.
RemovePCBObjectvoidRemoves a child primitive from the group.
ReplicateWithChildrenIPCB_PrimitiveReturns a copy of the group that contains copies of all its child primitives.
SetState_LayersUsedArrayvoidRebuilds the layer usage of the group that LayerUsed reports, marking the layer of every child primitive as used.
SetState_XSizeYSizeboolRecalculates the size of every child primitive and then the bounds of the group.

AddPCBObject​

Adds a primitive to the group as a child primitive.

void AddPCBObject(IPCB_Primitive argPCBObject);
void AddPCBObject(object argPCBObject);
ParameterTypePassingDescription
argPCBObjectIPCB_PrimitivevalueThe primitive to add: an arc, pad, via, track, connection, text, fill, rule, embedded board, region or component body. For null or any other kind of object the method does nothing.

Returns: nothing (void)

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

When the group is a component, a net or a polygon, the primitive is first removed from the component, net or polygon respectively that it belongs to. To place a new primitive in a footprint, add it to the library board with IPCB_Board.AddPCBObject and then to the footprint with AddPCBObject.

Examples: Extension_CreatePCBLib

FastSetState_XSizeYSize​

No description yet.

bool FastSetState_XSizeYSize();

Returns: bool

FreePrimitives​

Destroys all child primitives of the group and leaves the group empty.

void FreePrimitives();

Returns: nothing (void)

GetPrimitiveAt​

Returns the child primitive at the given position among the group's children of the given object kind.

IPCB_Primitive GetPrimitiveAt(int argI, TObjectId argObjectId);
ParameterTypePassingDescription
argIintvalueThe position of the child primitive, starting at 1; GetPrimitiveCount returns the number of children.
argObjectIdTObjectIdvalueThe object kind of the child primitives.

Returns: IPCB_Primitive

Extension method of IPCB_GroupHelper (using PCB;).

Returns null when the group has no child of that kind at the given position.

See also: IPCB_Group.GroupIterator_Create, IPCB_GroupIterator, IPCB_Group.GroupIterator_Destroy

GetPrimitiveCount​

Returns the number of child primitives of the group whose object kind is in the given set.

int GetPrimitiveCount(TObjectSet argObjectSet);
int GetPrimitiveCount(ITransportSet argObjectSet);
ParameterTypePassingDescription
argObjectSetTObjectSetvalueThe object kinds (TObjectId values) to count.

Returns: int

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

GroupIterator_Create​

Creates an iterator over the child primitives of the group.

IPCB_GroupIterator GroupIterator_Create();

Returns: IPCB_GroupIterator

Extension method of IPCB_GroupHelper (using PCB;).

Release the iterator with GroupIterator_Destroy.

GroupIterator_Destroy​

Releases an iterator created by GroupIterator_Create.

void GroupIterator_Destroy(ref IPCB_GroupIterator argIterator);
void GroupIterator_Destroy(ref object argIterator);
ParameterTypePassingDescription
argIteratorIPCB_GroupIteratorrefThe iterator to release; the variable is set to null.

Returns: nothing (void)

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

RemovePCBObject​

Removes a child primitive from the group.

void RemovePCBObject(IPCB_Primitive argPCBObject);
void RemovePCBObject(object argPCBObject);
ParameterTypePassingDescription
argPCBObjectIPCB_PrimitivevalueThe primitive to remove: an arc, pad, via, track, connection, text, fill, rule, embedded board, region or component body. For null or any other kind of object the method does nothing.

Returns: nothing (void)

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

ReplicateWithChildren​

Returns a copy of the group that contains copies of all its child primitives.

IPCB_Primitive ReplicateWithChildren();

Returns: IPCB_Primitive

Extension method of IPCB_GroupHelper (using PCB;).

Add the copy to a board with IPCB_Board.AddPCBObject.

SetState_LayersUsedArray​

Rebuilds the layer usage of the group that LayerUsed reports, marking the layer of every child primitive as used.

void SetState_LayersUsedArray();

Returns: nothing (void)

When the group does not belong to a board, all layers are left marked as unused.

SetState_XSizeYSize​

Recalculates the size of every child primitive and then the bounds of the group.

bool SetState_XSizeYSize();

Returns: bool

The selection rectangle of the group becomes the rectangle that encloses the selection rectangles of its child primitives.

Inherited members​

Returned by​

IPCB_BoardOutlineClearanceConstraint.GetObstacleTracks, IPCB_Net.GetLogicalNet, IPCB_Net.GetSubnets

Accepted by​

IPCB_PrimitiveComparator.CompareGroup