Grasshopper

algorithmic modeling for Rhino

Guys,
You have been a huge help thus far. I have attached the code for my custom component. My VB is still very rudimentary, so I am missing a lot of error checking. There may also be some redundancy in the coding. Nonetheless, the component works great, and does virtually everything that I need it to do.

The issue is that this project started a a simple GH study, and has evolved to necessitate the inclusion of a 'user friendly' windows forms interface. I have tested the capabilities of custom components, regarding accessing forms. Because I am still fairly new to VB scripting, there are issues that I don't fully understand.

Basically, all I need is a foundational direction, describing how to use a windows form to input data into a custom component. The form would be accessed in GH, similar to Galapagos. The input data is very simple(integers, doubles). I would like to user to have the option of inputing data with the form, as opposed to using sliders if they choose. This way, GH users are comfortable as well as those not so familiar with GH.

Any help would be greatly appreciated.

Views: 1066

Attachments:

Replies to This Discussion

Ok so I have designed the above form as a test, and created a class (Form1).  I followed the instructions on the link that you gave me and it seems to work with one issue.

 

The image below is the form that shows up.  Why does the form appear differently?

Attachments:

Hi Pierre,

some comments on the code so far (I'll upload an adjusted version later).

  • Don't use multiple words for the same thing. Sometimes you use 'depth' sometimes 'width' sometimes 'y'. Sometimes 'height' sometimes 'z'.
  • If you have a large amount of variables that clearly belong together, put them in a class to prevent functions with loads of arguments.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

See attached, it's basically just a find/replace of your code, and I may have botched it a bit.

I'd also separate the logic that populates the Tag list from the logic that computes a new stadium cross section, but I haven't done that.

Also, ultimately it would be nice if you'd create a custom Grasshopper datatype which contains all this data and provide 2~3 components for constructing it. That way your actual stadium components won't need a dozen or so inputs. But that is quite a lot of work so you may well elect to skip that step.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:
Thanks guys, I update the code with your suggestions. My understanding is still a bit murky when it comes to the windows stuff(see the reply above).

I am developing a windows form, and am a bit confused as to why the form displays differently when it is accessed from GH.

I think that once I finish this form this project will be complete.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service