dynamo/fenetre.py

53 lines
993 B
Python
Raw Normal View History

2022-11-15 17:00:56 +00:00
# Charger les bibliothèques DesignScript et Standard Python
import sys
2022-11-15 18:03:29 +00:00
# import clr
2022-11-15 17:00:56 +00:00
import re
# clr.AddReference('ProtoGeometry')
# from Autodesk.DesignScript.Geometry import *
# dataEnteringNode = IN
Keylist = [
2022-11-15 18:03:29 +00:00
"rsv12",
"rsv13",
"rsv16",
"rsv19",
"rsv20",
"rsv21",
"rsv1",
2022-11-15 17:00:56 +00:00
] # dataEnteringNode[0]
CollittionList = [
["rsv13"],
["rsv12", "rsv16"],
2022-11-15 18:03:29 +00:00
["rsv13"],
["rsv20","rsv21","rsv1"],
2022-11-15 17:00:56 +00:00
["rsv19", "rsv1"],
["rsv19"],
["rsv19", "rsv20"],
] # dataEnteringNode[1]
OUT = []
2022-11-15 18:03:29 +00:00
def find_in_out(rsv, out):
for arr in OUT:
if rsv in arr:
return True
def recurCollition(index, OUTindex):
for i in CollittionList[index]:
if not find_in_out(i, OUT):
OUT[OUTindex].append(i)
recurCollition(Keylist.index(i), OUTindex)
for i in range(len(Keylist)):
if find_in_out(Keylist[i], OUT):
continue
OUT.append([Keylist[i]])
recurCollition(i, len(OUT) - 1)
print(OUT)