Hello everyone,
I have a small concern about making a Python node.
I am new to programming, but only python can solve my problem.
I created a python script, which compiles on web compilers (eg Pythontutor) but which no longer works on Dynamo …
All he returns to me is “an empty list” …
Is there a specification on compiling the code or an error in the code (maybe pointers)?
Code below:
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
BDD = [['EG_INT','A',15,20,25,32,40,50,65,80,100,125,150,200,250,300],['EG_INT','B',25,25,20,20,20,20,30,30,30,30,30,35,35,35], ['EC_INT','A',15,20,25,32,40,50,65,80,100,125,150,200,250,300],['EC_INT','B',25,25,20,20,20,20,30,30,30,30,30,35,35,35]]
SYST_ELEMENT = ['EG_INT','EC_INT','EG_INT','EC_INT']
DIM_ELEMENT = [150,125,150,100]
#Size of the database
DIM_BDD_L=len(BDD[0])
DIM_BDD_H=len(BDD)
#Size of SYS_ELEMENT
NB_ELE_SYST_ELEMENT=len(SYST_ELEMENT[0])
#Size of DIM_ELEMENT
NB_DIM_ELE=len(DIM_ELEMENT)
#Result list
RESULTAT=[]
for l in range(0,NB_DIM_ELE):
for j in range(0,DIM_BDD_H):
#Check the string
if(SYST_ELEMENT[l]==BDD[j][0]):
for k in range(2,DIM_BDD_L):
#check for the presence of the key in the first indexed list
if(BDD[j][k]==DIM_ELEMENT[l]):
RESULTAT.append(BDD[j+1][k])
break
Capture below :
Thank you !
A French guy