How to get directory path of the current Revit file

dynamo
#1

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?

0 Likes

#2

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

0 Likes

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

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.

0 Likes

#4

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

1 Like

#5

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.

Cheers,

0 Likes

#6

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

2 Likes

#7

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

#8

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

0 Likes

#9

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

1 Like

#10

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!

0 Likes

#11

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

1 Like