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

    [Plugin] Snapshot – (1.0.1) — updated 09.10.2012

    Scheduled Pinned Locked Moved Plugins
    74 Posts 12 Posters 54.8k Views 12 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

      @glro said:

      @aerilius said:

      @driven said:

      @glro said:

      is it possible to create a shortcut to a file using ruby?

      That might be a the easiest solution! I'll try it!

      i added some code to yours at the end of "self.save_as(filepath)" method

      
      > filepath2 = (filepath.split("/")[0..-2]).join("/")
      > nom_model = m.title
      > # name of the text file to put the shortcut in
      > nom_bat = filepath2 + "/" + nom_model + ".bat"
      > 	
      > #open this file
      > aFile = File.new(nom_bat,"w")
      > 
      > pathmodel = m.path
      > 
      > #write the file shortcut
      > aFile.puts("call "+pathmodel)
      > aFile.puts("end")
      > aFile.close
      > 
      

      a black cmd window is opened... must be closed manually, unless you embed the .bat file in a .js file...
      it is basic but it works...

      Doesn't work if there is a white space in the file address

      additional code is needed

      
      nom_bat2 = nom_bat.to_s
      
      if nom_bat2.count(nom_bat2, " ") != 0
      UI.messagebox("no white space in the file address")
      fail
      end
      
      1 Reply Last reply Reply Quote 0
      • A Offline
        Aerilius
        last edited by

        I updated the plugin. I think it will now fit all your needs because you can now make your own buttons 😉
        @glro, can you test if the shortcuts work as expected?

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

          @aerilius said:

          I updated the plugin. I think it will now fit all your needs because you can now make your own buttons 😉
          @glro, can you test if the shortcuts work as expected?

          i tested, but there might be a problem

          no box is opened on my scree when i check "ae snapshot" in the menu

          it might come from the html file

          in the pop up windows you show in the first message of this thread, i read "create a shortcut"

          but when i click on the html file in "ae_snapshot" folder, i don't see the same things


          html settings differences

          1 Reply Last reply Reply Quote 0
          • A Offline
            Aerilius
            last edited by

            I first thought it might have to do with upgrading the settings (because the previous version is much different). But I just tested it from 0.1.1 to 0.3.0 and it works for me.

            You mean the settings dialog does not appear when you click the gear icon on the toolbar (there is no ae snapshot menu). Can you open the Ruby Console, click the gear button and give me the error messages if there are any.
            Then copy&paste " AE::Snapshot.options={}" into the console and press the gear button again. Does it then work?

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

              @aerilius said:

              I first thought it might have to do with upgrading the settings (because the previous version is much different). But I just tested it from 0.1.1 to 0.3.0 and it works for me.

              You mean the settings dialog does not appear when you click the gear icon on the toolbar (there is no ae snapshot menu). Can you open the Ruby Console, click the gear button and give me the error messages if there are any.
              Then copy&paste " AE::Snapshot.options={}" into the console and press the gear button again. Does it then work?

              yes, the setting dialog does not appear;
              the gear icon does'nt appear either...
              just a small reactangle where i cannot click ...

              how do you explain the differences between the setting dialog window i get when i double click directly on the file "settings_dialog.htm" and the one you pasted in you message?

              my guess is that it is linked to the problem


              snapshot icon

              1 Reply Last reply Reply Quote 0
              • srxS Offline
                srx
                last edited by

                Very useful! Thank you very much.

                www.saurus.rs

                1 Reply Last reply Reply Quote 0
                • A Offline
                  Aerilius
                  last edited by

                  @glro: Does " Sketchup.write_default("Plugins_ae", "Snapshot", "{}")" on the Ruby Console and restarting help?
                  (There are no relevant differences in the htm file.)
                  (By the way, you don't need quote the message, I know it's on the same page one above 😉 )

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

                    OK

                    yes it helps

                    when i close and open sketchup again, the icon and snapshot settings windows appear on the screen

                    but i cannot save the parameters (clicking on "OK" doesnt change anything)

                    i notice the lines you added to create a file shortcut; since this is the only option i am interested in, i'll try to add them to the previous version, that worked perfectly on my computer

                    thank you

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      Aerilius
                      last edited by

                      @glro said:

                      yes it helps

                      That is good!

                      @glro said:

                      clicking on "OK" doesnt change anything

                      Toolbar changes can only take effect after restarting SketchUp. (Maybe that's not so obviously written.)

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

                        when i launch sketchup again, i get "wrong number of arguments (0 for 1)"

                        The plugin does take a shot when i click on the button

                        but i cannot get the snapshot settings windows on the screen anymore

                        it may be because of my computer, if i am the only one to have this problem...

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          Aerilius
                          last edited by

                          I am very sure it's not your computer. I couldn't find anything on my own.

                          @unknownuser said:

                          "wrong number of arguments (0 for 1)"

                          This error was on the Ruby Console? Can you tell me what was before or after that? There should be a line number and a line number is very much helpful!

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

                            no, nothing in the ruby console

                            it is an error message when sketchup loads all the plugins

                            no numbers


                            erreur chargement

                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              Aerilius
                              last edited by

                              Ok, SketchUp does not tell us much about load errors. In such a case we need to reload the plugin manually in the Ruby Console to see more details. Can you do:
                              load "ae_Snapshot/Snapshot.rb"

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

                                Here is what i get when i type 'load "ae_Snapshot/Snapshot.rb" 'in the ruby console

                                load "ae_Snapshot/Snapshot.rb"
                                Error: #<ArgumentError: C:/Archivos de programa/Google/Google SketchUp 8/Plugins/ae_Snapshot/Snapshot.rb:309:in `initialize': wrong number of arguments (0 for 1)>

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  Aerilius
                                  last edited by

                                  Thanks!!!
                                  I found and fixed the issues!

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

                                    sorry to write that i still have an error message


                                    string to integer error

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      Aerilius
                                      last edited by

                                      I'm not sure if I found it (line 187?). Can you post the error with line number that the Ruby Console gives?
                                      load "ae_Snapshot/Snapshot.rb"

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

                                        Here is the error message:

                                        "Error: #<TypeError: C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_Snapshot/Snapshot.rb:319:in []': can't convert String into Integer> C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_Snapshot/Snapshot.rb:319 C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_Snapshot/Snapshot.rb:319 C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_Snapshot/Snapshot.rb:318:in each'
                                        C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_Snapshot/Snapshot.rb:318
                                        (eval):155:in `load'
                                        (eval):155"

                                        line 319

                                        1 Reply Last reply Reply Quote 0
                                        • A Offline
                                          Aerilius
                                          last edited by

                                          (I won't be back until tomorrow.)
                                          I just made a quick change, can you test it?


                                          Put it in .../Plugins/ae_Snapshot/Snapshot.rb

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

                                            i replaced the previous file in the rbz, by this new one, and yes, now it works perfectly

                                            a nice tool to keep tracks, and retrieve a lost model

                                            thank you

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

                                            Advertisement