List logic for selecting sheets and their titleblocks doesnt work for a project

Hello all,

I have set up a script to print multiple pdfs in one sitting but i have found an unusual error in the list structure.

The user can select sheets, and revit then finds all views on sheet and selects the titleblock. I did this with get item at index 0. This always worked until now…

I found a project where a sheet doesnt print, and this is happening because the titleblock isnt at index 0 as you can see below:

Now, an easy fix would be to add a node like "string starts with “A” and then just take whatever outputs from there as titleblock.

But i would like to know why suddenly after printer a lot of projects with this script, i run into a sheet that does not have the titleblock at index 0…

Any ideas?

Seems like the elements are sorted in the Dynamo list.
And the titleblock has a higher ID number so it got pushed down.

I’m not an expert in how Revit assigns the IDs. But if I was to take a guess, I would say someone deleted the titleblock and added it again OR moved it with Disjoin checked OR Revit assigned it an out of order number OR one of those 1000 other possible reasons.

All it matters is that you recognized the flaw in your logic and seem to also have a fix for it.

3 Likes

Thank you for your reply!

Your explanation makes sense and it’s good to know.
I changed my solution to just filter by category (titleblock) to make solve it for good.

Filtering with a “string starts with” node leaves open a future problem if a titleblock has a name that doesn’t start with “A”

1 Like