Python Access Existing Path Level

I have an existing Data Structure which has two level of Branch Path {;}


Now, I would like to iterate over all the branches that fall under the same Value of ‘A’ in Path Order {A;B}
Any Suggestions!

First suggestion: post a file
Second: you could split your tree into path 0 and 1, not sure if this is what you want.

What do you need to do with it?

Hi Gijs,
here is the ScriptPython Access Path_Level.gh (160.6 KB)
And here is a description to what i want to do

sorry I still don’t quite get it. I have the feeling that what you need shouldn’t require a python script. I’m not that advanced with ghpython either when it comes to tree access. Highly confusing.

No Worries Gijs,
I found out the way to access the Value I was looking for.
Here is the Snippet if anyone else would be interested:

uniqueID =

for i in range(BoxNames.BranchCount):
branch = BoxNames.Branch(i)
pathLength = BoxNames.Path(i).Length
pathFirstID = BoxNames.Path(i)[0]
uniqueID.append(pathFirstID)
print uniqueID
SheetID = set(uniqueID)

The Outcome will look something like this:
[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4]

0
1
2
3
4