sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Archiver.rb - update

    Scheduled Pinned Locked Moved Plugins
    42 Posts 10 Posters 25.4k Views 10 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jeff hammondJ Offline
      jeff hammond
      last edited by

      @tig said:

      A while back I wrote an 'Archiver.rb' [ http://www.crai.archi.fr/RubyLibraryDepot/Ruby/em_fil_page.htm ] script that adds an extra command into the File menu 'Archiver'. If you pick that - or more readily key in a shortcut to it - it makes a copy of the model exactly as it is at that second and puts it into an 'Archives' sub-folder with the model. It adds the date+time onto the file name - without using any dialogs etc. That way you can quickly save copies of the model as you go along, knowing that you could open any one from a particular time later if needed so no data is lost...

      It has to be activated manually BUT adding a timer to it that waited till you weren't doing anything too intensive would be possible

      oh, that looks perfect. personally, i prefer to do it manually but i've been using autosave to avoid the dialog box and/or needing to enter my own sequence to the file name.. this one key solution with no dialogs is surely the way to go..
      unfortunately, the script doesn't work for me 😞
      it shows up under the plugins menu but when i push it (or the shortcut i assigned to it) nothing is saved.

      this is how i had it set up so maybe i was doing something wrong in this department?

      made a folder called archiver_test
      saved a skp into the folder called archiver_test.skp
      modified the skp then clicked Plugins/Archiver
      repeated steps 2&3 a few times.

      only the original archiver_test.skp was in the folder after that and i did a system wide search for 'archiver_test' and it only found the folder and the skp.

      any ideas?

      dotdotdot

      1 Reply Last reply Reply Quote 0
      • jeff hammondJ Offline
        jeff hammond
        last edited by

        @tig said:

        Jeff

        I'll look into it...

        sweet, thanks TIG.

        dotdotdot

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          See my earlier post for the fix...http://www.sketchucation.com/forums/scf/viewtopic.php?p=146804#p146804

          TIG

          1 Reply Last reply Reply Quote 0
          • jeff hammondJ Offline
            jeff hammond
            last edited by

            hmm...
            i still can't seem to get this to work

            as far as i can tell, the only thing it does is create a folder called '\Archives' directly on my boot disk (not nestled in any other folders)..

            i've tried various things with that folder such as placing my .skp directly in there or nestled in it's own model folder.. i've tried moving the \Archives to other locations as well. i've also tried working directly off the desktop (which is my normal method of working anyway - it'd probably be best if i could keep it that way.. have a model folder on my desktop to which the archiver files are added)

            when i select File/Open Archives, i get 'NO 'Archives' Folder for 'modelname' ! no matter how many times i tried to archive it.

            i'm hoping this isn't a mac thing.. i always feel like such a pest with my OS πŸ˜„

            dotdotdot

            1 Reply Last reply Reply Quote 0
            • jeff hammondJ Offline
              jeff hammond
              last edited by

              ok, thanks for helping
              i found the rogue files (they were placed in the same location as the archive folder .. there were 5or6 of them)

              i have to go get my daughter from school right now but i'll do what you're saying when i get back.

              dotdotdot

              1 Reply Last reply Reply Quote 0
              • jeff hammondJ Offline
                jeff hammond
                last edited by

                ok, here's the output:

                /Users/jethro/Desktop/archiver_test2/archiver_test2.skp
                /Users/jethro/Desktop/archiver_test2/archiver_test2.skp

                archiver_test2
                nil
                archiver_test2[09-04-06_18-57-35].skp
                \Archives
                \Archives\archiver_test2[09-04-06_18-57-35].skp
                Error: #<Errno::ENOENT: No such file or directory - >
                /Library/Application Support/Google SketchUp 7/SketchUp/Tools/Archiver.rb:82:in chdir' /Library/Application Support/Google SketchUp 7/SketchUp/Tools/Archiver.rb:82:in make'
                /Library/Application Support/Google SketchUp 7/SketchUp/Tools/Archiver.rb:177

                [ps: i put in a request with csaba to break this part of the thread into a new one]

                dotdotdot

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  It's as I thought...
                  A Mac needs / in its file paths...
                  A PC can have either \ or /, except for 'UI.openpanel' which must have ... [unsure about it for Mac***]
                  SUp on PC gives paths etc with \ separators, while PC Ruby can take either: I expect that Mac-Ruby uses / always ?
                  I have rewritten things to trap for this.
                  It's still working fine on my PC.
                  I hope it now works on a Mac... since I don't have a Mac please let me know that File -> Archiver AND ***Open Archive are both working - you might need to make some archives and then reopen the model to get the second Menu option to appear...

                  Note I've removed the 'user' suffix option as it was not that useful anyway and difficult to get/trap cross-platform...

                  After almost four years a Mac user finally reports a bug with this script !!!

                  Hopefully it's now properly cross-platform...


                  Archiver.rb

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • jeff hammondJ Offline
                    jeff hammond
                    last edited by

                    @tig said:

                    I hope it now works on a Mac... since I don't have a Mac please let me know that File -> Archiver AND ***Open Archive are both working - you might need to make some archives and then reopen the model to get the second Menu option to appear...

                    awesome! it's working fine now.. this is surely going to be one of my most used rubies..

                    fwiw, the 'open archive' menu option appears from the get-go and i only have to save an archive in order for the list to appear.. i don't have to save/reopen the model first.

                    thanks so much!

                    dotdotdot

                    1 Reply Last reply Reply Quote 0
                    • TIGT Offline
                      TIG Moderator
                      last edited by

                      Hooray !

                      It will require a little 'management' on your part. If you save every 15 minutes of an eight hour day that's 32 copies of your model !

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • jeff hammondJ Offline
                        jeff hammond
                        last edited by

                        @tig said:

                        Hooray !

                        It will require a little 'management' on your part. If you save every 15 minutes of an eight hour day that's 32 copies of your model !

                        well, that's generally how it is anyway for me but i'm usually just saving to my desktop and though i try to have some sort of naming system for the files, it always gets screwed up about half way through πŸ˜„.. i'm left doing a major clean-up/figuring out what is what every few days.. when i'm at home working on a model, i can stay a bit more organized but i also use sketchup on the job site where it's a lot more hectic - that's where archiver.rb is going to shine i think.

                        this ruby will actually help me keep organized.. especially once OS X supports .skp files (fingers crossed) and i'll be able to go through the archives via cover flow (ability to flip through full sized previews, iTunes style, without actually opening the file)

                        dotdotdot

                        1 Reply Last reply Reply Quote 0
                        • takesh hT Offline
                          takesh h
                          last edited by

                          Hi TIG,

                          Another brilliant ruby script from the brilliant mind.
                          I'm going to add this gem to pushpullbar's Ruby Index, so let me clarify a couple of things before I do that.

                          1. Should I have the link few posts above as the "definite" version of archiver.rb for now? Can I request Didier Bur to update your archiver.rb in Ruby Library Depot to the above version? It doesn't look like Didier had time to update the site for quite some time.
                          2. I always thought "_" is more common (less problematic) divider than "-" in file names, is there any specific reason you chose "-" as a default divider?

                          Thanks in advance.

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            jmmad
                            last edited by

                            Thxs Tig !
                            Life saver plugin
                            Now i can travel back in time

                            Get Upa !

                            1 Reply Last reply Reply Quote 0
                            • TIGT Offline
                              TIG Moderator
                              last edited by

                              @takesh h said:

                              Hi TIG,

                              Another brilliant ruby script from the brilliant mind.
                              I'm going to add this gem to pushpullbar's Ruby Index, so let me clarify a couple of things before I do that.

                              1. Should I have the link few posts above as the "definite" version of archiver.rb for now? Can I request Didier Bur to update your archiver.rb in Ruby Library Depot to the above version? It doesn't look like Didier had time to update the site for quite some time.
                              2. I always thought "_" is more common (less problematic) divider than "-" in file names, is there any specific reason you chose "-" as a default divider?

                              Thanks in advance.

                              v1.7 is the best one - link to that. Didier can add v1.7 if he wants to...
                              It's easy to change the separators - edit the file and make sep="_" or whatever text you want that's allowed in filenames. The only advantage is that in the filename "model[yy-mm-dd_hh-mm-ss].skp" the date and time are more easily read separated by the _. You could even use sep="" and get "model[090407_072210].skp"... It's easily adjustable to suit your own whims...

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • TIGT Offline
                                TIG Moderator
                                last edited by

                                Now you tell me it's a Mac !!! That's probably the basis of the problem...
                                It might be best to go to PM or a new thread ?
                                Firstly please do a Finder search to locate the rogue .tmp files and chuck them - they should have been with the model and removed as the archive is copied over...
                                The 'Archives' folder should be in the model's folder. It's made for each model folder. Unless your model is in the root directory it shouldn't be made in there...
                                Here's a version that writes everything to the ruby console... Open the console, run the Archiver and copy paste the several line of output into a message for me so I can see what's up...

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • TIGT Offline
                                  TIG Moderator
                                  last edited by

                                  Jeff

                                  EDIT:
                                  I've looked into it...
                                  Here's an updated version. It failed before probably because another script was setting the 'default directory' to somewhere else: this version now makes sure it's set to be the model's folder (I added line 80)...

                                  I've ### out the user name and confirming dialog - it you want them back then edit the file and go to lines 75 and 87 respectively and remove the initial '###' to have them show...

                                  If you find a load of "archiver_test[nn-nn-nn_nn-nn-nn_XXX].skp.tmp" files - probably in your Plugins folder - then accept my apologies and throw them away !

                                  It now works silently and puts things in the correct places...
                                  EDIT: see v1.7 http://www.sketchucation.com/forums/scf/viewtopic.php?p=147035#p147035

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • takesh hT Offline
                                    takesh h
                                    last edited by

                                    Thanks for explanation, that makes whole a lot of sense.
                                    I'll forward the link to Didier Bur. πŸ‘

                                    1 Reply Last reply Reply Quote 0
                                    • takesh hT Offline
                                      takesh h
                                      last edited by

                                      TIG,

                                      It's online now.
                                      http://www.pushpullbar.com/forums/ruby-scripts/9467-visual-index-ruby-scripts.html#post146070
                                      If there is anything wrong with my review, please don't hesitate to tell me.
                                      Thanks a bunch.

                                      1 Reply Last reply Reply Quote 0
                                      • jeff hammondJ Offline
                                        jeff hammond
                                        last edited by

                                        just reporting back after a week or so of using archiver.

                                        this plugin is awesome!

                                        thanks again TIG.

                                        dotdotdot

                                        1 Reply Last reply Reply Quote 0
                                        • TIGT Offline
                                          TIG Moderator
                                          last edited by

                                          Glad its useful...

                                          If anyone else has any feedback (even critical !) please let me know...

                                          TIG

                                          1 Reply Last reply Reply Quote 0
                                          • J Offline
                                            Jim
                                            last edited by

                                            @tig said:

                                            Glad its useful...

                                            If anyone else has any feedback (even critical !) please let me know...

                                            What happens if you open an archived model, then use archiver again? Does the date-stamped filename get longer, or does the date-stamp get updated?

                                            Also, a good option may be to have a "branch" option. Branching would prompt for a new filename and save the model under that name. A branch might be used to experiment with variations in a model, then allow to switch back and forth between branches.

                                            Personally, I have turned off SketchUp Auto-save and am in the habit of hitting Ctrl-s (save) to save the model. So, maybe it could be tied to the built-in Model > Save through the onSaveModel ModelObserver.

                                            Just thoughts - I would consider it an essential plugin as it is. Thanks.

                                            Hi

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 3 / 3
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement