How to get directory path of the current Revit file


Hi all,

I am struggling to get the directory path of my Revit file to which Dynamo is linked in order to export my 3D view to NWC in the same directory (the path will change for every Revit file). See capture below. I know there was a Get current revit file path from clockworks but I can not find it for some reason. Any ideas?



You can use OOTB nodes for getting the current documents directory.


Create a copy of a Excel file in the director of the Revit file

Hi Ewan,

For some reason the Document File Path shows me just the filename and the format while the file path directory does not give me anything as you can see below. Apologies for my nativity I just started using Dynamo.



Because you haven’t saved it yet, I think.

1 Like


Thanks for the reply @SeanP, I tried saving the dynamo file, and restarting dynamo but I am still getting the same.Work under progress.dyn (8.4 KB).

I have attached the file just in case anyone has a second to look at it.




I meant the Revit model. I see it is a detached copy. Have you saved it?



It worked after I have saved the detached file as you said. Thanks a lot ! Can the string from it be used as a directory path (In the export to nwc node) or does it have to go through something else before ? (For some reason it doesn’t work when I plug it in instead of that manual directory path node I was using previously Last question I promise ! :slight_smile:

1 Like


Try the Directory.FromPath node, and it should work.



Thanks Sean, it works like a charm ! Have a nice evening.

1 Like


I was trying to follow the above to get the File Path, but get an error trying to tell Document.FilePath the Current Document. Any suggestions? Thank you in advance!



Try to the OOTB node Document.Current you are using the Node from Orchid Package
And what is the warning?

1 Like