Customizing Outputting Excel File's Name

Hello everyone!

I have this graph where it runs bunch of things and exporting them to an Excel sheet.
I have several Revit projects and wanted to name them accordingly.

So far my code saves the excel sheet with the revit project name. However I want to have the project number at the beginning since I would also like to archive them with project number included.

As you can see in the image below, I tried to come up with a detour solution for it but realized that it has to be hard coded in python.

I am still not too good with Python and wondering if there is any tip for processing, ‘find the parameter called project number, get that value and put it infront of the project title’ bit in code.

Thank you very much guys!

PS - Red lines are the project name.

Modify in line 22:

newFilePath = basePath + “\” + doc.ProjectInformation.Number + doc.Title + “.xlsx”

(Revit API to extract project number:
ProjectInformation Property)

Another option, you already got the project number in dynamo, add another IN[1] in python and concat in line 22 like the example I gave you changing doc.ProjectInformation.Number to IN[1]

2 Likes

Thank you very much!!! ah I didn’t know I had to put Number at the end.

1 Like