Rhino for Windows
phcreates — 2013-08-19T10:57:07-04:00 — #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 — 2013-08-19T11:47:28-04:00 — #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 — 2013-08-19T12:33:29-04:00 — #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 — 2013-08-19T12:35:38-04:00 — #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 — 2013-08-19T12:57:46-04:00 — #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 — 2013-08-19T13:17:08-04:00 — #6
I have no idea how to do that, unfortunately.
phcreates — 2013-08-19T13:19:06-04:00 — #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 — 2013-08-19T13:20:32-04:00 — #8
As Mitch said, that would lose my undo stack.
phcreates — 2013-08-19T13:25:52-04:00 — #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 — 2013-08-19T13:30:07-04:00 — #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 — 2013-08-19T13:36:55-04:00 — #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 — 2013-08-19T14:13:51-04:00 — #12
Sorry, I haven't had much time to do this stuff lately... Go for it and thanks!
pascal — 2013-08-19T14:37:20-04:00 — #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 — 2013-08-19T15:12:16-04:00 — #14
Thanks - I'll try that out.
phcreates — 2013-08-19T15:24:47-04:00 — #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 — 2013-08-21T16:48:55-04:00 — #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 — 2013-08-22T12:04:43-04:00 — #17
Added as a feature request for V6 -
(These bug track items are not public yet.)
phcreates — 2013-08-23T21:03:00-04:00 — #18
This is great! For my personal use, I changed the 'save' to 'savesmall' since I'm just creating backup snapshots. Thanks!
phcreates — 2014-03-10T20:13:09-04:00 — #19
Pascal, why is the resulting file name always in all caps?
pascal — 2014-03-10T22:03:39-04:00 — #20
Hmmm... dunno, I'll take a look. I don't think I did anything special to get that...