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
| Property | Type | Access | Description |
|---|---|---|---|
| LayerStackStyle | TLayerStackStyle | get; set | The layer stacking style of the board. |
| Substacks | IPCB_LayerStack | get | The 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
| Method | Returns | Description |
|---|---|---|
| Board | IPCB_Board | Returns the board that owns the master stack, or null when there is none. |
| CreateLayer | IPCB_LayerObject | Returns a layer object for a layer ID, creating it when needed. |
| CreateSubstack | IPCB_LayerStack | Creates a substack and adds it at the end of the master stack's substacks. |
| DisableLayer | void | Disables a layer of the master stack in a substack. |
| EnableLayer | void | Enables a layer of the master stack in a substack. |
| Export_ToParameters | void | Writes the definition of the master stack to a parameter string. |
| GetSubstack | IPCB_LayerStack | Returns the substack with the given ID, or null when there is none. |
| GetSubstack_1 | IPCB_LayerStack | Returns the first substack whose layers of a layer class are exactly the layers of a layer set, or null when no substack matches. |
| Import_FromParameters | void | Reads the definition of the master stack from a parameter string. |
| InsertAbove | IPCB_LayerObject | Inserts a layer into the master stack above a reference layer. |
| InsertBelow | IPCB_LayerObject | Inserts a layer into the master stack below a reference layer. |
| InsertOnBottom | IPCB_LayerObject | Inserts a layer at the bottom of the master stack. |
| InsertOnTop | IPCB_LayerObject | Inserts a layer at the top of the master stack. |
| RemoveLayer | bool | Removes a layer from the master stack. |
| RemoveSubstack | bool | Removes a substack from the master stack. |
| SubstackCount | int | Returns 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);
| Parameter | Type | Passing |
|---|---|---|
argLayer | V7_LayerBase | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argSubstack | IPCB_LayerStack | value |
argLayer | IPCB_LayerObject | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argSubstack | IPCB_LayerStack | value |
argLayer | IPCB_LayerObject | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argParams | string | ref |
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);
| Parameter | Type | Passing |
|---|---|---|
argSubstackID | string | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argSet | IPCB_LayerSet | value | |
argT | TLayerClassID | value | The 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);
| Parameter | Type | Passing |
|---|---|---|
argParams | string | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argRefLayer | IPCB_LayerObject | value | The layer to insert above. When it is not in the stack, the layer is inserted on top. |
argLayer | IPCB_LayerObject | value |
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);
| Parameter | Type | Passing | Description |
|---|---|---|---|
argRefLayer | IPCB_LayerObject | value | The layer to insert below. When it is not in the stack, the layer is inserted at the bottom. |
argLayer | IPCB_LayerObject | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argLayer | IPCB_LayerObject | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argLayer | IPCB_LayerObject | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argLayer | IPCB_LayerObject | value |
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);
| Parameter | Type | Passing |
|---|---|---|
argSubstack | IPCB_LayerStack | value |
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
- From IPCB_LayerStackBase: Count, Count_1, Count_2, First, ID, IsFlex, Iterator, Iterator_1, Iterator_2, Last, Name, Next, Previous, StateID, ZBottom, ZTop
Returned by
IPCB_Board.MasterStack, IPCB_ImpedanceProfile.MasterLayerStack