Need help from someone who runs the nightly [SOLVED]

Preferably a recent version, and Windows if possible (but Linux and MacOS perfectly acceptable).

What is returned in the console with the following commands in the Scripting Console:
pcbnew.PCB_LAYER_ID
len(pcbnew.PCB_LAYER_ID)

I’m trying to make KiPadCheck compatible with the current nightly version of KiCad.

Support for pcbnew.LAYER_ID_COUNT appears to be dropped and I’m looking for the replacement.

Thank you!!

Ok, I got my answer for the previous code,

How about the following:

I had to enter line by line to get the console to recognize the indent after the while loop

num = 0
while (0 <= pcbnew.GetBoard().GetLayerID(pcbnew.GetBoard().GetLayerName(num)) <= 254):
    num += 1
num

I am running a nightly on macOS.

Details:
Application: kicad
Version: (2017-07-16 revision e797af3)-master, release build
Libraries: wxWidgets 3.0.2
libcurl/7.54.0 SecureTransport zlib/1.2.8
Platform: Mac OS X (Darwin 16.7.0 x86_64), 64 bit, Little endian, wxMac

  • Build Info -
    wxWidgets: 3.0.2 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.61.0
    Curl: 7.43.0
    KiCad - Compiler: Clang 7.3.0 with C++ ABI 1002
    Settings: USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON

From the Python console:

Py 0.9.8
Python 2.7.10 (default, Feb  7 2017, 00:08:15) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Startup script executed: /Users/johnpateman/Library/Preferences/kicad/PyShell_pcbnew_startup.pyimport pcbnew
    pcbnew.PCB_LAYER_ID
    Traceback (most recent call last):
      File "<input>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'PCB_LAYER_ID'
    pcbnew.PCB_LAYER_ID_COUNT
    50

So on my nightly at least there is no pcbnew.PCB_LAYER_ID but there IS a pcbnew.PCB_LAYER_ID_COUNT

BW

John

OH! That’s awesome. Thank you!!!

Presumably the following will work with the nightly and 4.0.6 stable

try:
    LAYERCOUNT = pcbnew.PCB_LAYER_ID_COUNT # nightlies, post 4.0.6
except:
    LAYERCOUNT = pcbnew.LAYER_ID_COUNT # KiCad 4.0.6 stable

Can you try
pcbnew.PCB_LAYER_ID_COUNT

Thanks all! The new version of KiPadCheck that incorporates this change is released. Looking for volunteers to test it! (See the recent thread on it’s release)