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.

5 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.

3 Likes

Thank you very much!

Are there any nodes that utilize saveascloudmodel, or is this something that one would need to write in Python for the time being?

Is there any Dynamo node that contain SaveAsCloudModel ?

This is the API call to save as a cloud model: SaveAsCloudModel Method (Guid, Guid, String, String)

Note that each of hte first 3 inputs are strings in a GUID format, and the Revit API documentation directly indicates that you’ll need to use the Forge data management API (part of the Autodesk Platform Services tools). This means you need an APS cloud tool to get the inputs needed to call the tool. This means you now have two options:

  • Build an APS app to get that input data so you can build another tool to save a model as a cloud model
  • Build an APS app to save the model as a cloud model

Note that the first bullet also requires putting the application GUID into a public facing setup, and that needs to be added to each project to be called. So you’re doing a lot of stuff to access the data in Dynamo, while a stand alone APS app has less headaches for setup and less moving parts to deal with.

And so everyone I know who does this (there are a lot), utilizes a stand alone APS app not a dynamo integrated APS app.

1 Like

Thank Jacob for your answer. But as i see, it is not a simple thing to do for a bigenner in coding like me. I just can put few line in python with the dynamo script, but create an APS and use Forge, it is a big job :smile:

1 Like

Hello @jacob.small
Sorry if i ask more and more.
I try it with APS, but it is complicted here because a lot of resctriction with our IT teams, each time i must have permission to run some package, and it is not fun :slightly_smiling_face:
I just wanna ask, about thz first methode u tell me :

  • Build an APS app to get that input data so you can build another tool to save a model as a cloud model
    I build the APS, that do nothing, i just need the client and the secret code ? and i can put them in a node in dynamo ?

Hi @Hamdi_Ben_Romdhane ,

No, you need to retrieve the projectId by using the APS platform:
GET accounts/:account_id/projects | Autodesk Construction Cloud APIs | Autodesk Platform Services

You need to create a token for that.
@SeanP made a nice tutorial for that how to connect to the APS.

Connect to the Autodesk Construction Cloud API through Visual Studio - YouTube

3 Likes

@jw.vanasselt thanks for your answer