about 2 years ago by muecke_me
Hi, thank yout for your tutorial. It finally helped me to understand the idea behind Elefront and I could solve quite a few problems with it. But now I am facing an new problem. I want to use Elefront inside an Anemone loop. What I want to do is: - Creating a set of geometry with attributes and then bake them (classic Elefront way). - First loop: Reference geometry by bake name. Then add or remove certain geometry in this list and bake geometry with the same name. Inside the loop I actually only use the counter from Anemone to modify my list of geometry. The D0 in- and output is acutally not really in use. - Second loop: Reference geometry from first loop and again add or remove certain geometry and bake geometry and so on... To make this possible I have to refresh the reference by bake name component inside the loop all the time. Therefore I connected a timer to it. Furthermore I connected a permanent True button to the bake component. I thought this way could work but somehow it doesn't. Depending on the calulation time inside the loop and the timer rate refreshing the reference by bake name component it sometimes fails. Sometimes it references the double amount of objects that actually exist... Do you know a proper way to handle this problem? I discovered that the reference by bake name component has a context menue where you find an option caled update component. I thought that this might solve my problem with the timer to make the timer superfluous but I cannot click on that option and I dont know if it is a bug or if I do something wrong. I use version Elefront 430. I would be very thankful if you could give me a hint how to deal with that issue. Kind regards, Michael
Arie Willem de Jongh almost 2 years ago
I tried to create a quick script using anemone and elefront. It starts with a set of geometry and every loop it takes a subset of that geometry, transforms and adjusts them, and then bakes them, replacing the previous set.
Let me know if this was more or less what you're looking for. If not let me know,
Cheers!
Grasshopper file: https://mega.nz/file/xQcggZSS#TpxyvDtypg8iwl5wblOjhaYZscNHgdeeXlS_sSDaA98
Arie Willem de Jongh almost 2 years ago
Hi Muecke,
For-loops in Grasshopper are a bit tricky as the flow in Grasshopper typically is linear, from left to right. In other words for-loops are a no-no. Anemone solved this and simple stuff can be done. However, baking stuff (and overwriting previous geometry) and referencing them again in the next iteration etc. is very hard. Because of the inherently linear way Grasshopper deals with data flow. If you reference geometry and then do something with it bake it and overwrite the previous geometry you referenced, Grasshopper usually crashes or trows an error.
It can be done, but I believe you have to resort to good-ol fashion scripting. Rhinoscript, C# VBnet or Python.
Write a simple for loop in Python and do your operations there.
My main question is, do you need Anemone/a for-loop to do the things you want to do? Can't you select the geometry you want to you modify, do the modification to them, and bake them? Or could you elaborate a bit further as why you require a for-loop?
Thanks and cheers,
Arie