Setting ${EXCLUDE_FROM_BOARD} in KiBot Variants

Hi,

I’m currently working on a keyboard project. It’s flippable, so those who wish to hand solder components can solder bridge a few jumpers to use the mcu on the other side.

I placed some test points over the jumpers in my pcb layout so when I’m sending the board out for fabrication and assembly, I don’t have to go in and manually solder all the test points.

I thought I would be able to use variants in KiBot in my CI/CD process to generate the flippable version, and the dedicated left and right versions of the pcb. Unfortunately, I discovered after setting everything up, that the variants seem to only affect the bom/cpl generation.

Upon further exploration, I found that I could go Tools > Edit Symbol Fields… in the schematic editor and add a column ${EXCLUDE_FROM_BOARD}, which if I set to true and then imported the changes into my pcb, the unneeded test points could be removed.

Is it possible to set the ${EXCLUDE_FROM_BOARD} field directly from KiBot? I tried

filters:
  - name: match_tp
    comment: 'A filter to select Test Points'
    type: generic
    include_only:
      - column: 'Reference'
        regex: '^TP[0-9]*'

  - name: tp
    comment: 'Exclude Test Points'
    type: field_modify
    fields: ${EXCLUDE_FROM_BOARD}
    include: match_tp
    regex: no
    replace: yes

in my kibot.yaml, but kibot didn’t like the boolean values. It also seems I would still need a way to run the “import changes from schematic” in order to remove the test points from the gerbers…

Has anyone dealt with this? Is there a key to run import changes from schematic in preflight that I’m missing?

Thanks in advance for any input!

Sorry can’t help you with KiBot, I use KiVar for variants, it does a fine job for what I need.

Hey thanks for replying… Reading some of your older posts was helpful as I started to navigate this this week…

It seems like I can accomplish what I’ve been trying to do by not removing the Test Point footprints entirely, but using KiBot’s ‘var_rename’ filter to swap to a footprint with a pad of 0.001 mm diameter. I’m having some difficulty actually implementing it—variants using the filter seem to produce the error

ERROR:Error loading PCB file. Corrupted? (kibot.gs - gs.py:834)
ERROR:Maximum line length exceeded (kibot.gs - gs.py:834)

KiBot’s gs.py:834 is the line that outputs the error message, so I don’t know where to go…

I was also surprised that ‘var_rename’ replaces the value in every row of the symbol table of the designated column, but I was able to fill things in by copying and pasting. The write up made it sound to me like it would only change values in rows that were not empty.

I’m using

variants:
  - name: flip
    comment: 'For Hand Soldering'
    type: kibom
    file_id: _FLIP
    variant: flip
    pre_transform: 
      - fix_rotation

  - name: left
    comment: 'Left for PCBA'
    type: kibom
    file_id: _LEFT
    variant: left
    pre_transform: 
      - variant_rename
      - fix_rotation

  - name: right
    comment: 'Right for PCBA'
    type: kibom
    file_id: _RIGHT
    variant: right
    pre_transform: 
      - variant_rename
      - fix_rotation

filters:
  - name: 'variant_rename'
    comment: 'Add TPs and 3305s to board'
    type: var_rename
    separator: ':'
    variant_to_value: false

with columns called left:Footprint and right:Footprint in the symbol table, then running kibot -d default -g variant={flip/left/right}.

I’ll try and make a test repo and see if the issue persists. It occasionally throws a

WARNING:(W011) Missing default symbol library table (kibot - config.py:520)

which it only started doing once I added the ‘var_rename’ to the affected variants. Removing ‘var_rename’ from the affected variants runs without error…

I explored a little further, and KiBot seems to be producing REALLY long line lengths, the most extreme being over a million characters.

I documented the issue in a bug report with KiBot.