algorithmic modeling for Rhino
Tags:
Hi there,
I am trying to intersect two sets of BReps, where the structure doesn´t match excactly and I can´t flaten the data tree.
Quite sure there is a good solution meanwhile, but I can´t really figure out how.
Its been late here... Could please someone post a smarter solution than mine.
Thanks,
Phillip
Hi Danny,
thanks. I knew, I can count on you.
So there is actually no better way than duplicating the data, I guess...
Weird , its so hard to just access the path.
Anyhow - Thanks,
Phillip
Hi,
me again. I found out that actually not solve all the issues with the definition posted.
So my problem now:
I want to access a specific branch again and now it doesn´t matter how many items there are in the branch, but how many sub branches there are.
So to speak: I´d like duplicate the data in the branch of List A depending on the amount of subbranches with the same structure in List B.
Almost the same question as yesterday. I know. Still looking for a broader solution though.
???
Thanks,
Phillip
I haven't tested this much but seems to work. It's probably not the best way of doing it though.
Create a VB component, set the x and y inputs as "data tree" and paste this code:
Dim dt As New datatree(Of Object)
For j As Integer = 0 To y.BranchCount - 1
For i As Integer = 0 To x.BranchCount - 1
If y.Path(j).IsAncestor(x.Path(i), 0) Then
dt.addrange(x.Branch(i).ToArray, y.Path(j))
Exit For
End If
Next
Next
a = dt
I think that is what my definition is doing.
The 'x' input is the shorter data tree and the 'y' input is the longer one. The script duplicates branches from the 'x' input so that it matches the data structure of 'y'.
Hi Vincente,
in the latest Gh ther is no hint datatree, so you need to set it to system object and change item access to tree access.
And see there it works! Great.Great.
Saved my day, thanks a lot!
Best,
Phillip
Yes, sorry. When I said "data tree" I meant "tree access".
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by