Hi All,
In my example below I want to remove elements from lst2 to have (lst2 length) = (lst1 length)
so how to do that in python?
Thanks.
Hi All,
In my example below I want to remove elements from lst2 to have (lst2 length) = (lst1 length)
so how to do that in python?
Thanks.
Hello, here is a way
# Charger les bibliothèques DesignScript et Standard Python
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Les entrées effectuées dans ce noeud sont stockées sous forme de liste dans les variables IN.
lst_1=IN[0]
lst_2=IN[1]
new_lst_2=[]
# Placer votre code au-dessous de cette ligne
for i in range(0,len(lst_1)):
item=lst_2[i]
new_lst_2.append(item)
# Affectez la sortie Ă la variable OUT.
OUT = new_lst_2
edit : another possibility
# Charger les bibliothèques DesignScript et Standard Python
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Les entrées effectuées dans ce noeud sont stockées sous forme de liste dans les variables IN.
lst_1=IN[0]
lst_2=IN[1]
# Placer votre code au-dessous de cette ligne
new2_lst_2=lst_2[0:len(lst_1)]
# Affectez la sortie Ă la variable OUT.
OUT = new2_lst_2
cordially
christian.stan
Thanks @christian.stan it’s so easy !!
I am learning (personally) python with this site
more analysis of the scripts of Mr. _. _o_p_n and other members from here
Don’t be discouraged
when it comes to teasing the api I would buy a German book (Mr. Draxl talked about it) translated into English (recommended on this site)
cordially
christian.stan
What about List.Count and List.TakeItems?
@Daan
Can you give me an example?
Thanks.