Grasshopper

algorithmic modeling for Rhino

Dear All,

 

I found and old post for this but this was posted when there were no data trees on GH.

 

Has anyone seen or has an example of how to implement data trees, or structures in general in a scripting component?

 

I've got a script that produces a list of objects and want to convert the list into rows and columns with paths similar to a data tree.

 

Many thanks in advance.

 

Evert

Views: 409

Replies to This Discussion

Hi Evert,

here there was a small example: http://www.grasshopper3d.com/forum/topics/c-question?commentId=2985...

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Hi Giulio,

Thanks for the link, I'll check it out tonight!

Cheers

Evert
Sure, in most cases you just need to know the type ( here DataTree<double> ) and then use the intellisense-like features or the SDK help file to discover methods and properties.

I hope it helps,

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Hi Giulio,

I finally had some time to look at the link you kindly posted and here are my results. Is this the way it should be done? I took GH hexagrid component to look at the paths and manage to renumber the indexes to be similar.

Would you or anyone else mind having a look at my definition?
Cheers
Evert
Attachments:
Hi Evert,

compliments, the script really works nicely!
This might be a start with the tree structure... it's actually easier in a completely programmed component.

Also, I had to switch U and V in the loop.

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Attachments:
Hi Giulio,

Thanks for looking at my script and making it better, It is now much clearer to me how to deal with paths and trees.

I'm now looking at given the centre points and frames at centres as output so I'll work based on your file.

Many thanks again.
Evert

BTW I had to open your file on texpad and copy/paste inside my component, it gives an error while trying to open your file.
Mh..., I dont know why about the errors: are you using Grasshopper 0.8.1?

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Hi Giulio, Yes I'm uisng 8.001.

I've added the centre points of the cells. Definition attached!

Is there a way to make the centre point function simpler or the whole thing simpler.

I mean if a function can return more than 1 value?

I'll start setting up this to create a component I hope you don't mind me keep asking 8)

Many thanks
Evert
Attachments:
To return more than one value, you could use the out parameter.
Not sure if it will make the function simpler.

http://msdn.microsoft.com/en-us/library/t3c3bfhx%28VS.80%29.aspx

- Giulio
_____________________
giulio@mcneel.com
McNeel Europe, Barcelona
Hi Giulio,

Your last message is indented too deep to reply. I had forgotten about the msdn site, I'll keep that in mind!
Many thanks for replying, I think I can use the out parameter to output surface frames at centres points and the centres perhaps.

I'll look into it.

Cheers.

Evert

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service