Get Sheet List, Filter it, Renumber it and Apply it

I’ve tried a few times, went away, searched the forum, come back and tried a few times more. Still no luck. Hoping someone point me in the the right direction please?

I’m trying to:

  1. Select all sheets from Revit
  2. Filter out certain sheets which contain “(5”, in preparation for applying a new number
  3. Renumber the filtered/reduced list by find/replace “11852”/“AECC”
  4. Pass th the new sheet number back to Revit where applicable

My dynamo workspace:

I have filtered & renamed the list successfully, as you can see from my workspace. However when I run script, the the wrong sheet elements get updated:

Resultant List
0 AECC(57)001
1 11852(62)001
2 11852(59)002

I think the problem is that my modified number list no longer matches the length of the original list of elements. How would you go about resolving this?

Hi @allandickson

You where almost there. You missed to filter elements.


Ah, so presumably the elements don’t get filtered along with the strings. Must try and drill that concept into my brain, for future.

Your solution was spot on by the way, Many thanks for taking the time to review and respond!