KiCAD pcbnew scripting
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
pcbnew.LSET Class Reference
Inheritance diagram for pcbnew.LSET:
Inheritance graph

Public Member Functions

def __init__ (self, args)
def Name (aLayerId)
def InternalCuMask ()
def AllCuMask (args)
def ExternalCuMask ()
def AllNonCuMask ()
def AllLayersMask ()
def FrontTechMask ()
def FrontBoardTechMask ()
def BackTechMask ()
def BackBoardTechMask ()
def AllTechMask ()
def AllBoardTechMask ()
def FrontMask ()
def BackMask ()
def UserMask ()
def CuStack (self)
def Technicals (self, args)
def Users (self)
def UIOrder (self)
def Seq (self, args)
def SeqStackupBottom2Top (self)
def FmtHex (self)
def ParseHex (self, aStart, aCount)
def FmtBin (self)
def ExtractLayer (self)
def addLayer (self, aLayer)
def removeLayer (self, aLayer)
def addLayerSet (self, aLayerSet)
def removeLayerSet (self, aLayerSet)
def AddLayer (self, layer)
def AddLayerSet (self, layers)
def RemoveLayer (self, layer)
def RemoveLayerSet (self, layers)
- Public Member Functions inherited from pcbnew.BASE_SET
def __init__ (self, args, kwargs)

Public Attributes


Static Public Attributes

tuple Name = staticmethod(Name)
tuple InternalCuMask = staticmethod(InternalCuMask)
tuple AllCuMask = staticmethod(AllCuMask)
tuple ExternalCuMask = staticmethod(ExternalCuMask)
tuple AllNonCuMask = staticmethod(AllNonCuMask)
tuple AllLayersMask = staticmethod(AllLayersMask)
tuple FrontTechMask = staticmethod(FrontTechMask)
tuple FrontBoardTechMask = staticmethod(FrontBoardTechMask)
tuple BackTechMask = staticmethod(BackTechMask)
tuple BackBoardTechMask = staticmethod(BackBoardTechMask)
tuple AllTechMask = staticmethod(AllTechMask)
tuple AllBoardTechMask = staticmethod(AllBoardTechMask)
tuple FrontMask = staticmethod(FrontMask)
tuple BackMask = staticmethod(BackMask)
tuple UserMask = staticmethod(UserMask)

Detailed Description

Class LSET is a set of PCB_LAYER_IDs.

It can be converted to numerous purpose LSEQs using the various member
functions, most of which are based on Seq(). The advantage of
converting to LSEQ using purposeful code, is it removes any dependency
on order/sequence inherent in this set.

C++ includes: layers_id_colors_and_visibility.h 

Definition at line 31662 of file

Constructor & Destructor Documentation

