Closed msalau closed 7 months ago
@msalau this addition seems to throw false positives. I'm thinking changing it to (footprint.GetAttributes() & pcbnew.FP_DNP)) What do you think?
@bennymeg
Sure, the attribute bit-field should work too. The only trick is that pcbnew.FP_DNP
is defined only since v8.
Can you share a project that reproduces the issue?
I took the pi template project which has both SMD and THT components. many community members reported the same issue. I used v8.0.1, this might be the source of the issue.
Edit:
The only trick is that pcbnew.FP_DNP is defined only since v8.
You are right, so something like (footprint.GetAttributes() & getattr(pcbnew, 'FP_DNP', 0))
should work.
@bennymeg I wrote a comment in https://github.com/bennymeg/Fabrication-Toolkit/issues/148 It seems the issue has been introduced while refactoring the feature but not the feature itself.
Thank you for finding out the issue! I also missed the invocation parentheses =P
footprint_has_field(footprint, 'dnp')
returnsFalse
for DNP components in KiCAD v8.In KiCAD v8 the DNP flag is available via either the IsDNP() getter or the FP_DNP attribute.
The added
getattr()
call turns intofootprint.IsDNP()
in KiCAD v8 orbool()
(which evaluates intoFalse
) in KiCAD v7 and earlier.