List with different spacings

Hi All

what I am trying to do;

  • Extract all the doors in a project (complete)
  • get the door widths (complete)
  • Insert them in a wall (complete)
  • The doors to be spaced 1000mm from opening to opening. (this is difficult)

I cant seem to find a way to space the door 1000mm apart?
I have tried using the Sequence.RangeDivison node with not luck. it does divide them but it break each space into another index.

I have also tried a code block as well and i get a similar result… does anyone have some ideas?

see math i am trying to do in dynamo (you can do this easily in excel but i want to do it in dynamo)

Door900+Spacing1000= 1900
1900+Door940+Spacing1000= 3840
3840+Door980+Spacing1000= 5820
5820+Door1020+Spacing1000= 7840

1 Like

sweet thanks Vikram

1 Like

@Batman86 Another possible way

count = 4;
spacing = 1000;
widths = 900..#count..40;
lst1 = Math.Sum(List.TakeItems(widths,1..count));
lst2 = lst1 + (spacing..#count..spacing);