Sheet Number Rename doesn't work after running batch duplicate sheets

Hi, I created 2 scripts with the aim to help designers batch duplicate multiple sheets and rename the prefix after duplication.

By the way, it would be really great if I can just do this in one script so there’d only be one step (please let me know if you have any ideas on how to do this). However as Bimorph only have one duplicate sheet node which has to include a prefix or suffix, then I didn’t have a choice but use it.

Okay, so here’s my real problem at the moment with what I have:

After running the first script Batch Duplicate Sheets and Views w Prefix, and using the second script Batch Replace Sheet Number Prefix, Revit gives me an error that there’s already an existing sheet with the same number when clearly, there isn’t any (shown in the video). But when I try it using the sheets that weren’t duplicated, it successfully renames them!

Please help. Here’s some snapshots of the script:

Step 1: Batch Duplicate Sheets w Prefix

Step 2: Batch Replace Sheet Number Prefix
I need to do this step since the outcome from step one creates double prefix.

Video using both scripts with the error:

Thanks guys!

One possibility is a re-sequencing issue:

You have a set of sheets numbered A, B, C. You want to renumber them, B, C, D.

If you use SetParameterByName you will see the “existing sheet” warning as the numbers are in use when the procedure begins: for example, when A is renumbered B you will see the warnings as B is still in use (sheet B hasn’t been renumbered yet), and so on, hence the problem with resequencing.

If that is the problem use BimorphNodes Sheet.RenumberRename which supports resequencing by circumventing the above limitation.

3 Likes

Hi,
Ive done some similar stuff that you are trying to do (my ex. Formwork plans into Reinforcement plans). But im using the Prefix/Suffix just to avoid duplicating Sheet numbers, because im replacing the whole name later in the graph. I am also renaming all the views and reseting all Sheet parameters.

I am attaching my graph, hope it helps
Duplicate Sheets_New.dyn (38.4 KB)

2 Likes

Hi @archjahzzy

You forgot to filter values that starts with in your batch replace sheet number prefix script:

4 Likes

Edit:

Actually, @Kulkul’s suggestion worked! I was just using a different directory in my Dynamo Player. :joy::sweat_smile: Thanks Kulkul!

Hi all, Thank you for the responses…
@Thomas_Mahon I was adding new prefix values so there were no duplications to the numbers…
ABC_101, ABC_102, ABC_103 gets replaced with BCD_101, BCD_102, BCD_103… but I think that they might also encounter the issue you’re talking about so I will still explore BimorphNodes Sheet.RenumberRename. Thank you!

@Jan_Secnik Thank you so much for this. However, I was having problems understanding the codes as I have zero knowledge about programming/coding/python/etc… I am starting to self-learn so maybe smeday I will understand…

@Kulkul Yes, it did work. However, the other one also worked…

Sooo. I realized that the error is not because of the script but somehow, but on whether I used Dynamo player or if I opened Dynamo and ran from there…

When using Dynamo player, the 2-step script doesn’t work. But when using Dynamo window, it works perfectly…

Not sure why this happens…

No problem :wink: