Match tree structures by adding nulls

Hi,
What is the best way to match “Tree A” to structure of “Tree B” by adding nulls? I would like to get the effect you can see on the “Tree C”.

Hi @SuperStructure

Welcome to the Forum! You can try to do this:

Anyway, lot of options to do that!

Regards

Add_Tree.gh (15.2 KB)

Thanks for your reply! I was rather thinking about GH component or add-on component :wink:

Here is a Python option:

for i in range(y.BranchCount):
    if not x.PathExists(y.Path(i)):
        x.Add(None,y.Path(i))

a = x


MatchTree.gh (12.3 KB)

6 Likes

@SuperStructure

You can make a cluster with all the components! That’s another option.

Regards!

Sure, we can, but imo one Python/C# component is more elegant solution :smiley:

Here’s another example.


MatchTreeStructure_re.gh (12.3 KB)

1 Like