On the code below I keep getting the error message “Expected An Indented Block”. The code is supposed to create a list of points coorinates for points next to given ones for each loop. Its working one time, but im stuck on looping defined funcion.
IN is given coordinates list
IN is number of loops for the given list
import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * import sys sys.path.append("C:\Program Files (x86)\IronPython 2.7\Lib") import copy from copy import deepcopy a=IN b=IN def choose_point(a): x1 = deepcopy(a) x2 = deepcopy(a) y1 = deepcopy(a) y2 = deepcopy(a) z = deepcopy(a) for sub in x1: sub = sub + 1 for sub in x2: sub = sub -1 for sub in y1: sub = sub - 1 for sub in y2: sub = sub -1 for sub in z: sub = sub +1 final =[a,x1,x2,y1,y2,z] final_flat = sum(final, ) [list(i) for i in set(map(tuple, final_flat))] new_list = [x for x in final_flat if x not in a] while b > 0: choose_point(a) b = x-1 OUT = new_list
And here is my dynamo script: trying python.dyn (5.6 KB)
Thanks in advance, its my first python try in dynamo.