Skip to main content
View as Markdown

IPCB_MasterLayerStack interface

The master layer stack of a board, which holds the board's layers and its substacks.

public interface IPCB_MasterLayerStack : IPCB_LayerStackBase

Namespace: PCB · Assembly: Altium.SDK.Interfaces

Inherits: IPCB_LayerStackBase

Derived: IPCB_MasterLayerStack2

Remarks​

Obtain it from IPCB_Board.MasterStack. IPCB_Board.LayerStack_V7 is backed by the same master stack.

Each substack is an IPCB_LayerStack in which a layer of the master stack is enabled or disabled. Pads, vias and board regions are assigned to a substack.

Properties​

PropertyTypeAccessDescription
LayerStackStyleTLayerStackStyleget; setThe layer stacking style of the board.
SubstacksIPCB_LayerStackgetThe substack at an index.

LayerStackStyle​

The layer stacking style of the board.

TLayerStackStyle GetState_LayerStackStyle();
void SetState_LayerStackStyle(TLayerStackStyle argStackStyle);

Type: TLayerStackStyle · Access: read/write

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

A new master stack has the style TLayerStackStyle.eLayerStack_Pairs.

Substacks​

The substack at an index.

IPCB_LayerStack GetState_Substacks(int argIndex);

Type: IPCB_LayerStack · Access: read-only · Index: argIndex (int)

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

Valid indexes run from 0 to SubstackCount minus 1.

Methods​

MethodReturnsDescription
BoardIPCB_BoardReturns the board that owns the master stack, or null when there is none.
CreateLayerIPCB_LayerObjectReturns a layer object for a layer ID, creating it when needed.
CreateSubstackIPCB_LayerStackCreates a substack and adds it at the end of the master stack's substacks.
DisableLayervoidDisables a layer of the master stack in a substack.
EnableLayervoidEnables a layer of the master stack in a substack.
Export_ToParametersvoidWrites the definition of the master stack to a parameter string.
GetSubstackIPCB_LayerStackReturns the substack with the given ID, or null when there is none.
GetSubstack_1IPCB_LayerStackReturns the first substack whose layers of a layer class are exactly the layers of a layer set, or null when no substack matches.
Import_FromParametersvoidReads the definition of the master stack from a parameter string.
InsertAboveIPCB_LayerObjectInserts a layer into the master stack above a reference layer.
InsertBelowIPCB_LayerObjectInserts a layer into the master stack below a reference layer.
InsertOnBottomIPCB_LayerObjectInserts a layer at the bottom of the master stack.
InsertOnTopIPCB_LayerObjectInserts a layer at the top of the master stack.
RemoveLayerboolRemoves a layer from the master stack.
RemoveSubstackboolRemoves a substack from the master stack.
SubstackCountintReturns the number of substacks in the master stack.

Board​

Returns the board that owns the master stack, or null when there is none.

IPCB_Board Board();

Returns: IPCB_Board

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

CreateLayer​

Returns a layer object for a layer ID, creating it when needed.

IPCB_LayerObject CreateLayer(V7_LayerBase argLayer);
ParameterTypePassing
argLayerV7_LayerBasevalue

Returns: IPCB_LayerObject

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

Returns a layer object created earlier for that ID that is not in the stack (for example a removed one); otherwise creates a new one with default properties. The layer is not placed in the stack: insert it with InsertOnTop, InsertOnBottom, InsertAbove or InsertBelow.

CreateSubstack​

Creates a substack and adds it at the end of the master stack's substacks.

IPCB_LayerStack CreateSubstack();

Returns: IPCB_LayerStack

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

The new substack gets a new unique ID and the name Stack<n>, with the lowest n (starting at 0) that no other substack uses.

DisableLayer​

Disables a layer of the master stack in a substack.

void DisableLayer(IPCB_LayerStack argSubstack, IPCB_LayerObject argLayer);
void DisableLayer(object argSubstack, object argLayer);
ParameterTypePassing
argSubstackIPCB_LayerStackvalue
argLayerIPCB_LayerObjectvalue

Returns: nothing (void)

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

Does nothing when the layer is not in the master stack.

EnableLayer​

Enables a layer of the master stack in a substack.

void EnableLayer(IPCB_LayerStack argSubstack, IPCB_LayerObject argLayer);
void EnableLayer(object argSubstack, object argLayer);
ParameterTypePassing
argSubstackIPCB_LayerStackvalue
argLayerIPCB_LayerObjectvalue

Returns: nothing (void)

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

Does nothing when the layer is not in the master stack.

Export_ToParameters​

Writes the definition of the master stack to a parameter string.

void Export_ToParameters(ref string argParams);
ParameterTypePassing
argParamsstringref

Returns: nothing (void)

