'If" Expression - repeat data

Objective: (simple and stupid)

 

Enter a list of programmatic square footage requirements, make cubes of the area for each program, and stack them vertically within the boundaries of a tower. Simple.

 

Problem:

 

Most program requirements fit easily on one floor, however areas too large for one floor need to be divided and stacked into multiple floors. I used a simple "IF" statement in a function to test for programs that are too large for one level, then assigned them the maximum square footage of one floor and used a "repeat data" to create a list that repeats this area until it equals the number of levels required to meet the program. The problem is that I can't find an easy way to get the data to repeat within the same list. Currently my only strategy is to dispatch lists and somehow insert a sub-list where the occurrences are.

 

Question: Can I write an expression that will repeat data at certain points and insert these new numbers within the output list? See pictures, that was probably worded confusingly.

 

The expression for the function is:  If(x>45*45, x=45*45, x)

  • up

    David Rutten

    Hi Jon,

     

    I added a Stack Data component for the next release. It's similar to Duplicate Data, except it allows you to specify per item how many times it should be duplicated:

     

     

    You think this will be useful? If so, I can write you a VB script that does the same to tide you over until 0.8.0051 goes out.

     

    --

    David Rutten

    david@mcneel.com

    Poprad, Slovakia

    3
    • up

      Mariana Schetini Basso

      Hi people! My question is a little similar to the first question. If I have a list with zeros, I want to replace this zeros with the last non zero number in the list. I uploaded a simple example here

      Thanks in advance!!!