Skip to content

Instantly share code, notes, and snippets.

@NZSmartie
Last active September 16, 2018 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NZSmartie/b1a9eb266710f30e0772764bcf37d7e9 to your computer and use it in GitHub Desktop.
Save NZSmartie/b1a9eb266710f30e0772764bcf37d7e9 to your computer and use it in GitHub Desktop.
Set the Module's reference text to Cmts.User layer if their reference value matches
import pcbnew
import re
board = pcbnew.GetBoard()
for item in board.GetModules():
if re.match('D\d+-\d+$',item.GetReference()) is None:
continue
print "found %s" % item.GetReference()
item.Reference().SetLayer(41)
pcbnew.Refresh()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment