Grasshopper

algorithmic modeling for Rhino

Hi David,

As you mentioned in several previous posts and in the SDK, we need to override several attributes in order to create custom layouts for new components by using CreateAttributes.

I would have several questions concerning this topic:

  •  Is there any utility that allows to convert drawings into code?

For the moment I try to use examples given in the SDK such as

Bounds = new RectangleF(Pivot, new SizeF(width, height));
textRectangle.Height = 20;
textRectangle.Inflate(-5, 0);

etc...


But is there any possibility to generate this code through some kind of form utility?

  • The SDK example is a parameter, would it be possible to add a component example in the next release? (I can't find how to display inputs and output grips for example).
  • Is there any chance to have a specific and extensive documentation on layout creation in the future?

 

Thank you, 

Thibault.

Views: 881

Replies to This Discussion

There is no utility as far as I know that can convert a drawing into GDI+ code.

I can add an example on how to modify component attributes, but it's quite complicated so it will be a lot of work (i.e. I can't do it overnight).

If there are topics that ought to be in the docs but aren't, I'll do my best to add them over time.

There are very few objects in Grasshopper that are derived from GH_Component and which override the display. It was very difficult in 0.8.0066 to make it work. I wrote a few utility functions for it which will be available in 0.9 (if everything goes fine released later today). I attached the code for Gradient Attributes (minus all the mouse event handlers). Maybe it will help out a little bit.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

Thank you for the code David, it really helps!

What I am trying to achieve in order to experiment layout edition is something very similar to the gradient component, but instead to have this color gradient window, I would like to display a list of strings, with one on these strings highlighted (a ListBox without mouse events in other words). 

I will try to find some GDI+ manuals to do it.

Thank you.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service