The string holds the stack in every format the current version writes, so it can be read back with Import_FromParameters.

GetSubstack​

Returns the substack with the given ID, or null when there is none.

IPCB_LayerStack GetSubstack(string argSubstackID);
ParameterTypePassing
argSubstackIDstringvalue

Returns: IPCB_LayerStack

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

IDs are compared without regard to case.

GetSubstack_1​

Returns the first substack whose layers of a layer class are exactly the layers of a layer set, or null when no substack matches.

IPCB_LayerStack GetSubstack_1(IPCB_LayerSet argSet, TLayerClassID argT);
ParameterTypePassingDescription
argSetIPCB_LayerSetvalue
argTTLayerClassIDvalueThe layer class to compare, for example TLayerClassID.eLayerClass_Signal.

Returns: IPCB_LayerStack

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

Layers of other classes are ignored.

Import_FromParameters​

Reads the definition of the master stack from a parameter string.

void Import_FromParameters(string argParams);
ParameterTypePassing
argParamsstringvalue

Returns: nothing (void)

Throws an exception when the version of the parameters is not supported.

InsertAbove​

Inserts a layer into the master stack above a reference layer.

IPCB_LayerObject InsertAbove(IPCB_LayerObject argRefLayer, IPCB_LayerObject argLayer);
ParameterTypePassingDescription
argRefLayerIPCB_LayerObjectvalueThe layer to insert above. When it is not in the stack, the layer is inserted on top.
argLayerIPCB_LayerObjectvalue

Returns: IPCB_LayerObject

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

Returns the inserted layer, or null when the layer is not inserted: it belongs to another master stack, it is already in the stack, or it is an electrical layer whose layer ID is already in the stack. The inserted layer is disabled in every substack.

InsertBelow​

Inserts a layer into the master stack below a reference layer.

IPCB_LayerObject InsertBelow(IPCB_LayerObject argRefLayer, IPCB_LayerObject argLayer);
ParameterTypePassingDescription
argRefLayerIPCB_LayerObjectvalueThe layer to insert below. When it is not in the stack, the layer is inserted at the bottom.
argLayerIPCB_LayerObjectvalue

Returns: IPCB_LayerObject

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

Returns the inserted layer, or null when the layer is not inserted: it belongs to another master stack, it is already in the stack, or it is an electrical layer whose layer ID is already in the stack. The inserted layer is disabled in every substack.

InsertOnBottom​

Inserts a layer at the bottom of the master stack.

IPCB_LayerObject InsertOnBottom(IPCB_LayerObject argLayer);
ParameterTypePassing
argLayerIPCB_LayerObjectvalue

Returns: IPCB_LayerObject

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

Returns the inserted layer, or null when the layer is not inserted: it belongs to another master stack, it is already in the stack, or it is an electrical layer whose layer ID is already in the stack. The inserted layer is disabled in every substack.

InsertOnTop​

Inserts a layer at the top of the master stack.

IPCB_LayerObject InsertOnTop(IPCB_LayerObject argLayer);
ParameterTypePassing
argLayerIPCB_LayerObjectvalue

Returns: IPCB_LayerObject

Extension method of IPCB_MasterLayerStackHelper (using PCB;).

Returns the inserted layer, or null when the layer is not inserted: it belongs to another master stack, it is already in the stack, or it is an electrical layer whose layer ID is already in the stack. The inserted layer is disabled in every substack.

RemoveLayer​

Removes a layer from the master stack.

bool RemoveLayer(IPCB_LayerObject argLayer);
bool RemoveLayer(object argLayer);
ParameterTypePassing
argLayerIPCB_LayerObjectvalue

Returns: bool

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

Returns false when the layer belongs to another master stack. A mechanical layer is not removed: for one of the mechanical layers that the master stack creates by default the call sets IPCB_MechanicalLayer.MechLayerEnabled to false and returns true; for any other mechanical layer it returns false. Any other layer is removed from the stack and from every substack, and the call returns true.

RemoveSubstack​

Removes a substack from the master stack.

bool RemoveSubstack(IPCB_LayerStack argSubstack);
bool RemoveSubstack(object argSubstack);
ParameterTypePassing
argSubstackIPCB_LayerStackvalue

Returns: bool

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

Pads, vias and board regions that use the substack are assigned another substack of the master stack, if there is one. The substack's data is removed from IPCB_MaxMinWidthConstraint and IPCB_DifferentialPairsRoutingRule rules, and its trace impedances are removed from the impedance profiles. Does nothing when the master stack has no board.

SubstackCount​

Returns the number of substacks in the master stack.

int SubstackCount();

Returns: int

Inherited members​

Returned by​

IPCB_Board.MasterStack, IPCB_ImpedanceProfile.MasterLayerStack