Grasshopper

algorithmic modeling for Rhino

If you have a list of lines as an input to a C# component, and you want to output them one at a time starting at the top of the list, how can you iterate through them to only show just one line at a time (iteration) on the output?

I have written a C# component that is set up to show the result right after each iteration (I assign the result to output variable A right after each iteration), but it only shows the final result (the last line) on the output of the component. It doesn't update the output through each iteration. 

How can I fix this?

Thanks,

Vern

Views: 1167

Replies to This Discussion

Hello,

You can either set a an integer input as an iteration counter(so by moving the slider connected to it) you will get the appropriate line for each iteration), or you can make your script time defined so the solution updates at each iteration.. 

Best,

M.

A VB.net equivalent time defined

Hope it helps.

M

Attachments:

Hi Mario,

  That works pretty much how I wanted. Thanks!!

Is there anyway to use a timer within the component to do the same thing?

Regards,

Vern

No prob,

You mean without having the timer component connected to the script..,

I suppose it is, however David has introduced a timer for this cause so I think its better to stick with this for now.

Greets,

M.

See the attached file.

Check also Giulio Piacentino's TheEngine component for (I guess) a properly coded version of something very similar.

Attachments:
Hi Vicente,
This is exactly what I was looking for. I was wondering if I needed to use those classes. Thanks a ton!

Regards,
Vern
Thanks for the input guys!

Vern

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service