Dynamo Pilescript not working as intended

Hi Everyone,
I’ve been tinkering with writing a script to number piles by their host elements and by pilecaps. I’ve finally been able to make a draft which doesn’t include weird workarounds to determine all the crucial values I need to do the sorting of my elements. Though I did want to keep the option to write all my data to excel in order to resort elements by hand if necessary.

I managed to keep it fairly simple in my opinion, but for some reason the script doesn’t always detect all host elements, and I don’t know why…

A little help is would be very welcome.

[1] Script_Pilenumbering 13_03_18.dyn (75.0 KB)

can you post some screen captures of the piles it misses? any other errors?


I have made this test file with a lot of different combinations. One of the main problems seems to be that the getHost node isn’t getting the hosts from the pilecaps consistently.

I had another test file in which it worked perfectly, but if the script doesn’t work consistently it won’t be reliable enough…

I managed the scale down the file size of my original test file (the one which worked pretty much perfectly apart from a few sorting sequence settings I might want to adjust). Maybe this could be helpful?

Test_piles_v1.rvt (3.0 MB)


I inspected my faulty test file some more, the script actually does detect all piles correctly, including all pilecaps. One of the problems lie with the fact that it can’t detect the pilecap host elements (piles without caps directly connected to the host object are get detected as intended). However, this shouldn’t interfere with the rest of the script until it gets to the sorting lists part.

There it should detect a problem in the final sorting section because of all the null values under the host related indexes.
Another problem is that the first List.SortListsOfLists node already return Null values even though the lists they use are all related to the piles themselves and they are completely filled in, so they shouldn’t have any problems processing the data.

You also asked for any warnings, the “FamilyInstance.GetHost” node not retrieving any data gives me
“Warning: Internal error, please report: Dereferencing a non-pointer.”
I get the same error if I try to get the element Id from the FamilyInstance.SuperComponent node

I think my problems related to the List.SortListsOfLists are because the List.Transpose isn’t working. It returns a warning, but it just says List.Transpose operations failed