Skip to main content
View as Markdown

IPCB_AbstractIterator interface

The base interface of the PCB object iterators, with the filters that select the objects to fetch and the methods that step through them.

public interface IPCB_AbstractIterator

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Derived: IPCB_BoardIterator, IPCB_GroupIterator, IPCB_LibraryIterator, IPCB_SpatialIterator

Remarks​

IPCB_BoardIterator, IPCB_SpatialIterator, IPCB_GroupIterator and IPCB_LibraryIterator derive from it. Set the filters, then call FirstPCBObject and NextPCBObject until they return null.

An object is fetched only when it passes every filter: the object kinds, the layers and, for a spatial iterator, the area. Each AddFilter_ObjectSet or AddFilter_LayerSet call replaces the previous filter of the same kind; it does not narrow it.

Methods​

MethodReturnsDescription
AddFilter_AllLayersvoidRemoves the layer filter, so that objects on all layers are fetched.
AddFilter_AreavoidRestricts a spatial iterator to the objects in a rectangular area.
AddFilter_IPCB_LayerSetvoidRestricts the iterator to the objects on the layers of an IPCB_LayerSet, as AddFilter_LayerSet_1 does.
AddFilter_LayerSetvoidRestricts the iterator to the objects on the layers of a layer set.
AddFilter_LayerSet_1voidRestricts the iterator to the objects on the layers of an IPCB_LayerSet.
AddFilter_LayerSet_2void
AddFilter_ObjectSetvoidRestricts the iterator to objects of the given kinds.
FirstPCBObjectIPCB_PrimitiveStarts the walk and returns the first object that passes the filters, or null when there is none.
NextPCBObjectIPCB_PrimitiveReturns the next object that passes the filters, or null when there are no more objects.
SetState_FilterAllvoidRemoves the object kind filter, so that objects of every kind are fetched again.

AddFilter_AllLayers​

Removes the layer filter, so that objects on all layers are fetched.

void AddFilter_AllLayers();

Returns: nothing (void)

A new group iterator has no layer filter. A new board or spatial iterator fetches objects on all layers except a few system layers, such as TV6_Layer.eV6_PadHoleLayer and TV6_Layer.eV6_ViaHoleLayer.

AddFilter_Area​

Restricts a spatial iterator to the objects in a rectangular area.

void AddFilter_Area(int argx1, int argy1, int argx2, int argy2);
ParameterTypePassingDescription
argx1intvalueX coordinate of one corner of the area, in internal units (10,000 per mil).
argy1intvalueY coordinate of the same corner, in internal units (10,000 per mil).
argx2intvalueX coordinate of the opposite corner, in internal units (10,000 per mil).
argy2intvalueY coordinate of the opposite corner, in internal units (10,000 per mil).

Returns: nothing (void)

The corners can be given in any order. A board iterator ignores the area: use an IPCB_SpatialIterator to fetch the objects in an area. Without this filter, a spatial iterator searches the whole board.

AddFilter_IPCB_LayerSet​

Restricts the iterator to the objects on the layers of an IPCB_LayerSet, as AddFilter_LayerSet_1 does.

void AddFilter_IPCB_LayerSet(IPCB_LayerSet argLayerSet);
void AddFilter_IPCB_LayerSet(object argLayerSet);
ParameterTypePassingDescription
argLayerSetIPCB_LayerSetvalueThe layers to fetch objects on.

Returns: nothing (void)

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

AddFilter_LayerSet​

Restricts the iterator to the objects on the layers of a layer set.

void AddFilter_LayerSet(TV6_LayerSet argLayerSet);
void AddFilter_LayerSet(ITransportSet argLayerSet);
ParameterTypePassingDescription
argLayerSetTV6_LayerSetvalueThe layers to fetch objects on.

Returns: nothing (void)

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

On a board or group iterator, connections are fetched only when the set includes TV6_Layer.eV6_ConnectLayer. Objects that do not belong to a layer (vias, nets, classes, rules, violations, differential pairs, from-tos, embedded objects and the board object) are fetched only when the set includes TV6_Layer.eV6_MultiLayer. Other objects are fetched when the set includes their own layer, so a pad on the multi-layer also needs TV6_Layer.eV6_MultiLayer.

Examples: Extension_PCBUndoRedo

AddFilter_LayerSet_1​

Restricts the iterator to the objects on the layers of an IPCB_LayerSet.

void AddFilter_LayerSet_1(IPCB_LayerSet argLayerSet);
void AddFilter_LayerSet_1(object argLayerSet);
ParameterTypePassingDescription
argLayerSetIPCB_LayerSetvalueThe layers to fetch objects on.

Returns: nothing (void)

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

The layers are matched as described for AddFilter_LayerSet.

AddFilter_LayerSet_2​

No description yet.

void AddFilter_LayerSet_2(TLayerPartitionSet argLayerSet);
void AddFilter_LayerSet_2(ITransportSet argLayerSet);
ParameterTypePassing
argLayerSetTLayerPartitionSetvalue

Returns: nothing (void)

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

Examples: Extension_BOMManager, Extension_Pad_SolderMask

AddFilter_ObjectSet​

Restricts the iterator to objects of the given kinds.

void AddFilter_ObjectSet(TObjectSet argObjectSet);
void AddFilter_ObjectSet(ITransportSet argObjectSet);
ParameterTypePassingDescription
argObjectSetTObjectSetvalueThe kinds of objects to fetch.

Returns: nothing (void)

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

A new iterator has no object filter. By default, a spatial iterator skips group objects such as components, even when the set includes them (see IPCB_SpatialIterator).

Examples: Extension_BOMManager, Extension_PCBUndoRedo, Extension_Pad_SolderMask

FirstPCBObject​

Starts the walk and returns the first object that passes the filters, or null when there is none.

IPCB_Primitive FirstPCBObject();

Returns: IPCB_Primitive

Extension method of IPCB_AbstractIteratorHelper (using PCB;).

Examples: Extension_BOMManager, Extension_PCBUndoRedo, Extension_Pad_SolderMask, Extension_PcbLibComponentToSTEP, Extension_PcbLibToImage

NextPCBObject​

Returns the next object that passes the filters, or null when there are no more objects.

IPCB_Primitive NextPCBObject();

Returns: IPCB_Primitive

Extension method of IPCB_AbstractIteratorHelper (using PCB;).

Start the walk with FirstPCBObject; NextPCBObject continues after the object returned last.

Examples: Extension_BOMManager, Extension_PCBUndoRedo, Extension_Pad_SolderMask, Extension_PcbLibComponentToSTEP, Extension_PcbLibToImage

SetState_FilterAll​

Removes the object kind filter, so that objects of every kind are fetched again.

void SetState_FilterAll();

Returns: nothing (void)

The other filters depend on the iterator. A board iterator gets the layer filter of a new board iterator back and keeps the setting of IPCB_BoardIterator.AddFilter_Method. A group iterator loses its layer filter. A spatial iterator loses its area filter and keeps its layer filter.

Accepted by​

IPCB_EmbeddedBoard.ApplyFilterToIterator