List Organization Queirry - Pile Mark & coordinates

Hi everyone

I have written a script for inputting pile coordinates into a Revit schedule. By and large i am quite happy with how it works. The only thing is, it would be nice to be able to organize the list in Dynamo by the Pile Mark e.g. P01, P02, P03 that when i might export to excel it is in order. This is because i am considering adding more to the elements to the list at a later date (obviously i can arrange by Mark once in the Revit schedule).

It may be worth noting i have tried SortIndexByValue, but it seems to be asking for a double, which i am not to sure how to rectify, (assuming that is the correct way to achieve this).

As always your expertise is greatly appreciated and i am very keen to see if anybody knows a way i can achieve this.

P.S. Will be happy to upload files if requested

Kind regards

get the P values and split “P” letter from the numbers
now you have a list od numbers,
convert them from string to number by using "ToNumber"node
finally, instead of using SortIndexByValue, use " SortByKey, use the same input you use, but the key will be the number list mentioned above


Thanks a lot. I will let you know how it goes when I’ve had a chance try

If all your pilecodes are Pxx there is no need to do the splitting. Dynamo will sort them in the correct order. Worth mentioning: sort the elements first, then extract the data. The data will respect the order of your sorted list. That is a lot easier that trying to sort multiple lists of data later by the order of a value in one of those list.


@Bjorn_Keulemans1 @khuzaimah.ElecEng
Thank you very much for your help on this. I only just got round to trying it but when i did it worked fine.
Thanks again