• Login
sketchucation logo sketchucation
  • Login
๐Ÿค‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Plugin] Save Copy As Previous Version

Scheduled Pinned Locked Moved Plugins
60 Posts 22 Posters 65.7k Views 22 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.
  • J Offline
    Jim
    last edited by 2 Jan 2015, 11:22

    @stagelight said:

    Maybe this is new for 2015? But this code, will save as version 7, no confirmation needed. Just run in the ruby console...
    model = Sketchup.active_model
    status = model.save("", Sketchup::Model::VERSION_7)

    Oh that's interesting. It only works if the model has already been saved. I may have made things more difficult than they are.

    So what you want is to be able to choose a version to use as the default one time, then just use a shortcut or menu item to save the model?

    Hi

    1 Reply Last reply Reply Quote 0
    • D Offline
      driven
      last edited by 2 Jan 2015, 17:45

      @jim said:

      Oh that's interesting. It only works if the model has already been saved.

      model = Sketchup.active_model
      status = model.save((File.expand_path("~/Desktop/test_v7")), Sketchup;;Model;;VERSION_7)
      

      if you give it a valid path it works with unsaved models...

      In my mac version I grab the incoming path from the header and spit that back out on save...

      but to do so automatically as per the request, needs an Observer, and I loathe all of them...

      john

      learn from the mistakes of others, you may not live long enough to make them all yourself...

      1 Reply Last reply Reply Quote 0
      • U Offline
        unsuns
        last edited by 25 Nov 2015, 17:20

        Hello Everyone !

        Today, I finally decided to start using Sketchup 2016 instead of Sketchup 8, and I discovered this WONDERFUL plugin.

        However, it's not working with SU 2016.

        Thank you for updating it, we'll be really grateful !

        Cheers !

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by 25 Nov 2015, 21:11

          I'll take a look.

          Hi

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by 28 Nov 2015, 12:22

            @unsuns said:

            Hello Everyone !

            However, it's not working with SU 2016.

            It is working for me - what is not working for you?

            Hi

            1 Reply Last reply Reply Quote 0
            • U Offline
              unsuns
              last edited by 28 Nov 2015, 22:28

              @jim said:

              @unsuns said:

              Hello Everyone !

              However, it's not working with SU 2016.

              It is working for me - what is not working for you?

              When I use it, the plugin changes the file's version number back to 8.0.1 and I can open it correctly in Sketchup 8.

              However, I use Lumion, and he cannot read the file until I save it manually as version 8.

              Moreover, when I use the plugin, it seems to change only the version number, and not re-saving the file completely, which takes much more time when I test that manually on heavy files.

              1 Reply Last reply Reply Quote 0
              • U Offline
                unsuns
                last edited by 2 Dec 2015, 16:14

                Did you check the issue and found a solution for that problem ?

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by 2 Dec 2015, 20:03

                  I suspect your Lumion plugin needs you to re-save so it can 'tag' all your materials.
                  if the plugin isn't in v16 it would not have done that for you...

                  does Lumion have a v16 version?

                  john

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply Reply Quote 0
                  • U Offline
                    unsuns
                    last edited by 2 Dec 2015, 20:18

                    @driven said:

                    I suspect your Lumion plugin needs you to re-save so it can 'tag' all your materials.
                    if the plugin isn't in v16 it would not have done that for you...

                    does Lumion have a v16 version?

                    john

                    The latest Lumion version is 6.0, and shows the same issue. The SKP file must be saved as v8.
                    When I save it from Sketchup 2016 manually, it works perfectly.
                    However, I thought that this plugin would make me save some time, using a simple shortcut.

                    I'd be really glad if this finally works ! ๐Ÿ˜„

                    Edit : Lumion reads the sketchup file directly.

                    1 Reply Last reply Reply Quote 0
                    • U Offline
                      unsuns
                      last edited by 3 Dec 2015, 01:15

                      I did a few more tests and I figured out what the problem is :

                      I used to try to overwrite the active file from v2016 to save it as v8 through the plugin-> Same name (Format : %model).

                      However, when I added some other character (Format: %model_V8), meaning that it saves as another file, this works perfectly, and Lumion reads the file flawlessly.

                      So, the real issue is : Can we FORCE the plugin to overwrite the current and active SKP v16 file in order to make it v8 ?

                      Thank you.

                      EDIT : Indeed, I just had to change the "Sketchup.active_model.save_copy" to "Sketchup.active_model.save". Now it works PERFECTLY !
                      PROBLEM SOLVED ! THANKSSS ! ๐Ÿ˜„

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        stagelight
                        last edited by 5 Dec 2015, 05:29

                        I just posted this. Maybe this will useful..

                        http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=63606

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          rv1974
                          last edited by 2 Feb 2016, 08:02

                          Jim may I humbly request a sub-version of your 'Save Copy As Previous Version' that would save only selectedin v8 format and would preserve coordinates.
                          Desirabaly it should save from inside hierarchy,
                          save silently (no pop-ups)to the same parent directory, and add some kind of suffix '_v8' in the file name.
                          Thanks in advance.

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            Jim
                            last edited by 2 Feb 2016, 10:33

                            Hi rv I'll see what I can do but it likely won't happen until this weekend.

                            Hi

                            1 Reply Last reply Reply Quote 0
                            • J Offline
                              Jim
                              last edited by 7 Feb 2016, 12:58

                              @rv1974 said:

                              Jim may I humbly request a sub-version of your 'Save Copy As Previous Version' that would save only selectedin v8 format and would preserve coordinates.
                              Desirabaly it should save from inside hierarchy,
                              save silently (no pop-ups)to the same parent directory, and add some kind of suffix '_v8' in the file name.
                              Thanks in advance.

                              I am not sure I understand what you need. We have also exchanged some private messages which have only confused the issue for me. Can you explain in more detail what you would like to do? What problem needs solved, or what work-flow could be more efficient?

                              Hi

                              1 Reply Last reply Reply Quote 0
                              • R Offline
                                rv1974
                                last edited by 7 Feb 2016, 14:11

                                Please see attached scrinshot+ skp files.
                                In file 1 I select all instances of tree and red curtain components and (hopefully) your new script would create (silently, in the same folder, origin preserved) 1_say_jim_v.8 skp file containing all of them.
                                Thanks.


                                1.JPG


                                jim.zip

                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  Jim
                                  last edited by 7 Feb 2016, 14:43

                                  Would it make sense to be able to right-click a single instance of a component and create the _v8 file?

                                  Hi

                                  1 Reply Last reply Reply Quote 0
                                  • R Offline
                                    rv1974
                                    last edited by 7 Feb 2016, 15:03

                                    Would be completely OK.

                                    1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      Jim
                                      last edited by 8 Feb 2016, 21:21

                                      What I have done thus far is this:

                                      Right-click one component instance from anywhere in the model hierarchy, then select "Save all Instances"

                                      The plugin saves the component to disc in the same folder as the original model as a .skp file. The plugin goes through the model and writes the positions of each of the instances in the model to a text file with the same name as the component i the same folder.

                                      Now you have the option to use the "Import Instances" in the Extensions menu. You can import to the same model, or to a new model. All instances are imported to the same location as in the original file, but they are all at the Model context. You can then manually save imported components file as a version 8 file.

                                      I am still working out how to best create the version 8 file containing only the selected components from the original model. I hope this helps for now. I plan on continuing work as time permits.


                                      jf_save_instances.rb

                                      Hi

                                      1 Reply Last reply Reply Quote 0
                                      • R Offline
                                        rv1974
                                        last edited by 9 Feb 2016, 18:28

                                        Awesome! I had no chance to check it out today, gonna try it tomorrow
                                        Many thanks in advance!

                                        1 Reply Last reply Reply Quote 0
                                        • R Offline
                                          rv1974
                                          last edited by 10 Feb 2016, 09:43

                                          Tried it right now and I happy to confirm this is awesome tool โ˜€
                                          I highly recommend to all good people of Sketchucation to adopt it their arsenal.

                                          Briefly it serves to grab the instances of entourage randomly delete\diversify them
                                          just with a couple of clicks.
                                          Jim many thanks once again.
                                          P.S. Should we expect v8?

                                          P.P.S. It appears there's a free bonus- the script 'fixes' the bug of 3ds Max that in bizarre way flips the instances originally mirrored in SU. So when you insert v8 skp file
                                          into the Max all items look OK.

                                          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