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.

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

hey you said these are out of the box nodes. how come i cant find them?

Would have helped to see the top left corner of your Dynamo window

These nodes are available in Dynamo for Revit

If you’re using Dynamo Sandbox, you wouldn’t have these nodes

if i dont have them, is there a way to obtain them through packages or something

If this is specifically an AutoCAD workflow can you start a new topic and post a link to this thread in there?
This thread was for Revit document locations. :+1:

AutoCAD Specific
Are these Document nodes not showing in the Library within Dynamo?

yes they are showing, thats perfect, thanks!!

1 Like