From 66b0c20c69b42bae48cac0e9fee4f92a7fe7470a Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 4 May 2023 13:20:48 -0300 Subject: [PATCH] [Position][Fixed] "Exclude from position files" not excluded - When only SMD components are selected. See #429 --- CHANGELOG.md | 3 +++ kibot/out_position.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55c2e9ac5..34504be5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - KiCad v6/7 schematic: - Net Class Flags not saved in variants or annotated schematics - Repeated UUIDs saved in variants +- Position: + - Components marked as "Exclude from position files" not excluded when only + SMD components are selected. (See #429) ## [1.6.2] - 2023-04-24 ### Added diff --git a/kibot/out_position.py b/kibot/out_position.py index 07c81726f..6542ea9fc 100644 --- a/kibot/out_position.py +++ b/kibot/out_position.py @@ -80,7 +80,9 @@ def __init__(self): self.use_aux_axis_as_origin = True """ Use the auxiliary axis as origin for coordinates (KiCad default) """ self.include_virtual = False - """ Include virtual components. For special purposes, not pick & place """ + """ Include virtual components. For special purposes, not pick & place. + Note that virtual components is a KiCad 5 concept. + For KiCad 6+ we replace this concept by the option to exclude from position file """ super().__init__() self._expand_id = 'position' @@ -197,7 +199,7 @@ def is_pure_smd_5(m): @staticmethod def is_pure_smd_6(m): - return m.GetAttributes() & (MOD_THROUGH_HOLE | MOD_SMD) == MOD_SMD + return m.GetAttributes() & (MOD_THROUGH_HOLE | MOD_SMD | MOD_EXCLUDE_FROM_POS_FILES) == MOD_SMD @staticmethod def is_not_virtual_5(m):