Skip to content

python: board.GetNetClasses() : 'BOARD_DESIGN_SETTINGS' object has no attribute 'GetNetClasses'

Description

Calling board.GetNetClasses() throws an error in Python:

import pcbnew
board = pcbnew.GetBoard()
board.GetNetClasses()

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\KiCad\6.99\bin\Lib\site-packages\pcbnew.py", line 18599, in GetNetClasses
    return self.GetDesignSettings().GetNetClasses()
AttributeError: 'BOARD_DESIGN_SETTINGS' object has no attribute 'GetNetClasses'

Appears to be broken in a9536b5d

Steps to reproduce

  1. Try to execute the above lines in the Python scripting console

KiCad Version

Application: KiCad PCB Editor (64-bit)

Version: (6.99.0-4926-g93e313440e), release build

Libraries:
	wxWidgets 3.2.1
	FreeType 2.12.1
	HarfBuzz 5.0.1
	FontConfig 2.14.1
	libcurl/7.86.0-DEV Schannel zlib/1.2.13

Platform: Windows 10 (build 19044), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
	Date: Dec 13 2022 06:24:59
	wxWidgets: 3.2.1 (wchar_t,wx containers)
	Boost: 1.80.0
	OCC: 7.6.2
	Curl: 7.86.0-DEV
	ngspice: 37
	Compiler: Visual C++ 1929 without C++ ABI

Build settings:
	KICAD_SPICE=ON