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
| Property | Type | Access | Description |
|---|---|---|---|
| Board | IPCB_Board | get | The board that owns the pair. |
| Description | string | get | A text description of the pair, the names of its two layers separated by " - ". |
| DrillLayerPairType | TDrillLayerPairType | get | The kind of drilling the pair describes, such as regular drilling, micro-via drilling, backdrilling or counter holes. |
| HighLayer | TV6_Layer | get; set | One end layer of the pair; together with LowLayer it defines the layers the drilling spans. |
| IsBackdrill | bool | get; set | Whether the pair is a backdrill pair. |
| LowLayer | TV6_Layer | get; set | One end layer of the pair; together with HighLayer it defines the layers the drilling spans. |
| PlotDrillDrawing | bool | get; set | The pair's drill drawing plot setting. |
| PlotDrillGuide | bool | get; set | The pair's drill guide plot setting. |
| StartLayer | IPCB_LayerObject | get | The upper of the pair's two layers in the layer stack. |
| StopLayer | IPCB_LayerObject | get | The 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
| Method | Returns | Description |
|---|---|---|
| AddToSubstack | void | Adds the pair to the layer stack with the given ID. |
| DeleteFromAllSubstacks | void | Removes the pair from every layer stack it belongs to. |
| DeleteFromSubstack | void | Removes the pair from the layer stack with the given ID. |
| IsDefinedIn | bool | Returns whether the pair belongs to the layer stack with the given ID. |
| IsSimilarTo | bool | Returns whether this pair has the same type and the same two layers as another pair. |
| OrderLayers | void | Swaps 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argStackID | string | value | The 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argStackID | string | value | The 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argStackID | string | value | The 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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argDLP | IPCB_DrillLayerPair | value | The 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