#1 By: Peter Harris, August 19th, 2013 10:57
I thought there was a command to do this, but I can't figure it out now. Is it possible? What I want to do is to create a button that I click & it creates a copy of the currently open file in a dropbox folder, so that I have a quick cloud backup. But then I expect to keep working locally, so I don't want the file name or current path to change. I didn't see anything in Rhinoscript or rhino to do this. Any thoughts?
#2 By: Pascal, August 19th, 2013 11:47
Hi Peter- I guess you need to script this - Save, then SaveAs then reopen the previously Saved file...? I've wished/asked for a SaveACopy functionality in the past as well.
#3 By: Mitch Heynick, August 19th, 2013 12:33
What about a script that grabs everything (including hidden and locked stuff) and Exports it all? Would the hidden and locked stuff retain their attributes? The disadvantage of saving and reopening the file will be you lose your undo stack...
#4 By: Mitch Heynick, August 19th, 2013 12:35
Or wait - if the file has been saved, couldn't you use vbscript with windows shell and file system object to copy the file to another location (without needing Rhino to SaveAs?)
#5 By: John Brock, August 19th, 2013 12:57
I think IncrementalSave will mostly do this, but the enumerated file it creates will need to be copied to the Dropbox folder. Cloud based file repositories, like NAS drives, aren't fast enough to be used as working folders without a lot of problems and frustration.
#6 By: Peter Harris, August 19th, 2013 13:17
I have no idea how to do that, unfortunately.
#7 By: Peter Harris, August 19th, 2013 13:19
Maybe. I could make each layer visible, add some document data to each to identify the layer & other info, and then export everything. Then, if I need the backup file, I could have a button to assign everthing to the layers & states that they were in. I think that could work, but it would take me all day to write it in my half-assed scripting way.
#8 By: Peter Harris, August 19th, 2013 13:20
As Mitch said, that would lose my undo stack.
#9 By: Peter Harris, August 19th, 2013 13:25
John, I already save locally using incremental save. But I want to make something that's semi-automatic to save a copy directly to dropbox. I'm very lazy, so to open a folder & copy a file to dropbox is a few steps too many to do each time I stop working for an hour or two, and would probably make it so that I don't do it consistently.
Maybe this would be better as some sort of windows script/program that backs up the most recent files (of any kind) to a folder in dropbox. That would be handy, but way beyond my abilities.
#10 By: Peter Harris, August 19th, 2013 13:30
Pascal - maybe it could copy the current location & filename, then save a copy to dropbox, then incremental save to the local (original) folder. That would preserve the undo stack. I'm always doing incremental save anyway, so this would work for me. But a specific SaveACopy command would be more useful to more people.
#11 By: Pascal, August 19th, 2013 13:36
I think Mitch's file copying via Windows thought is worth a look- I bet he's already 80% done with it but I'll take a look as well.
#12 By: Mitch Heynick, August 19th, 2013 14:13
Sorry, I haven't had much time to do this stuff lately... Go for it and thanks!
#13 By: Pascal, August 19th, 2013 14:37
Hi Peter- here is a first shot at SaveACopy, using the Mitch method. At the moment it does not check for success, I'll see about adding that, and it also asks for a path each time. You can edit with a hard coded destination path if you like, I'll see if I can make it a bit more friendly if it is generally the right thing - let me know.
To use the script, extract and save the .rvb file from the attached zip archive, then drag and drop the saved rvb over an open Rhino v5 window. This will load the script, set it up to load on startup in the future and register the alias
that will run the script much like a regular command. An alias can be typed or added to a toolbar button or keyboard shortcut (F-key).
NOT heavily tested but it seems to work so far here.
#14 By: Peter Harris, August 19th, 2013 15:12
Thanks - I'll try that out.
#15 By: Peter Harris, August 19th, 2013 15:24
That's great Pascal! It would be perfect if, instead of the dialog box, there were command-line options so that I could put the path in a script, but I guess that might be tough since paths can have spaces. Anyway, I'm happy - I put the path hard-coded into your script & it seems to do what I want (though confirmation of success would be nice...)
Thanks to both you & Mitch!
#16 By: Pascal, August 21st, 2013 16:48
Hi Peter - here is an updated version- it does not browse for a folder but asks if you want to browse or type - you can macro it by:
SaveACopy _Browse _Enter to browse
SaveACopy _Enter "C"\Test" to hard code a folder.
There is some error checking so it should tell you about success or failure or if you type an invalid path.
I should add that this Saves the current file as well as copying it to the destination folder- just in case that is not clear.
#17 By: Pascal, August 22nd, 2013 12:04
Added as a feature request for V6 -
(These bug track items are not public yet.)
#18 By: Peter Harris, August 23rd, 2013 21:03
This is great! For my personal use, I changed the 'save' to 'savesmall' since I'm just creating backup snapshots. Thanks!
#19 By: Peter Harris, March 10th, 2014 20:13
Pascal, why is the resulting file name always in all caps?
#20 By: Pascal, March 10th, 2014 22:03
Hmmm... dunno, I'll take a look. I don't think I did anything special to get that...