How to script 'BUTTON' on the component

script
unhandled

(Shimpei) #1

Hi,

I want to make some buttons just like Karamba component in C#.
Here attaches is Karamba component image that I want to make.

Does anyone know how to script it in C#?

Best,
Shimpei


(David Rutten) #2

You have to override the attributes of your component and do all the additional drawing/layout/mouse-handling there. It’s not easy, but there’s a small example in the Grasshopper SDK documentation (down via the GH Help menu).


(Shimpei) #3

Hello David,

Thank you for letting me know about attribute class!

In addition,How do I call a circle (dot) on the image?
I want to search it on SDK.

Best,
Shimpei


(David Rutten) #4

Graphics.FillEllipse()


(Shimpei) #5

Hi David,
I was able to modify attribute in my component.
However, I couldn’t understand MouseRespond class.
Only I understood is to show MassageBox.

I want to receive ‘true or false’ data from checkbox on the component and reflect it to SolveInstance.

Can you give me something example code ?

Here attached is my .gha file.
MyProject1.gha (11 KB)


Custom component with its own UX design
#6

I would LOVE to be able to define UI components inside a cluster and “export” them to the surface of the cluster. Then drag to re-arrange them…