Sort in Dynamo exactly as in Revit

Hello,

I am trying to write in a Sheet parameter in Revit as a part of a bigger graph.
To do everything correctly, I need to get the sorting in Dynamo exactly like it works in Revit in Sheet List Schedule. For now I am not able to do that with the sorting nodes in Dynamo.
Although Revit says that it uses only the Sheet Number for sorting in the Schedule, and Dynamo also uses only SortByFunction - Sheet Number the results that I get from the two are different. How does that happen and what can I do about it?

Example graph.dyn (18.4 KB) Empty Revit file with a bunch of sheets.rvt (1.3 MB)

Thanks

maybe this? i think you are missing a wire

Thanks for the reply, but I don’t think that this is it.
I am using sort by function and that is my function - the graph works like it is, if I added the suggested wire it would not work.
Here, with wire, not working:

Without wire, working:

EDIT: To clarify: My problem is not that my graph is not working, but that it is not producing the expected result. There is maybe something different between the sorting mechanics of Revit and Dynamo, and I don’t know how to overcome it.

SortByKey is what you’re looking for. It’ll let you sort your sheet elements based on the sheet number keys.

I just tried it. Still I get the same result:

Please note how in Revit sheet A2.1 is just after sheet A1, but in Dynamo it gets sorted as the last element - at index 9.

Hey,

So I don’t believe Dynamo has access to the same sorting method that Revit uses (I may be wrong) so you are dependent on the nodes that are built in and the packages which people have made.

I think you’re always going to struggle when your numbering is so random…

Something to note is that the sheet number is actually a string, I suspect that if you split out the A, convert the rest to numbers and sort it might behave?

As you’re seeing the sort node you’re using is using all the 1s, then 10s, 11s etc down to 12. Once you remove the A, you can pad the sheet number so it has consistent numbers of digits (for sorting purposes) then sort? It should help?

Have a dig around for other sort nodes in different packages. I believe Orchid has one, perhaps other people have more suggestions…

Hope that helps,

Mark

1 Like

I believe that there is a natural sort node in the Orchid package that will help you here. Will take a few extra steps but it is doable.

1 Like

Thank you guys,

I will try using the Orchid package tomorrow and write to let you know what happened.

Hi @Julian_Paskalev @Nick_Boyts @Mark.Ackerley @Marcel_Rijsmus @jacob.small

You can sort exactly like Revit this way:

4 Likes

Great shout @Kulkul :smiley:

Isn’t this just a Revit Standards Management conversation to be had with your staff, instead of trying to do a solution-workaround in Dynamo.

These Sheet Numbers would be a no go anywhere near one of my projects.

Also, having better Browser Sorting here would probably let you split the Sheets up in groups and sort within Groups also solving the entire problem.