Grasshopper

algorithmic modeling for Rhino

How to use GH as a generator? (.gh is called by an console application(c#) )

Hello,everybody!

Thank you for coming to help me. 

I want to use GH as a generator. All my process is following:

(a loop)

GH generates geometric information--->analysis software analyzes---->the optimization results in A.txt----->GH take the parameters in A.txt--->GH generates geometric information again.

The only step, which I still cannot pass, is the final one. I have a look at the SDK note, but I find the content in that is mainly about how to making a component.

The following fig is .bat to run Rhino ,call grasshopper and open .gh file. What I want to achieve is creating a loop(open .gh--> close .gh), so that I could generate geometric information once and once again.

I am a fresh in GH. If u know how to do, please tell me. I would be very grateful.

Views: 446

Replies to This Discussion

could this be achieved by GHA?

Hi,does anyone have some advice? ^_^

It can be achieved I'm sure, although shutting down and restarting GH between every two iterations seems pretty wasteful. You cannot control GH remotely, you'd need either a GHA plugin that you can access from a console or you need to run RhinoScript files.

Galapagos sort of does what you describe already, except it might not change the inputs in ways you like. Basically it's a very naive stochastic approach. Do you have a list of slider values/other inputs that you want to iterate over ahead of time, or does the result of the evaluation steer the way geometry is generated at every step?

Hello David,

Thank u so much for your reply. For your question, I use a c# program(an independent program) to achieve a genetic algorithm for constrainted optimization. The genes would be given in the .txt by the c# program.

What I hope is that once the new genes is given in .txt, the grasshopper logic could run again. I know there might be some problems if I use panel to input parameters. But I  think it would not be a big problem.  In that way, I could generate new geometric information for my analysis software. 

I remember there is a "Run_Grasshopper()" static method in the namespace"Grasshopper.Plugin". However, I failed to call it. It seemed not so easy like I  thought.

Sincerely,

Lucas

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