Grasshopper

algorithmic modeling for Rhino

Hello community,

I have a basic issue to solve out with my first c# code. I want my panel to print "Hello World" when the button is pushed, and "Goodbye World" when the button is not pushed as the A output.

I have no idea about c# scripting but I would like to start doing some coding now and start working things also with visual studio as i get more experience.

Thank you in advance for your interest. 

Views: 652

Attachments:

Replies to This Discussion

This is all you need:

private void RunScript(bool y, ref object A)
{
  if (y)
    A = "Hello World";
  else
    A = "Goodbye World";
}

the script component already defines a class around your method, so you don't have to define one yourself.

Thanks a lot David! Getting a good advice even in such a simple issue is very helpfull!

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