Rhino for Windows
phcreates at August 19th, 2013 10:57 — #1
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?
pascal at August 19th, 2013 11:47 — #2
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.
helvetosaur at August 19th, 2013 12:33 — #3
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...
helvetosaur at August 19th, 2013 12:35 — #4
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?)
john_brock at August 19th, 2013 12:57 — #5
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.
phcreates at August 19th, 2013 13:17 — #6
I have no idea how to do that, unfortunately.
phcreates at August 19th, 2013 13:19 — #7
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.
phcreates at August 19th, 2013 13:20 — #8
As Mitch said, that would lose my undo stack.
phcreates at August 19th, 2013 13:25 — #9
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.
phcreates at August 19th, 2013 13:30 — #10
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.
pascal at August 19th, 2013 13:36 — #11
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.
helvetosaur at August 19th, 2013 14:13 — #12
Sorry, I haven't had much time to do this stuff lately... Go for it and thanks!
pascal at August 19th, 2013 14:37 — #13
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.
phcreates at August 19th, 2013 15:12 — #14
Thanks - I'll try that out.
phcreates at August 19th, 2013 15:24 — #15
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!
pascal at August 21st, 2013 16:48 — #16
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.
pascal at August 22nd, 2013 12:04 — #17
Added as a feature request for V6 -
(These bug track items are not public yet.)
phcreates at August 23rd, 2013 21:03 — #18
This is great! For my personal use, I changed the 'save' to 'savesmall' since I'm just creating backup snapshots. Thanks!
phcreates at March 10th, 2014 20:13 — #19
Pascal, why is the resulting file name always in all caps?
pascal at March 10th, 2014 22:03 — #20
Hmmm... dunno, I'll take a look. I don't think I did anything special to get that...