Skip to main content
View as Markdown

IPCB_DrillLayerPair interface

A drill layer pair of a PCB document, the two layers between which holes are drilled, together with the kind of drilling (TDrillLayerPairType).

public interface IPCB_DrillLayerPair

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Remarks​

The pairs of a board are read with IPCB_Board.LayerPair, at indexes 0 to IPCB_Board.DrillLayerPairsCount - 1, or looked up by their layers and type with IPCB_Board.LayerPairByPairEx.

Example​

Show the current layer and the drill layer pairs of the current board.

using System.Collections.Generic;
using PCB;

IPCB_Board pcbBoard = PCB.GlobalVars.PCBServer?.GetCurrentPCBBoard();
if (pcbBoard == null)
return;
// Show the current layer
DXP.Utils.ShowInfo("Current Layer: " + EDP.Utils.LayerToString(new V7_Layer(pcbBoard.GetState_CurrentLayer())), "Layers");

var signalLayersAndInternalPlanes = new TV6_LayerSet();
signalLayersAndInternalPlanes.UnionWith(PCBConstant.V6SignalLayersSet);
signalLayersAndInternalPlanes.UnionWith(PCBConstant.V6InternalPlanesSet);

var layerPairs = new List<string>();
for (int i = 0; i < pcbBoard.GetState_DrillLayerPairsCount(); i++)
{
IPCB_DrillLayerPair pcbLayerPair = pcbBoard.GetState_LayerPair(i);
IPCB_LayerObject lowLayerObj = pcbBoard.GetState_LayerStack().LayerObject(pcbLayerPair.GetState_LowLayer());
IPCB_LayerObject highLayerObj = pcbBoard.GetState_LayerStack().LayerObject(pcbLayerPair.GetState_HighLayer());
int lowPos = pcbBoard.LayerPositionInSet(signalLayersAndInternalPlanes, lowLayerObj);
int highPos = pcbBoard.LayerPositionInSet(signalLayersAndInternalPlanes, highLayerObj);
if (lowPos <= highPos)
layerPairs.Add(lowLayerObj.GetState_LayerName() + " - " + highLayerObj.GetState_LayerName());
else
layerPairs.Add(highLayerObj.GetState_LayerName() + " - " + lowLayerObj.GetState_LayerName());
}
//Display layer pairs.
string ls = "";
for (int i = 0; i < layerPairs.Count; i++)
ls = ls + layerPairs[i] + "\r\n";
DXP.Utils.ShowInfo("Layer Pairs:\r\n" + ls, "Layers");

Properties​

PropertyTypeAccessDescription
BoardIPCB_BoardgetThe board that owns the pair.
DescriptionstringgetA text description of the pair, the names of its two layers separated by " - ".
DrillLayerPairTypeTDrillLayerPairTypegetThe kind of drilling the pair describes, such as regular drilling, micro-via drilling, backdrilling or counter holes.
HighLayerTV6_Layerget; setOne end layer of the pair; together with LowLayer it defines the layers the drilling spans.
IsBackdrillboolget; setWhether the pair is a backdrill pair.
LowLayerTV6_Layerget; setOne end layer of the pair; together with HighLayer it defines the layers the drilling spans.
PlotDrillDrawingboolget; setThe pair's drill drawing plot setting.
PlotDrillGuideboolget; setThe pair's drill guide plot setting.
StartLayerIPCB_LayerObjectgetThe upper of the pair's two layers in the layer stack.
StopLayerIPCB_LayerObjectgetThe lower of the pair's two layers in the layer stack.

Board​

The board that owns the pair.

IPCB_Board GetState_Board();

Type: IPCB_Board · Access: read-only

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

Description​

A text description of the pair, the names of its two layers separated by " - ".

string GetState_Description();

Type: string · Access: read-only

For a pair whose DrillLayerPairType is not TDrillLayerPairType.Regular, the text starts with a marker of the type. For a counter-hole pair the description is "Counterholes Top" or "Counterholes Bottom" instead.

DrillLayerPairType​

The kind of drilling the pair describes, such as regular drilling, micro-via drilling, backdrilling or counter holes.

TDrillLayerPairType GetState_DrillLayerPairType();

Type: TDrillLayerPairType · Access: read-only

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

Setting IsBackdrill changes this value.

HighLayer​

One end layer of the pair; together with LowLayer it defines the layers the drilling spans.

TV6_Layer GetState_HighLayer();
void SetState_HighLayer(TV6_Layer argL);

Type: TV6_Layer · Access: read/write

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

Assigning a value does not reorder the two layers; OrderLayers makes LowLayer the upper of them. StartLayer and StopLayer return the upper and the lower layer, whichever way round LowLayer and HighLayer are.

