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

Public Member Functions

def __init__ (self, args, kwargs)
def GetPosition (self)
def GetCenter (self)
def SetPosition (self, aPos)
def IsConnected (self)
def Next (self)
def Back (self)
def GetParent (self)
def GetLayer (self)
def GetLayerSet (self)
def SetLayer (self, aLayer)
def Draw (self, args)
def SwapData (self, aImage)
def IsOnLayer (self, aLayer)
def IsTrack (self)
def IsLocked (self)
def SetLocked (self, aLocked)
def UnLink (self)
def DeleteStructure (self)
def ShowShape (aShape)
def Move (self, aMoveVector)
def Rotate (self, aRotCentre, aAngle)
def Flip (self, aCentre)
def GetBoard (self)
def GetLayerName (self)
def HitTest (self, args)
def FormatAngle (aAngle)
def FormatInternalUnits (args)
def ViewGetLayers (self, aLayers, aCount)
def Cast (self)
def Duplicate (self)
def SetPos (self, p)
def SetStartEnd (self, start, end)
- Public Member Functions inherited from pcbnew.EDA_ITEM
def __init__ (self, args, kwargs)
def Type (self)
def SetTimeStamp (self, aNewTimeStamp)
def GetTimeStamp (self)
def Next (self)
def Back (self)
def GetParent (self)
def GetList (self)
def SetParent (self, aParent)
def SetList (self, aList)
def IsNew (self)
def IsModified (self)
def IsMoving (self)
def IsDragging (self)
def IsWireImage (self)
def IsSelected (self)
def IsResized (self)
def IsHighlighted (self)
def IsBrightened (self)
def SetWireImage (self)
def SetSelected (self)
def SetHighlighted (self)
def SetBrightened (self)
def ClearSelected (self)
def ClearHighlighted (self)
def ClearBrightened (self)
def SetModified (self)
def GetState (self, type)
def SetState (self, type, state)
def GetStatus (self)
def SetStatus (self, aStatus)
def SetFlags (self, aMask)
def ClearFlags
def GetFlags (self)
def SetForceVisible (self, aEnable)
def GetMsgPanelInfo (self, aList)
def HitTest (self, aPosition)
def GetBoundingBox (self)
def Clone (self)
def IterateForward (listStart, inspector, testData, scanTypes)
def Visit (self, inspector, testData, scanTypes)
def GetClass (self)
def GetSelectMenuText (self)
def GetMenuImage (self)
def Matches (self, aSearchData, aAuxData, aFindLocation)
def Replace (self, args)
def IsReplaceable (self)
def __lt__ (self, aItem)
def Sort (aLeft, aRight)
def ViewBBox (self)
def ViewGetLayers (self, aLayers, aCount)

Static Public Attributes

tuple ShowShape = staticmethod(ShowShape)
tuple FormatAngle = staticmethod(FormatAngle)
tuple FormatInternalUnits = staticmethod(FormatInternalUnits)
- Static Public Attributes inherited from pcbnew.EDA_ITEM
tuple IterateForward = staticmethod(IterateForward)
tuple Sort = staticmethod(Sort)

Detailed Description

Class BOARD_ITEM is a base class for any item which can be embedded
within the BOARD container class, and therefore instances of derived
classes should only be found in Pcbnew or other programs that use
class BOARD and its contents.

The corresponding class in Eeschema is SCH_ITEM.

C++ includes: class_board_item.h 

Definition at line 13266 of file

Constructor & Destructor Documentation

def pcbnew.BOARD_ITEM.__init__ (   self,

Definition at line 13288 of file

Member Function Documentation

def pcbnew.BOARD_ITEM.Back (   self)

BOARD_ITEM::Back() const 

Definition at line 13355 of file

def pcbnew.BOARD_ITEM.Cast (   self)

Definition at line 13697 of file

def pcbnew.BOARD_ITEM.DeleteStructure (   self)
DeleteStructure(BOARD_ITEM self)


Function DeleteStructure deletes this object after UnLink()ing it from
its owner if it has one. 

Definition at line 13533 of file

def pcbnew.BOARD_ITEM.Draw (   self,
Draw(BOARD_ITEM self, EDA_DRAW_PANEL * panel, wxDC * DC, GR_DRAWMODE aDrawMode, wxPoint offset)
Draw(BOARD_ITEM self, EDA_DRAW_PANEL * panel, wxDC * DC, GR_DRAWMODE aDrawMode)

virtual void
aDrawMode, const wxPoint &offset=ZeroOffset)=0

Function Draw BOARD_ITEMs have their own color information. 

Definition at line 13420 of file

def pcbnew.BOARD_ITEM.Duplicate (   self)

Definition at line 13728 of file

def pcbnew.BOARD_ITEM.Flip (   self,
Flip(BOARD_ITEM self, wxPoint aCentre)

virtual void
BOARD_ITEM::Flip(const wxPoint &aCentre)

Function Flip Flip this object, i.e.

change the board side for this object


aCentre:  - the rotation point. 

Definition at line 13590 of file

def pcbnew.BOARD_ITEM.FormatAngle (   aAngle)
FormatAngle(double aAngle) -> string

Definition at line 13666 of file

def pcbnew.BOARD_ITEM.FormatInternalUnits (   args)
FormatInternalUnits(int aValue) -> string
FormatInternalUnits(wxPoint aPoint) -> string
FormatInternalUnits(wxSize aSize) -> string

Definition at line 13674 of file

def pcbnew.BOARD_ITEM.GetBoard (   self)
GetBoard(BOARD_ITEM self) -> BOARD

BOARD_ITEM::GetBoard() const

Function GetBoard returns the BOARD in which this BOARD_ITEM resides,
or NULL if none. 

Definition at line 13609 of file

def pcbnew.BOARD_ITEM.GetCenter (   self)
GetCenter(BOARD_ITEM self) -> wxPoint

virtual const wxPoint
BOARD_ITEM::GetCenter() const

Function GetCenter()

This defaults to the same point as returned by GetPosition(), unless

centre point of the item 

Definition at line 13302 of file

def pcbnew.BOARD_ITEM.GetLayer (   self)
GetLayer(BOARD_ITEM self) -> LAYER_ID

BOARD_ITEM::GetLayer() const

Function GetLayer returns the primary layer this item is on. 

Definition at line 13375 of file

def pcbnew.BOARD_ITEM.GetLayerName (   self)
GetLayerName(BOARD_ITEM self) -> wxString

BOARD_ITEM::GetLayerName() const

Function GetLayerName returns the name of the PCB layer on which the
item resides.

wxString containing the layer name associated with this item. 

Definition at line 13622 of file

def pcbnew.BOARD_ITEM.GetLayerSet (   self)
GetLayerSet(BOARD_ITEM self) -> LSET

virtual LSET
BOARD_ITEM::GetLayerSet() const

Function GetLayerSet returns a "layer mask", which is a bitmap of
all layers on which the TRACK segment or VIA physically resides.

int - a layer mask, see layers_id_colors_visibility.h. 

Definition at line 13387 of file

def pcbnew.BOARD_ITEM.GetParent (   self)

BOARD_ITEM::GetParent() const 

Definition at line 13365 of file

def pcbnew.BOARD_ITEM.GetPosition (   self)
GetPosition(BOARD_ITEM self) -> wxPoint

virtual const
wxPoint& BOARD_ITEM::GetPosition() const =0 

Definition at line 13292 of file

Here is the caller graph for this function:

def pcbnew.BOARD_ITEM.HitTest (   self,
HitTest(BOARD_ITEM self, wxPoint aPosition) -> bool
HitTest(BOARD_ITEM self, EDA_RECT aRect, bool aContained=True, int aAccuracy=0) -> bool
HitTest(BOARD_ITEM self, EDA_RECT aRect, bool aContained=True) -> bool
HitTest(BOARD_ITEM self, EDA_RECT aRect) -> bool

virtual bool
BOARD_ITEM::HitTest(const EDA_RECT &aRect, bool aContained=true, int
aAccuracy=0) const

Function HitTest tests if the aRect intersects or contains this object
(depending on aContained).


aRect:  A reference to an EDA_RECT object containg the area to test.

aContained:  Test if aRect contains this object completly.

aAccuracy:  Increase the item bounding box by this amount.

bool - True if aRect contains this object completly or if aRect
intersects the object and aContained is False, otherwise false. 

Definition at line 13637 of file

Here is the caller graph for this function:

def pcbnew.BOARD_ITEM.IsConnected (   self)
IsConnected(BOARD_ITEM self) -> bool

virtual bool
BOARD_ITEM::IsConnected() const

Function IsConnected() Returns information if the object is derived

True if the object is of BOARD_CONNECTED_ITEM type, false otherwise.

Definition at line 13329 of file

def pcbnew.BOARD_ITEM.IsLocked (   self)
IsLocked(BOARD_ITEM self) -> bool

virtual bool
BOARD_ITEM::IsLocked() const

Function IsLocked.

bool - true if the object is locked, else false 

Definition at line 13493 of file

def pcbnew.BOARD_ITEM.IsOnLayer (   self,
IsOnLayer(BOARD_ITEM self, LAYER_ID aLayer) -> bool

virtual bool
BOARD_ITEM::IsOnLayer(LAYER_ID aLayer) const

Function IsOnLayer tests to see if this object is on the given layer.

Is virtual so objects like D_PAD, which reside on multiple layers can
do their own form of testing.


aLayer:  The layer to test for.

bool - true if on given layer, else false. 

Definition at line 13456 of file

def pcbnew.BOARD_ITEM.IsTrack (   self)
IsTrack(BOARD_ITEM self) -> bool

BOARD_ITEM::IsTrack() const

Function IsTrack tests to see if this object is a track or via (or

form of testing. bool - true if a track or via, else false. 

Definition at line 13478 of file

def pcbnew.BOARD_ITEM.Move (   self,
Move(BOARD_ITEM self, wxPoint aMoveVector)

virtual void
BOARD_ITEM::Move(const wxPoint &aMoveVector)

Function Move move this object.


aMoveVector:  - the move vector for this object. 

Definition at line 13554 of file

def pcbnew.BOARD_ITEM.Next (   self)

BOARD_ITEM::Next() const 

Definition at line 13345 of file

def pcbnew.BOARD_ITEM.Rotate (   self,
Rotate(BOARD_ITEM self, wxPoint aRotCentre, double aAngle)

virtual void
BOARD_ITEM::Rotate(const wxPoint &aRotCentre, double aAngle)

Function Rotate Rotate this object.


aRotCentre:  - the rotation point.

aAngle:  - the rotation angle in 0.1 degree. 

Definition at line 13571 of file

def pcbnew.BOARD_ITEM.SetLayer (   self,
SetLayer(BOARD_ITEM self, LAYER_ID aLayer)

virtual void

Function SetLayer sets the layer this item is on.


aLayer:  The layer number. is virtual because some items (in fact:
class DIMENSION) have a slightly different initialization 

Definition at line 13402 of file

def pcbnew.BOARD_ITEM.SetLocked (   self,
SetLocked(BOARD_ITEM self, bool aLocked)

virtual void
BOARD_ITEM::SetLocked(bool aLocked)

Function SetLocked modifies 'lock' status for of the item. 

Definition at line 13507 of file

def pcbnew.BOARD_ITEM.SetPos (   self,

Definition at line 13735 of file

def pcbnew.BOARD_ITEM.SetPosition (   self,
SetPosition(BOARD_ITEM self, wxPoint aPos)

virtual void
BOARD_ITEM::SetPosition(const wxPoint &aPos)=0 

Definition at line 13319 of file

def pcbnew.BOARD_ITEM.SetStartEnd (   self,

Definition at line 13739 of file

def pcbnew.BOARD_ITEM.ShowShape (   aShape)
ShowShape(STROKE_T aShape) -> wxString

Definition at line 13546 of file

def pcbnew.BOARD_ITEM.SwapData (   self,
SwapData(BOARD_ITEM self, BOARD_ITEM aImage)


Swap data between aItem and aImage.

aItem and aImage should have the same type Used in undo redo command
to swap values between an item and its copy Only values like layer,
size .. which are modified by edition are swapped, not the pointers
like Pnext and Pback because aItem is not changed in the linked list


aImage:  = the item image which contains data to swap 

Definition at line 13434 of file

def pcbnew.BOARD_ITEM.UnLink (   self)
UnLink(BOARD_ITEM self)

void BOARD_ITEM::UnLink()

Function UnLink detaches this object from its owner.

This base class implementation should work for all derived classes
which are held in a DLIST<>. 

Definition at line 13519 of file

Here is the caller graph for this function:

def pcbnew.BOARD_ITEM.ViewGetLayers (   self,
ViewGetLayers(BOARD_ITEM self, int [] aLayers, int & aCount)

BOARD_ITEM::ViewGetLayers(int aLayers[], int &aCount) const override

Definition at line 13686 of file

Member Data Documentation

tuple pcbnew.BOARD_ITEM.FormatAngle = staticmethod(FormatAngle)

Definition at line 13671 of file

tuple pcbnew.BOARD_ITEM.FormatInternalUnits = staticmethod(FormatInternalUnits)

Definition at line 13683 of file

tuple pcbnew.BOARD_ITEM.ShowShape = staticmethod(ShowShape)

Definition at line 13551 of file

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