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.
    • 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
                                • TIGT Offline
                                  TIG Moderator
                                  last edited by

                                  If you open an archive and modify it and then archive it you will get another date-time stamp added to the end of its name, in another Archives folder within the original Archives folder... I'd recommend copying archives rather than using them direct since saving alterations overwrites the earlier version. That way you know which version of the model you are working on but keep the original archive unchanged... You can always open an archive and save_as Model-Option-B etc...

                                  Your 'branch' option is called 'design options' in Revit... At the moment you will need to save as a number of models and archive each as desired... Your 'Archiver+Option' would archive the current Model.skp make /Archives/Model[yy-mm-dd_hh-mm-ss].skp and then open a save_as dialog with suggested incremented option name - e.g. Model[Option-01].skp - you could always change what's inside the []. Work on that version and make archives etc as usual. Then perhaps you decide that you want to explore another variant... pick 'Archiver+Option' again - it then spots the [] on end of the name and suggests a save_as with an incremented name - e.g. Model[Option-02].skp etc etc... Option-01 to Option-99 would be the typical range...

                                  I'll see what I can clobber together... watch this space...

                                  TIG

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

                                    Well, as I said these are just ideas from a casual user, and things I don't strictly "need." Maybe some power-users can give more input.

                                    Hi

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

                                      Here's v1.8

                                      It now has an extra menu option 'Archive Option'.
                                      This archives the file and then gives you a 'save_as' dialog -
                                      with the default new option's file-name entered as "Model[Option-01].skp" ..-02] etc.
                                      This 'option' 'number' is based on the highest value option found in the model's folder.
                                      You can overwrite an existing file if desired (you will be warned 1st).
                                      The current active model-window now opens with the latest option you have just saved.
                                      If you save a model as an 'option', then to be recognised as such it should have its name in the format "Model[Option-nn].skp" - it must have the surrounding "[..]" and a separating "-" between the number and any text; the string "Option" could be set in the save_as dialog to say something else, BUT since new options always use "[Option-nn]" anyway it's recommended to leave it unchanged.

                                      Please test and feedback...


                                      Archiver.rb

                                      TIG

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

                                        Here's v1.9
                                        Minor change to 'Archive Option' - the original model is now saved immediately before it is archived and then saved as an Option.

                                        Usage:

                                        Pick 'Archiver' to make an archive copy of the current model.
                                        It saves the model (in its current state) into a sub-folder
                                        within the model's folder called 'Archives'. It's named with
                                        a [suffix] - date (yy-mm-dd_hh-mm-ss),
                                        e.g. Model[09-12-18_12-34-56].skp.
                                        The separators can be customized from '-' to '' etc,
                                        just change one line - sep="-" to sep="
                                        " etc...
                                        If later on you don't save the main model with those changes
                                        then that archive copy still has those changes current at the
                                        time of the archiving.

                                        If there is an 'Archives' folder then an extra 'File' menu
                                        item is added - "Open Archives"...

                                        'Archive Option' is an additional function that saves the model as it
                                        stands - say 'Model.skp' - then it makes an archive of it - say
                                        'Model[09-04-16_12-25-05].skp' and then opens a 'save_as' dialog in
                                        which it will have preset the next available unused Option name - say
                                        'Model[Option-01].skp' - which you are prompted to save_as: you can
                                        choose to overwrite an earlier option if desired - if so you are
                                        warned about overwriting it. The Options are kept in the same folder
                                        as the original. It is recommended that you do not change the naming
                                        convention... The model is then saved. The current SketchUp window
                                        then shows this latest Option.
                                        Options can be archived in the same way as other models - in the
                                        example above the archive's name might then be
                                        'Model[Option-01][09-04-16_12-30-55].skp'...
                                        If you subsequently use 'Archive Option' on an 'Option' itself it then
                                        names the new Option with the next available free Option name - in
                                        this case it would 'Model[Option-02].skp' and the process repeats...

                                        characters as separators so don't change the Option's

                                        name if you want it to be recognised as one by 'Archive Option'.
                                        Feedback please...


                                        Archiver.rb

                                        TIG

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

                                          i'm not sure if i'm using 1.9 properly but here's what i'm getting...

                                          it works the same as 1.7 in that if i select file->archiver, a archive will be created in a new folder inside the main model's folder.. file->open archives will allow me to search through/open files in the archive folder..
                                          everything is fine there..

                                          now,
                                          if i select file->archive option it works exactly the same as when i use file->archiver except i now have a .tmp (ex- 1239979595.tmp) file saved in the main model's folder. no dialogs or options etc..

                                          dotdotdot

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

                                            Sounds like a Mac problem [again]. Works fine on PC. Please run it with the Ruby Console open and report the error you get. The .tmp file is made so that the original and newly named copy can swap over - that's failing...

                                            TIG

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

                                            Advertisement