# reads the line count from a linefinder
lines=GetValue('R_Line.LineCount')
# creates list
i=1
values = []
while i <= lines:
values.append(GetValue('R_Line.Angle['+str(i)+']'))
i += 1
values.sort()
print ' R values - ',values
if i == 0:
Median = 0
if i == 1:
Median = values[0]
if i > 1:
Median = values[len(values)/2]
print 'R Median: ',Median
# set result to script value
SetValue('R_Angle.Value',Median) |