Cannot get net classes in v6 in Python API: `BOARD.GetNetClasses` broken
Description
The function BOARD.GetNetClasses()
is broken (see stack trace below).
File "/home/xmrazek7/projects/kikit/kikit/panelize.py", line 721, in appendBoard
defaultNetClass = board.GetNetClasses().GetDefaultPtr()
File "/usr/lib/python3/dist-packages/pcbnew.py", line 21057, in GetNetClasses
return self.GetDesignSettings().m_NetClasses
File "/usr/lib/python3/dist-packages/pcbnew.py", line 10660, in <lambda>
__getattr__ = lambda self, name: _swig_getattr(self, BOARD_DESIGN_SETTINGS, name)
File "/usr/lib/python3/dist-packages/pcbnew.py", line 80, in _swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'BOARD_DESIGN_SETTINGS' object has no attribute 'm_NetClasses'
It seems there is a typo. However, even when I edit board.GetDesignSettings().GetNetClasses()
it doesn't seem to do anything to the net classes. When I look at the implementation of BOARD::SynchronizeNetsAndNetClasses
it loads the net classes from the project file, not from BOARD_DESIGN_SETTINGS
.
Is there a way to add/manipulate net classes of a board at the moment from the Python API?
Steps to reproduce
board = pcbnew.LoadBoard(sys.argv[1])
c = board.GetNetClasses()
KiCad Version
Application: KiCad PCB Editor
Version: 6.0.6-3a73a75311~116~ubuntu20.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Platform: Linux 5.13.0-44-generic x86_64, 64 bit, Little endian, wxGTK, regolith, x11
Build Info:
Date: Jun 20 2022 07:42:55
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.71.0
OCC: 7.5.2
Curl: 7.83.1
ngspice: 36
Compiler: GCC 9.4.0 with C++ ABI 1013
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON
Edited by Jan Mrázek