def pcbnew.LSET.__init__ (   self,
__init__(LSET self) -> LSET
__init__(LSET self, BASE_SET aOther) -> LSET
__init__(LSET self, PCB_LAYER_ID aLayer) -> LSET
__init__(LSET self, PCB_LAYER_ID const * aArray, unsigned int aCount) -> LSET
__init__(LSET self, unsigned int aIdCount, int aFirst) -> LSET

LSET::LSET(unsigned aIdCount, int

Constructor LSET( unsigned, PCB_LAYER_ID, ...) takes one or more
PCB_LAYER_IDs in the argument list to construct the set.

Typically only used in static construction.


aIdCount:  is the number of PCB_LAYER_IDs which follow.

aFirst:  is the first included in aIdCount and must always be present,
and can be followed by any number of additional PCB_LAYER_IDs so long
as aIdCount accurately reflects the count.

Parameter is 'int' to avoid va_start undefined behavior. 

Definition at line 31685 of file

Member Function Documentation

def pcbnew.LSET.addLayer (   self,
addLayer(LSET self, PCB_LAYER_ID aLayer) -> LSET

Definition at line 31985 of file

def pcbnew.LSET.AddLayer (   self,

Definition at line 32005 of file

def pcbnew.LSET.addLayerSet (   self,
addLayerSet(LSET self, LSET aLayerSet) -> LSET

Definition at line 31995 of file

def pcbnew.LSET.AddLayerSet (   self,

Definition at line 32008 of file

def pcbnew.LSET.AllBoardTechMask ( )
AllBoardTechMask() -> LSET

Definition at line 31809 of file

def pcbnew.LSET.AllCuMask (   args)
AllCuMask(int aCuLayerCount) -> LSET
AllCuMask() -> LSET

Definition at line 31734 of file

def pcbnew.LSET.AllLayersMask ( )
AllLayersMask() -> LSET

Definition at line 31761 of file

def pcbnew.LSET.AllNonCuMask ( )
AllNonCuMask() -> LSET

Definition at line 31753 of file

def pcbnew.LSET.AllTechMask ( )
AllTechMask() -> LSET

Definition at line 31801 of file

def pcbnew.LSET.BackBoardTechMask ( )
BackBoardTechMask() -> LSET

Definition at line 31793 of file

def pcbnew.LSET.BackMask ( )
BackMask() -> LSET

Definition at line 31825 of file

def pcbnew.LSET.BackTechMask ( )
BackTechMask() -> LSET

Definition at line 31785 of file

def pcbnew.LSET.CuStack (   self)
CuStack(LSET self) -> LSEQ

LSEQ LSET::CuStack() const

Function CuStack returns a sequence of copper layers in starting from
the front/top and extending to the back/bottom.

This specific sequence is depended upon in numerous places. 

Definition at line 31841 of file

def pcbnew.LSET.ExternalCuMask ( )
ExternalCuMask() -> LSET

Definition at line 31745 of file

def pcbnew.LSET.ExtractLayer (   self)
ExtractLayer(LSET self) -> PCB_LAYER_ID

LSET::ExtractLayer() const

Find the first set PCB_LAYER_ID.

Returns UNDEFINED_LAYER if more than one is set or UNSELECTED_LAYER if
none is set. 

Definition at line 31970 of file

def pcbnew.LSET.FmtBin (   self)
FmtBin(LSET self) -> string

std::string LSET::FmtBin() const

Function FmtBin returns a binary string showing contents of this LSEQ.

Definition at line 31958 of file

def pcbnew.LSET.FmtHex (   self)
FmtHex(LSET self) -> string

std::string LSET::FmtHex() const

Function FmtHex returns a hex string showing contents of this LSEQ. 

Definition at line 31930 of file

Here is the caller graph for this function:

def pcbnew.LSET.FrontBoardTechMask ( )
FrontBoardTechMask() -> LSET

Definition at line 31777 of file

def pcbnew.LSET.FrontMask ( )
FrontMask() -> LSET

Definition at line 31817 of file

def pcbnew.LSET.FrontTechMask ( )
FrontTechMask() -> LSET

Definition at line 31769 of file

def pcbnew.LSET.InternalCuMask ( )
InternalCuMask() -> LSET

Definition at line 31726 of file

def pcbnew.LSET.Name (   aLayerId)
Name(PCB_LAYER_ID aLayerId) -> wxChar const *

Definition at line 31718 of file

def pcbnew.LSET.ParseHex (   self,
ParseHex(LSET self, char const * aStart, int aCount) -> int

int LSET::ParseHex(const char
*aStart, int aCount)

Function ParseHex understands the output of FmtHex() and replaces this
set's values with those given in the input string.

Parsing stops at the first non hex ASCII byte, except that marker
bytes output from FmtHex are not terminators. int - number of bytes

Definition at line 31941 of file

def pcbnew.LSET.removeLayer (   self,
removeLayer(LSET self, PCB_LAYER_ID aLayer) -> LSET

Definition at line 31990 of file

def pcbnew.LSET.RemoveLayer (   self,

Definition at line 32011 of file

def pcbnew.LSET.removeLayerSet (   self,
removeLayerSet(LSET self, LSET aLayerSet) -> LSET

Definition at line 32000 of file

def pcbnew.LSET.RemoveLayerSet (   self,

Definition at line 32014 of file

def pcbnew.LSET.Seq (   self,
Seq(LSET self, PCB_LAYER_ID const * aWishListSequence, unsigned int aCount) -> LSEQ
Seq(LSET self) -> LSEQ

LSEQ LSET::Seq() const

Function Seq returns a LSEQ from this LSET in ascending PCB_LAYER_ID

Each LSEQ element will be in the same sequence as in PCB_LAYER_ID and
only present in the resultant LSEQ if present in this set. Therefore
the sequence is subject to change, use it only when enumeration and
not order is important. 

Definition at line 31896 of file

def pcbnew.LSET.SeqStackupBottom2Top (   self)
SeqStackupBottom2Top(LSET self) -> LSEQ

LSET::SeqStackupBottom2Top() const

Function SeqStackBottom2Top returns the sequence that is typical for a
bottom-to-top stack-up.

For instance, to plot multiple layers in a single image, the top
layers output last. 

Definition at line 31914 of file

def pcbnew.LSET.Technicals (   self,
Technicals(LSET self, LSET aSubToOmit) -> LSEQ
Technicals(LSET self) -> LSEQ

LSEQ LSET::Technicals(LSET
aSubToOmit=LSET()) const

Function Technicals returns a sequence of technical layers.

A sequence provides a certain order.


aSubToOmit:  is the subset of the techical layers to omit, defaults to

Definition at line 31855 of file

def pcbnew.LSET.UIOrder (   self)
UIOrder(LSET self) -> LSEQ

LSEQ LSET::UIOrder() const 

Definition at line 31887 of file

def pcbnew.LSET.UserMask ( )
UserMask() -> LSET

Definition at line 31833 of file

def pcbnew.LSET.Users (   self)
Users(LSET self) -> LSEQ

LSEQ LSET::Users() const

*_User layers. 

Definition at line 31876 of file

Member Data Documentation

tuple pcbnew.LSET.AllBoardTechMask = staticmethod(AllBoardTechMask)

Definition at line 31814 of file

tuple pcbnew.LSET.AllCuMask = staticmethod(AllCuMask)

Definition at line 31742 of file

tuple pcbnew.LSET.AllLayersMask = staticmethod(AllLayersMask)

Definition at line 31766 of file

tuple pcbnew.LSET.AllNonCuMask = staticmethod(AllNonCuMask)

Definition at line 31758 of file

tuple pcbnew.LSET.AllTechMask = staticmethod(AllTechMask)

Definition at line 31806 of file

tuple pcbnew.LSET.BackBoardTechMask = staticmethod(BackBoardTechMask)

Definition at line 31798 of file

tuple pcbnew.LSET.BackMask = staticmethod(BackMask)

Definition at line 31830 of file

tuple pcbnew.LSET.BackTechMask = staticmethod(BackTechMask)

Definition at line 31790 of file

tuple pcbnew.LSET.ExternalCuMask = staticmethod(ExternalCuMask)

Definition at line 31750 of file

tuple pcbnew.LSET.FrontBoardTechMask = staticmethod(FrontBoardTechMask)

Definition at line 31782 of file

tuple pcbnew.LSET.FrontMask = staticmethod(FrontMask)

Definition at line 31822 of file

tuple pcbnew.LSET.FrontTechMask = staticmethod(FrontTechMask)

Definition at line 31774 of file

tuple pcbnew.LSET.InternalCuMask = staticmethod(InternalCuMask)

Definition at line 31731 of file

tuple pcbnew.LSET.Name = staticmethod(Name)

Definition at line 31723 of file


Definition at line 31716 of file

tuple pcbnew.LSET.UserMask = staticmethod(UserMask)

Definition at line 31838 of file

The documentation for this class was generated from the following file: