Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (25 sloc) 677 Bytes
import pcbnew
print "Input start number of ref"
st_ref = input('>>>')
board = pcbnew.GetBoard()
c = board.GetModules()
for x in c:
ref = x.GetReference()
#print "#Ref: ", ref
j = 0
for p in range(len(ref)):
if(ref[p].isalpha() != True):
#print "ref[p]: ", ref[p]
if(ref[p] == "*"):
break
else:
i = ref[0:p]
j = int(ref[p:])
break
if(j>0):
#print "i: ", i, ", j: ", j
#k = i + '{0:04d}'.format(j)
k = i + '{:d}'.format(j + st_ref)
print ref, "->", k
## remove next comment and run!
x.SetReference(k)