generative modeling for Rhino
Tags:
Permalink Reply by Tijl Uijtenhaak on December 20, 2010 at 4:26am Giulio,
It has been a while, but back with questions again..
I've been trying to understand your script and adapt it in such a way that i can use it.
At the moment i seem to be able to change a few parameters, but other than lines, curves and circles have been difficult. No idea how to change a slider or move component yet. (is there any way to find their names or what code to use?)
All i try now is to change the length of a line and draw a circle at the end. Once the circle is drawn, i want to measure the radius and if this radius is not the previous radius length it should continue with the loop and add a line.
I'll add my grasshopper file and code.
Do you know how i can make this last step??
Thanks for your help!
Tijl
Permalink Reply by Giulio Piacentino on December 20, 2010 at 10:28am Hi Tijl,
I've added the code necessary to measure the line (it's pretty simple once you know where to look: in the RhinoCommon SDK, inside Rhino.Geometry - see here in this case) and modify the slider.
Basically, this script is using both the Grasshopper SDK and RhinoCommon, so the difficult part is in knowing what is in which SDK.
Did you know you can use help(obj), print(type(obj)) and print(dir(obj)) to inspect objects at runtime? If their type start with GH_, then it's sure they are exposed by Grasshopper.dll. They are mostry either UI elements or wrappers for RhinoCommon geometry. I've added a couple more suggestions in the script.
I hope it helps,
- Giulio
_______________
giulio@mcneel.com
McNeel Europe, Barcelona
Permalink Reply by Tijl Uijtenhaak on December 22, 2010 at 5:42am Hi Giulio,
thanks for the useful tips once again!
The only thing i'm still struggling with is that i can't find how to rebuild the solution after a slider change. if been going through the SDK file and the help(slider).
If i change the value of the slider in a loop, it doesn't show this in the grashopper file, or rhino output. Do you know how to acces the rebuildsolution button or a different way to solve this?
Thanks,
Tijl
Permalink Reply by Giulio Piacentino on December 22, 2010 at 6:15am Hi Tijl,
doc.NewSolution(True)will recompute everything (might be more expensive than just recomputing objects downstream).
- Giulio
_____________
giulio@mcneel.com
McNeel Europe, Barcelona
Added by Mgeorgio 0 Comments 0 Likes
Added by Mgeorgio 0 Comments 0 Likes
© 2013 Created by Scott Davidson.
Powered by