Rename PDF's Archi - Lab Traceback Error

Hello Everyone,

I have recently been trying to solve a PDF renaming task with Dynamo. Currently Revit is automatically generating a file name for hundreds of PDF’s we are printing. I have got my script to the point where I am passing the correct names to the archi-lab rename files node and it is acting a bit strange. Every time I run the script it renames only one of the pdf’s but does not format it with the correct name or the .pdf extension. It renames it with a Capital letter G. Can anyone spot my mistake? I am receiving a trace!back error stating the file already exists and that something is up with line 27 in the pythons script for the Rename Files node.

Thank you!

Hi @kloffredo,

You must edit the “Rename files” node if you want to use it with a list.
Right click on the “Rename Files” node and select Edit custom node.
Add =[] in the inputs “Identifiers” and “NewNames” and save the change.

Rename%20files

Hi @Alban_de_Chasteigner,

Thank you for the tip but it is still giving me the same error. I thought for sure that was it. Is there anything else that I should check?

Thank you!

1_You can try to copy the python script from the custom node inside your dynamo graph and replace the “Rename files” node with the python script.

2_If it doesn’t work, try with “Rename” node from Orchid package.

3_If it still doesn’t work, you have an error somewhere in your graph. (Your picture is illegible. Zoom on a node and export the workspace with the camera icon)

Hi @Alban_de_Chasteigner,

Very close, the Orchid rename node seems to be working better but It cannot find my existing file name. I have reduced the file path to just the file name and for my new name I reduced it more and inserted a date. I cant see where I could be going wrong here.

Error: Warning: File.Rename operation failed.
Could not find file ‘C:\Users\kloffredo\Desktop\PDFS\FRIEDMAN_CENTRAL_R17_LLucree - Sheet - G001 - CODE DATA.pdf\FRIEDMAN_CENTRAL_R17_LLucree - Sheet - G001 - CODE DATA.pdf’

Can you try to put a directory and not a string in the input directory (with Directory.FromPath node)
And maybe write .pdf in the input extension.

1 Like

So close! The items are being renamed but for some reason are keeping their original file names and just adding the date on to them. So frustrating but very exciting at the same time. The rename node is giving me this error, Warning: File.Rename expects argument type(s) (string, string, var, var), but was called with (System.IO.DirectoryInfo, string, string, string).

Please link your .dyn file if you want more help.
I can’t take time to recreate all your graph.

2 Likes

060418_Rename PDF’s.dyn (68.0 KB)

Thank you for your help!

The node from Orchid package works perfectly well.

060418_Rename PDF’s V2.dyn (39.4 KB)

1 Like

@Alban_de_Chasteigner Thank you so much for your help! It works perfectly now. Many thanks I owe you a beer.

@erfajo Thank you very much. The Orchid nodes worked like a charm!