generative modeling for Rhino
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. 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,
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.
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
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'.
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!
Yes, sorry. When I said "data tree" I meant "tree access".