Hello.
I wrote some python code, works well but at the end of it append() method dosent work. I didn’t know why so I tried same code inside python IDLE and its works fine. Any Ideas? Thanks in advance. Revit 2022 Python 3
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import copy
import random
from copy import deepcopy
a = IN[0]
def find(a):
x1 = deepcopy(a)
y1 = deepcopy(a)
z1 = deepcopy(a)
x2 = deepcopy(a)
y2 = deepcopy(a)
for sub in x1:
sub[0] = sub[0] + 1
for sub in x2:
sub[0] = sub[0] - 1
for sub in y1:
sub[1] = sub[1] + 1
for sub in y2:
sub[1] = sub[1] - 1
for sub in z1:
sub[2] = sub[2] +1
final =[a,x1,x2,y1,y2,z1]
final2 = sum(final, [])
[list(i) for i in set(map(tuple, final2))]
my_list = ([x for x in final2 if x not in a])
selected = random.choice(my_list)
return selected
OUT = a.append(find(a))