New list when data updates

So I have data that is being streamed to grasshopper, it updates the data automatically every few minutes.
Instead of having the new data overwrite everything, is it possible to have the new data stored in a new list/branch, and have a max of 8 branches, which warps and overwrites the 1 branch when it goes over.

For example:
A is the component that recieves new data
B is the component that stores data
first time A gets new data, B stores it in a new list [0]
second time, B stores it in [1]
and so on, when it’s the eighth time, it’s stored in [7]
but when it’s the ninth time, instead of [8], it overwrites [0] and so on

If you can can write some custom script in GhPython, look up scriptcontext.sticky

This might not be exactly what you need, but should get you there if I understood the problem:

180922_RotatingDataTree_GHPython_00.gh (6.5 KB)

It basically records the input Data parameter into the first branch of a DataTree, while also rotating the branches each time it records.

1 Like