So I have a tree with points, some entries are null.
Inside GH you can use the clean tree component to cull all null items. How to do it in visual studio?
I’ve tried removing all null items like so
for (int k = 0; k < cleanedIntersects.get_Branch(pth).Count; k++)
if (cleanedIntersects.get_DataItem(pth,k) == null)
and it seems to work for the most part. however, when I try to remove all branches that are empty, it doesn’t work because tree.Branch(pth).Count doesn’t return 0 (even though the branch is empty!).
image shows original tree > cleaned tree (code doesn’t remove all nulls from last branch, weird!) > branch.Count output
So, my question is basically how to recreate the function of the cleanTree Component? Couldn’t find anything on the web.