algorithmic modeling for Rhino
Hello there,
I am trying to split a brep, take one splitted part, transform it. Then, collect the transfromed part in a list and apply same rules to collected breps as splitting, transforming and collecting. So, I have written a piece of c# code in Grasshopper which I thought it might work, but it gives me the error saying "the collection has been changed".
Is there anyone who might know where is the problem? I have attached the Rhino and grasshopper files.
Thanks in advance,
Irem
Tags:
When you use a foreach loop to iterate over all the items in a collection, you are not allowed to modify that collection within the loop.
If you want to operate on a collection of objects and each iteration may append more objects to that collection, I recommend creating a Queue<T>, and popping items off the top from within an infinite do loop. Exit the loop once the queue is empty.
Anyway ... added this %$@%$ Method as an option for the brave (but why it fails? who knows? and who cares?).
Thank you for replies :) I have solved it with a function just returnes the splitted brep output to be used as input in a while loop. And the rest I arranged with array lists.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by