Grasshopper

algorithmic modeling for Rhino

Hi All,

I have a few Breps as inputs. X has list access and type hint is Brep. I want to output one Brep at a time so that I can feed each building for some analysis. 

I have tried using time.sleep. I have also tried outputting a list everytime instead of a Brep.

Hope this is something very easy to implement.

Thank you,

-Devang

Views: 268

Reply to This

Replies to This Discussion

Hello,

just some ideas, because nobody else replied.

I'm not so deep into Python to give an example in it without putting much effort in it,

but in C# I could.

You basically need to start a new Timer, which if equal to Dot.Net , should be in another thread. (You could also use the dot.net timer, but doing this in python seems complicated in my opinion)

Whenever the timer reaches 0, a method is invoked in the current gh thread, to do something.

By simply using a threadsleep you stop the whole grasshopper instance, which doesn't work at all.

Another approach. Create a simple component, attach a timer component to it. The only thing you need to is to iterate outside by using a field in the current scriptInstance, rather than a local variable. Not sure how this works in Python but I could provide an example in c# if that helps?

 

Attachments:

Hi Tom,

Thank you for responding. I have primitive knowledge of C#. Can you please share the GH file?

Thanks,

-Devang

ups sorry, wrong file :/No access to the computer on which I made it, but you could simply rewrite it from the screenshot.You only need to attach an timer and set the input of the c# component to list access and type to object.rename it to "objects" and plug in your breps or other geom. 

You might also want to have a look at the GHPython example I posted here. Seems relevant to what you're trying to do. Cheerio..

RSS

About

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2017   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service