It does exactly what you’re telling it to do i.e. it checks if the space left after the view is > 0. But that space might still not be enough to place a view there. That’s why you’re getting the negative value on the next round:
Thanks for the quick reply. It’s an answer for the 1/3
Let me try to explain my other questions:
1)The outcomming lists are now created per item from the “width” list (see 571-145-145-145) to 0. Is it also possible to create lists that run through the “width” list, so 0 = <571-145 -205-85-86.
2)It would be great if a new list was made after which “sheet” is reset to the starting value and the items in “width” continue. So the 2nd list = values 571-115-65-115.
Tried unsuccessfully translating this into design script but this works in Python:
sheet = IN[0]
widths = IN[1]
bodem = IN[2]
output = []
t = []
c = sheet
tot = len(widths)-1
for i, w in enumerate(widths):
c -= w
if c >= bodem:
t.append(c)
else:
output.append(t)
c = sheet - w
t = [c]
if i == tot:
output.append(t)
OUT = output
Thanks for the link, I understand the command but I don’t get the error with this command on list and float. The script works perfect when I enter just a number in a code block en put this in IN[0].
Super Victor! I gues I get the point. In the formula we couldn’t use a list on “c=sheet”.
I thought it was tackled at the input on line 7.
In dynamo I used to deconstruct node before IN[0], nice to see how to fix it python.