Skip to content

Commit 8a54976

Browse files
committed
Properly set attributes for panel holes
1 parent 17190e4 commit 8a54976

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

kikit/panelize.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,8 @@ def makeMouseBites(self, cuts, diameter, spacing, offset=fromMm(0.25),
14801480
hole = cut.interpolate( i * length / (count - 1) )
14811481
if bloatedSubstrate.intersects(hole):
14821482
self.addNPTHole(toKiCADPoint((hole.x, hole.y)), diameter,
1483-
ref=f"KiKit_MB_{self.renderedMousebiteCounter}_{i+1}")
1483+
ref=f"KiKit_MB_{self.renderedMousebiteCounter}_{i+1}",
1484+
excludedFromPos=True)
14841485

14851486
def makeCutsToLayer(self, cuts, layer=Layer.Cmts_User, prolongation=fromMm(0)):
14861487
"""
@@ -1503,7 +1504,8 @@ def makeCutsToLayer(self, cuts, layer=Layer.Cmts_User, prolongation=fromMm(0)):
15031504
self.board.Add(segment)
15041505

15051506
def addNPTHole(self, position: VECTOR2I, diameter: KiLength,
1506-
paste: bool=False, ref: Optional[str]=None) -> None:
1507+
paste: bool=False, ref: Optional[str]=None,
1508+
excludedFromPos: bool=False) -> None:
15071509
"""
15081510
Add a drilled non-plated hole to the position (`VECTOR2I`) with given
15091511
diameter. The paste option allows to place the hole on the paste layers.
@@ -1520,6 +1522,10 @@ def addNPTHole(self, position: VECTOR2I, diameter: KiLength,
15201522
pad.SetLayerSet(layerSet)
15211523
if ref is not None:
15221524
footprint.SetReference(ref)
1525+
if hasattr(footprint, "SetExcludedFromPosFiles"): # KiCAD 6 doesn't support this attribute
1526+
footprint.SetExcludedFromPosFiles(excludedFromPos)
1527+
if hasattr(footprint, "SetBoardOnly"):
1528+
footprint.SetBoardOnly(True)
15231529
self.board.Add(footprint)
15241530

15251531
def addFiducial(self, position: VECTOR2I, copperDiameter: KiLength,
@@ -1590,7 +1596,7 @@ def addCornerTooling(self, holeCount, horizontalOffset, verticalOffset,
15901596
The offsets are measured from the outer edges of the substrate.
15911597
"""
15921598
for i, pos in enumerate(self.panelCorners(horizontalOffset, verticalOffset)[:holeCount]):
1593-
self.addNPTHole(pos, diameter, paste, ref=f"KiKit_TO_{i+1}")
1599+
self.addNPTHole(pos, diameter, paste, ref=f"KiKit_TO_{i+1}", excludedFromPos=False)
15941600

15951601
def addMillFillets(self, millRadius):
15961602
"""

0 commit comments

Comments
 (0)