Documents.SaveAs Question

Hello everyone,

I’m trying to use Document.SaveAs node but it seems like I’m having a trouble with File Path.
I thought filePath wants a location where the file wants to get saved and i tried different ways but no good. Any tips would be greatly appreciated.

Filepath should at the very end have the .rvt filetype suffix

When using the File Path node you have to select an actual file not just a folder location.

Edit: There is a file path property that you could maybe use to get current document file path

https://www.revitapidocs.com/2021.1/23339d72-1c7c-0cc2-ee44-67cde7150eeb.htm

thank you for the response.

So what I want to achieve here is set up a folder path where Dynamo can save the file at. I thought that’s what this node is doing since SAVE AS is a function where a user can save the copy of the file in a DIFFERENT location.

So i’m curious why I have to put rvt at the end where it sounds like its going to override the original file?

sorry if im not understanding correctly.


hmm i even tried your way but still getting an error. I’m not sure why this node is extremely specific when it sounds very straight forward.

Hi,

Please note the difference between the Dynamo document and the API document (without wrapper).
Unfortunately it’s not possible to use Dynamo documents with custom nodes so use another node to obtain the current document.
doc

1 Like

thank you @Alban_de_Chasteigner

I guess I couldn’t decipher the difference between the two. So I tried to save my current Revit Project @ new location (Directory Path) but its throwing an error. I thought this is how this node works but I guess I’m completely misunderstanding something. Could you please share any tips on how to use this? or which node should I use for ‘SAVING AS’ function.

You can probably use the Document SaveAs node in Genius Loci package instead.

1 Like

Directory path will not work on it’s own as mentioned previously by @simon_murphy1 .

Feed in an actual file path with a full filename and .rvt extension and the node will work.


To reiterate why the directory node does not work, if you were to point your Revit file open menu to your desktop and say “open revit file” without selecting a file, what would you expect revit to do? Well, it is going to do nothing because you did not select a file.

4 Likes

@Alban_de_Chasteigner thank you for the suggestion!

The node is really nice and it works for the central file!
However I’m trying to save a detached copy and it seems like the node does not read a detached copy.

so the process i took was. I opened a Revit project with detached copy and ran my script.

‘SAVE AS’ is Document SaveAs node from Genius Loci and it’s value comes out to be ‘true’ when I run with non-detached file but detached file will throw false.

Please let me know if you have any question

Thanks!

Hi,

It is working fine for me with a detached file (etransmit) :


Or with a detached central open with Revit UI :

Be sure to create a valid filepath.

3 Likes

@Alban_de_Chasteigner thank you very much i guess i forgot to put ‘true’ value for saveAsCentral and isWorkShared.

Quick question - I tried something with BIM 360 files and it seems to not read - which I kinda assumed since the file location of the BIM360 works differently.

Would Document SaveAs node also accept BIM 360 files?

Thank you very very much!

No, because BIM 360 files use another method (SaveAsCloudModel) and you need to get a cloud model path rather than a filepath.

2 Likes

Thank you very much!