Rename batch of revit drawing names from excel

Hi, I have a large number of revit sheets that need to be renamed. I would like to export a list of all sheets to excel, add a new column with the new names, and import back into revit such that the new names will replace the old. Is this possible?
Thank you!

sure
get all sheets, then get Sheet name, export them to excel by the node, add and change what you want in column in excel but it is important to keep the same order

in another script, import them pack from excel, and get the desired sheet name list , and use setparametervaluebyname to set the new name

try to start with that and let see what you got

Thanks for your response. When you say to change what I want to in the column in excel, do you mean to actually change the existing drawing name? Is it possible to instead add the new name for each drawing in the next column and have this read back into revit similar to what a ā€˜lookupā€™ function would in excel? I feel this might be a bit safer in case the order changes.

you may add the new info in a new column, yes, just make sure to check its index in dynamo before set the parameter values

I would recommend having the Element GUID as a column for export. Thatā€™s the most sure fire way to make sure you get the right sheet. You can then use that to select the sheet you want rather than looping through them all and matching the name.

1 Like

Hey bradley how is your script looking so far?
If you do not have a completed script maybe i could take a look / finish it for you :slight_smile:

Daan, Iā€™m brand new to dynamo so am struggling to get started. Any assistance would be greatly appreciated!

Do you already have a start in Dynamo, if so, please upload your Dynamo file.
Else i will make something for you :slight_smile:

No, I havenā€™t started one yet.

All right i do not have a lot of time on my hands but i will try to create something for you

Hey man i have finished your script(s).

I have split them into two scripts, one for exporting all the sheet information, and another one for importing the new sheet information. Just open this script in the Dynamo Player and you will have an easy interface for your end users:
Part 1 looks like this and will export this Excel-File:

image

In this Excel-File you can add your new name in the corresponding Column, like this:
image
Now use Part 2 to import this data back to Revit and overwrite the old names.
image

Hope this solves your problem!
Part 1 - Export Sheet Names with Sheet Number as Reference.dyn (22.4 KB)
Part 2 - Import New Sheet Names from Excel.dyn (27.1 KB)

  • Daan

Hi Daan, youā€™re a champion - thank you very much! Iā€™ll have a play around with it, but just wondering if itā€™s possible to change the sheet number instead of name? Would this disrupt the reference?

1 Like

This script uses the sheet number as reference, so yes changing the sheet number will disrupt this script. But there is probably a simple solution to also change the number. Iā€™ll have a look at it.

This is how the Excel Looks like now:
image

This way we can still use the first column as reference, but also have the option to change the sheet number.
Also this script will work properly, even when you leave some ā€œNewā€ inputs empty. :slight_smile:

Part 1 - Export Sheet Numbers and Names 21-01-2020.dyn (26.7 KB)
Part 2 - Import New Sheet names and or Number from Excel 21-01-2020.dyn (33.3 KB)

  • Daan
1 Like

Hi Daan,
Thank you for the giant help with the scripts you wrote for Bradley. I found this forum and it helped me a lot too! Iā€™m trying to use the second part of your script, but Iā€™m having some problemsā€¦ Iā€™ll just point them below, as someone might have an input on how to solve or even for you to rebuild something if you want!

  • It seems like it doesnā€™t work when I leave the new sheet name blankā€¦ As I tested, I need to at least to repeat the old nameā€¦ maybe there should be a part of the script that returns from an analysis and fill it with the old name if thereā€™s no changeā€¦
  • If I leave only the number of the sheet blank, it doesnā€™t work either.
  • If I have a sheet number that is build in just numbers, it doesnā€™t workā€¦ it needs a letter input with numbers and sometimes we may need just numbers.

Well, Iā€™m not very experienced with Dynamo nor even have had much time lately, but Iā€™ll give a try to change this script when I can! :slight_smile:

And thank you again for the scripts you already build!

Hi @franbhupfer,

Glad to hear the script helped you :slight_smile:
And thanks for the feedback.

This version of the script is quite simple and prone to some errors, like the ones you pointed out.

These problems can probably be easily fixed by setting up some filters/ copying the old name. Also i think using the ID of the sheet (instead of the name) for reference is a better approach.

If i can find some time iā€™ll see if i can maybe update it a bit.