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

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.