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

Public Member Functions

def __init__ (self, aParent)
def ClassOf (aItem)
def Draw (self, args)
def IsOnLayer (self, aLayer)
def GetLayerSet (self)
def SetLayerPair (self, aTopLayer, aBottomLayer)
def LayerPair (self, top_layer, bottom_layer)
def GetPosition (self)
def SetPosition (self, aPoint)
def HitTest (self, args)
def GetClass (self)
def GetSelectMenuText (self)
def GetMenuImage (self)
def Clone (self)
def ViewGetLayers (self, aLayers, aCount)
def ViewGetLOD (self, aLayer, aView)
def Flip (self, aCentre)
def GetViaType (self)
def SetViaType (self, aViaType)
def SetDrill (self, aDrill)
def GetDrill (self)
def GetDrillValue (self)
def SetDrillDefault (self)
def IsDrillDefault (self)
- Public Member Functions inherited from pcbnew.TRACK
def ClassOf (aItem)
def __init__
def Next (self)
def Back (self)
def Move (self, aMoveVector)
def Rotate (self, aRotCentre, aAngle)
def Flip (self, aCentre)
def SetPosition (self, aPos)
def GetPosition (self)
def SetWidth (self, aWidth)
def GetWidth (self)
def SetEnd (self, aEnd)
def GetEnd (self)
def SetStart (self, aStart)
def GetStart (self)
def GetEndPoint (self, aEndPoint)
def GetBoundingBox (self)
def IsLocked (self)
def SetLocked (self, aLocked)
def GetBestInsertPoint (self, aPcb)
def GetStartNetCode (self, NetCode)
def GetEndNetCode (self, NetCode)
def GetLength (self)
def Draw (self, args)
def TransformShapeWithClearanceToPolygon (self, aCornerBuffer, aClearanceValue, aCircleToSegmentsCount, aCorrectionFactor)
def IsPointOnEnds
def IsNull (self)
def GetMsgPanelInfo (self, aList)
def ShowWidth (self)
def Visit (self, inspector, testData, scanTypes)
def HitTest (self, args)
def GetVia (self, args)
def GetTrack (self, aStartTrace, aEndTrace, aEndPoint, aSameNetOnly, aSequential)
def GetEndSegments (self, NbSegm, StartTrack, EndTrack)
def GetClass (self)
def GetClearance
def GetSelectMenuText (self)
def GetMenuImage (self)
def Clone (self)
def ViewGetLayers (self, aLayers, aCount)
def ViewGetLOD (self, aLayer, aView)
- Public Member Functions inherited from pcbnew.BOARD_CONNECTED_ITEM
def __init__ (self, args, kwargs)
def ClassOf (aItem)
def IsConnected (self)
def GetNet (self)
def SetNet (self, aNetInfo)
def GetNetCode (self)
def SetNetCode
def GetSubNet (self)
def SetSubNet (self, aSubNetCode)
def GetZoneSubNet (self)
def SetZoneSubNet (self, aSubNetCode)
def GetNetname (self)
def GetShortNetname (self)
def GetClearance
def GetNetClass (self)
def GetNetClassName (self)
- Public Member Functions inherited from pcbnew.BOARD_ITEM
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)

Public Attributes

- Public Attributes inherited from pcbnew.TRACK

Static Public Attributes

tuple ClassOf = staticmethod(ClassOf)
- Static Public Attributes inherited from pcbnew.TRACK
tuple ClassOf = staticmethod(ClassOf)
tuple start = _swig_property(_pcbnew.TRACK_start_get, _pcbnew.TRACK_start_set)
tuple end = _swig_property(_pcbnew.TRACK_end_get, _pcbnew.TRACK_end_set)
tuple m_Param = _swig_property(_pcbnew.TRACK_m_Param_get, _pcbnew.TRACK_m_Param_set)
- Static Public Attributes inherited from pcbnew.BOARD_CONNECTED_ITEM
tuple m_TracksConnected = _swig_property(_pcbnew.BOARD_CONNECTED_ITEM_m_TracksConnected_get, _pcbnew.BOARD_CONNECTED_ITEM_m_TracksConnected_set)
tuple m_PadsConnected = _swig_property(_pcbnew.BOARD_CONNECTED_ITEM_m_PadsConnected_get, _pcbnew.BOARD_CONNECTED_ITEM_m_PadsConnected_set)
tuple ClassOf = staticmethod(ClassOf)
- Static Public Attributes inherited from pcbnew.BOARD_ITEM
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

C++ includes: class_track.h 

Definition at line 22456 of file

Constructor & Destructor Documentation

def pcbnew.VIA.__init__ (   self,
__init__(VIA self, BOARD_ITEM aParent) -> VIA


Definition at line 22468 of file

Member Function Documentation

def pcbnew.VIA.ClassOf (   aItem)
ClassOf(EDA_ITEM aItem) -> bool

Definition at line 22480 of file

def pcbnew.VIA.Clone (   self)
Clone(VIA self) -> EDA_ITEM

EDA_ITEM * VIA::Clone() const

Function Clone creates a duplicate of this item with linked list
members set to NULL.

The default version will return NULL in release builds and likely
crash the program. In debug builds, a warning message indicating the
derived class has not implemented cloning. This really should be a
pure virtual function. Due to the fact that there are so many objects
derived from EDA_ITEM, the decision was made to return NULL until all
the objects derived from EDA_ITEM implement cloning. Once that
happens, this function should be made pure.

A clone of the item. 

Definition at line 22676 of file

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

*panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint
&aOffset=ZeroOffset) override

Function Draw BOARD_ITEMs have their own color information. 

Definition at line 22488 of file

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

void VIA::Flip(const wxPoint
&aCentre) override

Function Flip Flip this object, i.e.

change the board side for this object


aCentre:  - the rotation point. 

Definition at line 22719 of file

def pcbnew.VIA.GetClass (   self)
GetClass(VIA self) -> wxString

wxString VIA::GetClass() const

Function GetClass returns the class name.


Definition at line 22625 of file

def pcbnew.VIA.GetDrill (   self)
GetDrill(VIA self) -> int

int VIA::GetDrill() const

Function GetDrill returns the local drill setting for this VIA.

If you want the calculated value, use GetDrillValue() instead. 

Definition at line 22774 of file

def pcbnew.VIA.GetDrillValue (   self)
GetDrillValue(VIA self) -> int

int VIA::GetDrillValue()

Function GetDrillValue "calculates" the drill value for vias
(m-Drill if > 0, or default drill value for the board.

real drill_value 

Definition at line 22787 of file

Here is the caller graph for this function:

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

LSET VIA::GetLayerSet()
const override

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 22524 of file

def pcbnew.VIA.GetMenuImage (   self)
GetMenuImage(VIA self) -> BITMAP_DEF

VIA::GetMenuImage() const override

Function GetMenuImage returns a pointer to an image to be used in

The default version returns the right arrow image. Override this
function to provide object specific menu images. The menu image
associated with the item. 

Definition at line 22659 of file

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

const wxPoint&
VIA::GetPosition() const override 

Definition at line 22580 of file

def pcbnew.VIA.GetSelectMenuText (   self)
GetSelectMenuText(VIA self) -> wxString

VIA::GetSelectMenuText() const override

Function GetSelectMenuText returns the text to display to be used in
the selection clarification context menu when multiple items are found
at the current cursor position.

The default version of this function raises an assertion in the debug
mode and returns a string to indicate that it was not overridden to
provide the object specific text.

The menu text string. 

Definition at line 22639 of file

def pcbnew.VIA.GetViaType (   self)
GetViaType(VIA self) -> VIATYPE_T


Definition at line 22738 of file

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

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


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 22600 of file

def pcbnew.VIA.IsDrillDefault (   self)
IsDrillDefault(VIA self) -> bool

VIA::IsDrillDefault() const

Function IsDrillDefault.

true if the drill value is default value (-1) 

Definition at line 22815 of file

def pcbnew.VIA.IsOnLayer (   self,
IsOnLayer(VIA self, PCB_LAYER_ID aLayer) -> bool

VIA::IsOnLayer(PCB_LAYER_ID aLayer) const override

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 22502 of file

def pcbnew.VIA.LayerPair (   self,
LayerPair(VIA self, PCB_LAYER_ID * top_layer, PCB_LAYER_ID * bottom_layer)

VIA::LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer)

Function LayerPair Return the 2 layers used by the via (the via
actually uses all layers between these 2 layers)


top_layer:  = pointer to the first layer (can be null)

bottom_layer:  = pointer to the last layer (can be null) 

Definition at line 22559 of file

def pcbnew.VIA.SetDrill (   self,
SetDrill(VIA self, int aDrill)

void VIA::SetDrill(int aDrill)

Function SetDrill sets the drill value for vias.


aDrill:  is the new drill diameter 

Definition at line 22758 of file

def pcbnew.VIA.SetDrillDefault (   self)
SetDrillDefault(VIA self)


Function SetDrillDefault sets the drill value for vias to the default

Definition at line 22802 of file

def pcbnew.VIA.SetLayerPair (   self,
SetLayerPair(VIA self, PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)

VIA::SetLayerPair(PCB_LAYER_ID aTopLayer, PCB_LAYER_ID aBottomLayer)

Function SetLayerPair For a via m_Layer contains the top layer, the
other layer is in m_BottomLayer.


aTopLayer:  = first layer connected by the via

aBottomLayer:  = last layer connected by the via 

Definition at line 22539 of file

def pcbnew.VIA.SetPosition (   self,
SetPosition(VIA self, wxPoint aPoint)

void VIA::SetPosition(const
wxPoint &aPoint) override 

Definition at line 22590 of file

def pcbnew.VIA.SetViaType (   self,
SetViaType(VIA self, VIATYPE_T aViaType)

VIA::SetViaType(VIATYPE_T aViaType) 

Definition at line 22748 of file

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

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

Definition at line 22699 of file

def pcbnew.VIA.ViewGetLOD (   self,
ViewGetLOD(VIA self, int aLayer, KIGFX::VIEW * aView) -> unsigned int

unsigned int
VIA::ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override 

Definition at line 22709 of file

Member Data Documentation

tuple pcbnew.VIA.ClassOf = staticmethod(ClassOf)

Definition at line 22485 of file


Definition at line 22478 of file

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