Grasshopper

algorithmic modeling for Rhino

Hi,

does anyone know if its possible to take an item (point coordinate) from a data tree and change it? All I can do is extract it (dispatch) and then change (move) it but can I re-insert it in the same position it was at before? (maybe into the dispatch B data in the right place)

- to draw a polyline between each set of points the points must be in the right order

I've attached a screetshot to show my data tree and highlighted the value I want to move.

thanks very much
tom

Views: 3455

Attachments:

Replies to This Discussion

I hate to see a question unanswered. And while this is by no mean a very good solution it works. Hopefully someone will swoop down and give us a better solution. As far as I know Grasshopper lacks a component to delete or replace individual items/branches in a tree. Knowing this you realize we’d have to:

1. Separate the branch you want to change
2. Change it with a vb/c# component (grasshopper also lacks a way to replace a single item in a list without custom code)
3. Cut the original branch from the tree
4. And finally add the changed branch with the old branch path back to the tree.

1,2 and 4 is easy enough while 3 proves a bit more tricky. Because you can’t delete a single branch from a tree, just remap its path; however if you have a static amount of branches this can easily be worked around with the BANG!(Explode Tree) component. Given an unknown number of branches and having only the branch path to go with - you’ll see an not so pretty work-around for it in the included file.
Attachments:
thanks! your help is much appreciated. but is there a way to get the path and index from the value I want to change (not manually) because it is sometimes a different point that will move? maybe from the dispatch pattern which selects which point will move?
thanks
tom
Well.. no? I don't think I fully understand. I mean, if you know what data you want to manuípulate you probably already know the path and index, lest is it very very hard to isolate it.

Sure you can extract the whole path structure with the Param Viewer component. But there is no way to extract the path and index from a point by, for an example, clicking on it. Could you post an example perhaps?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service