If I wanted to allow somebody to save a copy of a file to a predetermined folder while they were in the project, is there a node that allows this? I don’t want to ‘save as’, as that would change the file name/location of the active file. I just want to create a copy of it in a certain location.
I was thinking the best way forward would be to use python to utilize windows and copy the central to another location. Can somebody get me started on python commands to manipulate files in windows?
The end result of all of this would be that somebody can run this script to create a copy of their file in a networked folder. I then plan on using ‘Revit Batch Processor’ to open up all of the files in this certain folder and run a model health script overnight.
What exactly are you trying to do with a “copy” that isn’t just a Save As to a new location? Is this a workshared model? Are you wanting the worksharing intact or do you want a detached copy of the file as-is? Remember you’re still bound by the rules of Revit.
If somebody is working a project and does a ‘Save As’, it would change the file name and the location of their file, correct? That would really screw things up. I don’t want this to affect the active session.
OK, that makes sense, but my other questions are still important. How do you want that file to act (relative to the central model if it’s workshared) once it’s created? A local copy of a model is just a copy of the file. All you need to do is copy the RVT to a new location. From there, you have to decide if you need to open it and detach the model or leave it as-is.
Correct. The Revit API does not actually utilize Python, but we can still use Python to write our code and have the Common Language Runtime (CLR) translate for us. This means learning to convert C# or VB to the equivalent Python syntax. It’s not as hard as it may seem but it does take some practice.
You can give this video a watch if you want some additional explanation. There are a couple sections covering this process.