algorithmic modeling for Rhino
I am interested in rewriting the Quick Graph component so it could accept x and y-value inputs, that is, for example, a list of temperatures for the y-axis, while the x-axis would be the time of the day. I was wondering what type of libraries with C# do I need in order to do this? I have never really dabbled with graphics before, so most help would be appreciated. Thank you.
Tags:
Hi Jacky,
Grasshopper uses GDI+ to draw everything on the canvas. If you want to draw custom geometry on the canvas (like QuickGraph) then you need to import the System.Drawing namespace. If you want to draw inside Rhino viewports, then you only need a RhinoCommon.dll reference
Important things to know about GDI+:
--
David Rutten
david@mcneel.com
What you do is create custom attributes for your parameter/component. Attributes are responsible for drawing the object on the canvas and for handling all the mouse-events. If you do not create custom attributes then your object will be given default attributes.
There's an example of overriding attributes in the SDK documentation, you can start there. Do note that overriding attributes for a component is much, much harder than overriding them for a parameter. But a parameter can only have a single input and output, so that may not be an option.
Examples of components that have custom attributes in Grasshopper are Gradient and Legend.
--
David Rutten
david@mcneel.com
My IDE is screaming at me for this: http://puu.sh/5o1Li/979ee3dbdb.png
Your IDE is trying to tell you something ;-). Try replacing the fourth parameter with "GH_ParamAccess.item".
Go through the errors, one by one, and really read them.
I will give you one hint though, when calling "DA.GetData", try working with non-grasshopper types (i.e. bool, not GH_Boolean).
p.s. For more up to date help developing a custom component, try searching for "Simple Component (C#)" in the "Examples" section of the SDK.
Run the "GrasshopperGetSDKDocumentation" command in Rhino.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by