Hi there,
I’m experiencing some troubles with dictionaries in python (i read that in dynamo there are some limitations to work with them in python) but I’m not sending a dictionary into the OUTPUT, so I think there is no error here.
The issue is that I developed the code in an online interpreter (https://repl.it/MB3v/14), and I’m getting this result for AUX:
but if I take the same code into a python node, i get this:
This is the code:
lineas = []
lineas.append(['c' , 0 , 470 ,0])
lineas.append(['c' , 255 , 410 ,70])
lineas.append(['c' , 135 , 255 ,160])
lineas.append(['c' , 410 , 470 ,160])
lineas.append(['c' , 0 , 135 ,300])
# Lineas cargadas
# Diccionario con la cantidad de segmentos por z
segmentosPiso = {}
for x in range(0,len(lineas)):
segmentosPisoObjetoLocal = {}
if lineas[x][3] in segmentosPiso.keys():
segmentosPiso[lineas[x][3]] = segmentosPiso[lineas[x][3]] + 1
else:
segmentosPiso[lineas[x][3]] = 1
lineasCargadas = {}
contador = 0
iCoun = 0
AUX = []
for k,v in segmentosPiso.items():
lineasADibujar = []
if ((contador > 0) and (contador < len(segmentosPiso) - 1)):
# print (k,v)
ind = []
for lline in range(0,len(lineas)):
if (k == lineas[lline][3]):
ind.append(lline)
for c in ind:
lineasCargadas[iCoun] = (c)
iCoun +=1
# print(lineasCargadas)
for xline in range(1,len(lineas)):
bFlag = False
for xCar , xVal in lineasCargadas.items():
if((lineas[xline][1] == lineas[xVal][1]) and (lineas[xline][2] == lineas[xVal][2])):
bFlag = True
if bFlag == False:
lineasADibujar.append(xline)
AUX.append(lineasADibujar)
# print(lineasADibujar)
#bflag = False
contador += 1
I really don’t get where is the error or what am I missing here.
Thanks in advance!