I am having trouble data matching two different scenarios.
I am trying to match point x values to x values of a surface, while this seems to work fine for one of my data sets, the other data set, which is almost identical, fails?
Can someone help me understand what I am doing wrong when data matching like this?
The core of my problem is probably because I am looking for items in branches like {5;1;0} and {1,1,2} and matching it up against a data path like {5} and {1}, but on one of the cases this works like a charm and on one it doesn’t.
It’s really important to me to keep the data structure.
Data Matching_Help.gh (50.2 KB)
Data Matching_Help_Solution.gh (60.5 KB)
Fixed it myself with some data workarounds, VERY MESSY, but it does work.
If anyone has another way of doing the same thing, more cleanly, please let me know.
You can also use Trim Tree with a depth of 2:
Data Matching_Help_Trim.gh (58.3 KB)
I need the branches of the tree that you trim with path mapper, therefor I can’t just trim the tree, sorry if I didn’t explain that well enough. @seltzdesign
If you check my own solution above, you can see the results that I am after.
Oh, I see. It’s kind of hard to tell what you are trying to achieve. What data are you after at the very end? What does it represent?
Without knowing that it is kind of hard to come up with a simpler solution.
In the end if it does what you want I don’t see anything wrong with the solution you have come up with. It looks fairly straight forward.
I’ve ran through a few different analysis using this method and it looks like it works every single time, so I will just run with that solution, thank you
Yeah, there is nothing wrong with that. I often build quite large scripts in Grasshopper and usually a sizeable portion is just managing data trees. If it works, it works. No need to optimize something just because it looks complicated. As long as you understand it, it’s fine.
Only thing I would do:
If you put something in a cluster, then turn it into a user object. If it is something you might need again (especially in the same script), then its good to save it and use the user object instead of the cluster. That way you can update it. It also forces you to really think about just putting one function into a cluster. Otherwise, don’t bother with Clusters, but instead use groups to name and label functions, so you still know what a certain section does when you come back to it.
Happy Grasshoppering!