generative modeling for Rhino
Hi,
I'm using the python component for grasshopper, and have wondered to access to the data structure which grasshopper consists.
using a=ghdoc seems to be efficient for output, but I can't get the right data structure as input.
anything will help.
I'm sure that I'm using the latest component(v0.4.1.1)
Hi Guilio.
Is there and overview of functions to call for the DataTree? Like here you mention .AddRange and .Add. Is there some documentation somewhere?
If there was a help dropdown list it would be great, but I don't get that.
Thanks Rasmus
Permalink Reply by Giulio Piacentino on October 16, 2012 at 4:09am You get dropdowns when you write a type. Check out signatures by using Python's type.method(self, [args])syntax for calls. Later you can change it to
self.method([args])
which is more object-oriented.
Also, here you can read about the way to download the Grasshopper SDK.
I hope this helps
Giulio
--
Giulio Piacentino
Piacentino Consulenze
Permalink Reply by Manuel Sotomayor Millan on January 16, 2013 at 1:53pm Could you upgrade that file Giulio??
I am quite struggling with the data trees in python but i cannot see your code here because the component is old and it appears empty
Permalink Reply by Giulio Piacentino on January 17, 2013 at 10:33am Hi Manuel!
Steve is the maintainer of the GhPython component now. You might want to let him know of this problem. I fixed the script for you, so it will work in Gh 0.9.14 and GhPython 0.5.1.0.
I hope this helps!
Giulio
--
Giulio Piacentino
Weaverbird development
Permalink Reply by Manuel Sotomayor Millan on January 17, 2013 at 10:50am Thanks.
Will try not to bother you then with this stuff.
Regards from Barcelona Giulio
Permalink Reply by Giulio Piacentino on January 17, 2013 at 11:16am Well now and then it's nice to help if I am able to.
Thanks for the greetings, I salute back! :)
Giulio
--
Giulio Piacentino
Weaverbird development
Permalink Reply by Giulio Piacentino on March 22, 2012 at 6:40am Hi Rasmus,
just as in the Vb.Net & C# components, you cannot return lists of lists. You need to create DataTree objects explicitly. This is how the Grasshopper SDK works and all scripting components must simply comply to this rule.
I'd suggest, if you can, to use list access or even item access if you can conceive a logic that can only require that. Also, I'd try to dissuade you from replicating the logic for tree components that are already available as this is a slightly hostile territory of the Grasshopper SDK: if you can, use the components that are already available.
Finally, from what I see, you can use item access and this code will suffice:
a = (Midpoint, Endpoint)
I will be on my way to the RhinoDay in Padua, so I might now be able to answer further questions till next week. An example using the internal iteration logic of Grasshopper is attached.
Thanks,
- Giulio
_______________
giulio@mcneel.com
Hi Giulio.
Thanks for answering me. It has been a while now, but I managed to work around the data tree because of your answer. Still thinks that it would be nice to be able to work with the tree structure though.
I can't seem to really use you definition, maybe it was created in earlier versions? :)
Im just curios to see what it is about now...
Cheers Rasmus
Permalink Reply by Giulio Piacentino on October 16, 2012 at 3:55am I've added an updated file. Also, have a look at these discussions:
http://www.grasshopper3d.com/forum/topics/datatree-in-python
http://www.grasshopper3d.com/forum/topics/retrieve-a-item-from-a-da...
Permalink Reply by Giulio Piacentino on October 16, 2012 at 3:54am For some months already I am no longer the maintainer of the GhPython project. I thought to lend a hand though, so, here is an update for the uploaded file to Gh 0.9 and GhPython 0.5.1. The component seems not to behave correctly now when trying to change the presentation style, so maybe a workaround for now is not to change it.
Added by Mgeorgio 0 Comments 0 Likes
Added by Mgeorgio 0 Comments 0 Likes
© 2013 Created by Scott Davidson.
Powered by