sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Batch Open-Process-Save

    Scheduled Pinned Locked Moved Plugins
    15 Posts 5 Posters 882 Views 5 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.
    • G Offline
      glro
      last edited by

      @cadfather said:

      anyone up to make a script that opens sequentially all the skp files in a folder, sets a style, puts the model to front view, fits the model to screen, purges all unused and then saves until all files are done?

      what i'm trying to do is consolidate my components library and have the thumbnails work for all files.

      (i can make a reasonable paypal donation)

      This plugin might be helpful
      http://sketchucation.com/forums/viewtopic.php?t=48215

      1 Reply Last reply Reply Quote 0
      • CadFatherC Offline
        CadFather
        last edited by

        thanks Giro, i know that one - this is to process sketchup files though and not images.

        1 Reply Last reply Reply Quote 0
        • G Offline
          glro
          last edited by

          skp modification and save copy
          @cadfather said:

          thanks Giro, i know that one - this is to process sketchup files though and not images.

          I have been trying for a while to write a plugin that would do what you say
          TIG's helped me with some code, and i wrote this plugin "skp_recap.rb"

          There is a problem, though: i don't find the way to overwrite the file with the modifications the plugin makes, so i have to save it with a different name: I added "bis" to the name of the file

          nom_model = model.title
          #constitue le nom du modele
          nom_model = rep_path + "/" + nom_model + "bis"+".skp"
          puts nom_model
          #sauve
          model.save nom_model
          

          maybe somebody will find a clever way to avoid the "bis" trick

          1 Reply Last reply Reply Quote 0
          • G Offline
            glro
            last edited by

            @cadfather said:

            thanks Giro, i know that one - this is to process sketchup files though and not images.

            it seems i am not the only one with this problem for saving a currently opened file with the same name

            File Not Found

            favicon

            (www.smustard.com)

            maybe a sketchup bug...

            1 Reply Last reply Reply Quote 0
            • CadFatherC Offline
              CadFather
              last edited by

              thanks Giro, did you see this?

              http://sketchucation.com/forums/viewtopic.php?f=180&t=51357

              anyways, i'm pretty sure master TIG will probably come up with something fab yet again..

              1 Reply Last reply Reply Quote 0
              • gullfoG Offline
                gullfo
                last edited by

                @glro said:

                [attachment=0]maybe somebody will find a clever way to avoid the "bis" trick

                maybe the .save() method without a name simple saves the current model? the bug might be that calling .save() with the name causes it to assume "save as" and therefore cannot because the model is open (and a bug) causes it not to revert to "save" (like many programs like Office for example) when the current file and "new" file are the same.

                of course another option is keep the name and simply place the output files into another folder so after the batch processing is completed you can simply move those files into the existing folder (overwriting) or whatever it is you're trying to achieve.

                Glenn

                http://www.runnel.com

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

                  The issue is that
                  model.save(name)
                  will return ' true', BUT it doesn't actually save the model if that ' name' is an open SKP - either as another SKP or it's the current-model's SKP.
                  To save a model you need to use
                  Sketchup.send_action("saveDocument:")
                  Then use other API methods to open other files etc...

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    glro
                    last edited by

                    @tig said:

                    The issue is that
                    model.save(name)
                    will return ' true', BUT it doesn't actually save the model if that ' name' is an open SKP - either as another SKP or it's the current-model's SKP.
                    To save a model you need to use
                    Sketchup.send_action("saveDocument:")
                    Then use other API methods to open other files etc...

                    yes
                    i modified the previous plugin, and now the file is saved
                    thank you TIG

                    still 2 problems i can't solve:

                    disable perspective (Sketchup.send_action("viewPerspective:" puts it on and then off...)
                    wait until the file is saved (i added a messagebox, you have to click between each file)

                    TIG gave (again) a solution for the second problem
                    http://sketchucation.com/forums/viewtopic.php?f=323&t=39304
                    but i couldn't make it work on my computer


                    front, purge and save skps in a folder

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      matt.gordon320
                      last edited by

                      Hi guys, is there a (relatively) easy way to edit a script like this to batch down-save models to a previous version (no changes made, only save)?

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

                        @matt.gordon320 said:

                        Hi guys, is there a (relatively) easy way to edit a script like this to batch down-save models to a previous version (no changes made, only save)?
                        The save_as_version is not accessible in the current API [it might one day happen in a newer version of SketchUp...]
                        Jim Foltz wrote something for PC [using a .so] which opens the save_as dialog and mimics keystrokes to change to the previous version.
                        You could use some of its ideas to do this for say v2013 back to v8 ?
                        http://sketchucation.com/forums/viewtopic.php?p=294768#p294768
                        Links to his site...

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          matt.gordon320
                          last edited by

                          @tig said:

                          The save_as_version is not accessible in the current API

                          Well that'll help to explain why I had such trouble trying to find it in the API docs! Thanks TIG, I'll look into that one!

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

                          Advertisement