Skip to content

Commit 9d53a83

Browse files
committed
Prevent crash when Edge.Cuts contains text
1 parent f0d018c commit 9d53a83

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

SparkFunKiCadPanelizer/panelizer/panelizer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,10 @@ def startPanelizer(self, args, board=None, ordering=None, logger=None):
368368
cutWidth = 0
369369
drawings = board.GetDrawings()
370370
for drawing in drawings:
371-
if drawing.IsOnLayer(edgeLayerNumber):
372-
if drawing.GetWidth() > cutWidth:
373-
cutWidth = drawing.GetWidth()
371+
if hasattr(drawing, "IsOnLayer") and hasattr(drawing, "GetWidth"):
372+
if drawing.IsOnLayer(edgeLayerNumber):
373+
if drawing.GetWidth() > cutWidth:
374+
cutWidth = drawing.GetWidth()
374375
#report += "Subtracting Edge.Cuts line width of {}mm.\n".format(cutWidth / SCALE)
375376
boardWidth -= cutWidth
376377
boardHeight -= cutWidth

0 commit comments

Comments
 (0)