IsBackdrill​

Whether the pair is a backdrill pair.

bool GetState_IsBackdrill();
void SetState_IsBackdrill(bool argValue);

Type: bool · Access: read/write

The value is derived from DrillLayerPairType: it is true for TDrillLayerPairType.Backdrill and TDrillLayerPairType.CounterHole. Setting it to true sets DrillLayerPairType to TDrillLayerPairType.Backdrill; setting it to false changes TDrillLayerPairType.Backdrill to TDrillLayerPairType.Regular and leaves any other type unchanged, so on a TDrillLayerPairType.CounterHole pair IsBackdrill stays true.

LowLayer​

One end layer of the pair; together with HighLayer it defines the layers the drilling spans.

TV6_Layer GetState_LowLayer();
void SetState_LowLayer(TV6_Layer argL);

Type: TV6_Layer · Access: read/write

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

Assigning a value does not reorder the two layers; OrderLayers makes LowLayer the upper of them. StartLayer and StopLayer return the upper and the lower layer, whichever way round LowLayer and HighLayer are.

PlotDrillDrawing​

The pair's drill drawing plot setting.

bool GetState_PlotDrillDrawing();
void SetState_PlotDrillDrawing(bool argValue);

Type: bool · Access: read/write

PlotDrillGuide​

The pair's drill guide plot setting.

bool GetState_PlotDrillGuide();
void SetState_PlotDrillGuide(bool argValue);

Type: bool · Access: read/write

StartLayer​

The upper of the pair's two layers in the layer stack.

IPCB_LayerObject GetState_StartLayer();

Type: IPCB_LayerObject · Access: read-only

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

StopLayer​

The lower of the pair's two layers in the layer stack.

IPCB_LayerObject GetState_StopLayer();

Type: IPCB_LayerObject · Access: read-only

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

Methods​

MethodReturnsDescription
AddToSubstackvoidAdds the pair to the layer stack with the given ID.
DeleteFromAllSubstacksvoidRemoves the pair from every layer stack it belongs to.
DeleteFromSubstackvoidRemoves the pair from the layer stack with the given ID.
IsDefinedInboolReturns whether the pair belongs to the layer stack with the given ID.
IsSimilarToboolReturns whether this pair has the same type and the same two layers as another pair.
OrderLayersvoidSwaps LowLayer and HighLayer when LowLayer is below HighLayer in the layer stack, so that LowLayer is the upper layer.

AddToSubstack​

Adds the pair to the layer stack with the given ID.

void AddToSubstack(string argStackID);
ParameterTypePassingDescription
argStackIDstringvalueThe ID of the layer stack, as returned by IPCB_LayerStackBase.ID.

Returns: nothing (void)

Afterwards IsDefinedIn returns true for that ID. Adding the pair to a stack it already belongs to has no further effect.

DeleteFromAllSubstacks​

Removes the pair from every layer stack it belongs to.

void DeleteFromAllSubstacks();

Returns: nothing (void)

Afterwards IsDefinedIn returns false for every stack ID.

DeleteFromSubstack​

Removes the pair from the layer stack with the given ID.

void DeleteFromSubstack(string argStackID);
ParameterTypePassingDescription
argStackIDstringvalueThe ID of the layer stack, as returned by IPCB_LayerStackBase.ID.

Returns: nothing (void)

Does nothing when the pair does not belong to that stack.

IsDefinedIn​

Returns whether the pair belongs to the layer stack with the given ID.

bool IsDefinedIn(string argStackID);
ParameterTypePassingDescription
argStackIDstringvalueThe ID of the layer stack, as returned by IPCB_LayerStackBase.ID.

Returns: bool

IsSimilarTo​

Returns whether this pair has the same type and the same two layers as another pair.

bool IsSimilarTo(IPCB_DrillLayerPair argDLP);
bool IsSimilarTo(object argDLP);
ParameterTypePassingDescription
argDLPIPCB_DrillLayerPairvalueThe pair to compare with.

Returns: bool

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

The layers are compared in either order, so a pair from layer A to layer B is similar to a pair from layer B to layer A of the same type. A counter-hole pair is similar only to another counter-hole pair that is drilled in the same direction.

OrderLayers​

Swaps LowLayer and HighLayer when LowLayer is below HighLayer in the layer stack, so that LowLayer is the upper layer.

void OrderLayers();

Returns: nothing (void)

Returned by​

IPCB_Board.LayerPair, IPCB_Board.LayerPairByPair, IPCB_Board.LayerPairByPairEx, IPCB_DrillTable.LayerPair