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

    [Plugin] LaunchIt v 1.4 (14 oct 2009)

    Scheduled Pinned Locked Moved Plugins
    30 Posts 12 Posters 41.3k 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.
    • A Offline
      a4chitect
      last edited by a4chitect

      %(#4080BF)[short tutorial:
      installation: 1. extract the provided zip file into your Sketchup\Plugins folder

      first run: Run the Plugins/LaunchIt/Reload Plugins from your Sketchup menu (to add all* your plugins to launchit)
      Run Plugins/LaunchIt/LaunchIt to see the launchit dialog OR assign a keyboard shortcut to it (my favorite is "." key, since it is the default closing key)

      consecutive use: Run LaunchIt from the Plugins menu or by hitting your assigned key, Plugins/LaunchIt/Reload Plugins everytime you add/remove any plugin to keep launchit up to date]

      Update 14 oct 2009 v 1.4
      LaunchIt v 1.4 (14 oct 2009)
      list of changes:
      1.removed a few errors by catching them prior to happening
      2.added an 'ignore' list to the ruby itself => no need to alter any other scripts (add the file name of the file to skip to the @ignorelist at the begginig of the A4_launchit.rb
      3.launchit performs calculations of simple math formulas - these have to start with an equal sign
      understands following code
      constants:
      e
      ln2
      ln10
      log2e
      log10e
      pi
      sqrt1_2
      sqrt2

      methods:
      **abs(x)
      acos(x)
      asin(x)
      atan(x)
      atan2(y,x)
      ceil(x)
      cos(x)
      exp(x)
      floor(x)
      log(x)
      max(x,y)
      min(x,y)
      pow(x,y)
      random()
      round(x)
      sin(x)
      sqrt(x)
      tan(x)
      toSource()
      valueOf()

      as found at http://www.w3schools.com/jsref/jsref_obj_math.asp**
      4.minor changes to the frontend graphic style

      selecting command and doing a simple addition
      circle area formula
      and the result

      Future
      1.transfer the equation result to the VCB for setting of lengths, numbers, etc.
      2.come up with a solution for calculating with decimals (assigning "." for launch-it has its limits πŸ˜„ )
      3.allow the choice of closing after launch to be saved/remembered

      History__________________________________________________________________
      **Update 12 oct 2009 v 1.0
      LaunchIt v 1.2 (12 oct 2009)
      if you have SkIndigo installed, please add the following first line to skindigo ruby file

      #nolaunch
      

      -this script is not mature enough to handle skindigo yet

      The script stores found commands into .rb files which get loaded (this way we don't have to read a text file and translate it into ruby, but we use a native ruby load)
      UI changes: the reset button (X) is gone, to clean your search string press UP arrow key
      to cycle through the results from within the search box, press DOWN arrow key
      to launch a command press Enter or click with your mouse
      I have removed the command population routine from the sketchup startup - this happens upon first launch of LaunchIt instead (for each sketchup session), and everytime you hit LaunchIt/Reload Plugins. This way - the plugin doesn't slow down sketchup getting ready for action πŸ˜„

      Update 10 oct 2009 v 1.0 The script stores command names and relevant action into a txt file, thanks to gavvy for code proposal. It also automatically finds many (not all) commands and actions in the plugins folder and saves them to a separate txt.

      if you want any script removed: add the following line as the first line of that script

      #nolaunch
      

      known issues: 1.script doesn't extract sub-submenus (all command get gathered with the top submenu name)
      2. script can't handle conditions whether to show the command in the first place
      3. *script doesn't include encrypted plugins on purpose
      4. *script can't handle advanced script loading mechanisms (the ones you know from fredo6, etc...)
      5. sketchup launch is longer - am working on this

      08 oct 2009 This is a working code release to start a debate. I wanted to add a simple 'launchy' type functionality to quickly launch any command available in sketchup.

      This code relies on manual insertion of commands (since there is no access to all the commands available to sketchup - correct me if I'm wrong)

      The script is far from perfect but it certainly does the job. To get your favourite command listed either add the following code to the script itself

      if(defined? $launchitcmd == nil)
      	$launchitcmd = []
      end
      
      $launchitcmd.push ["Command name","Command action"]
      

      or add the Command name/Command action to the A4_launchit.rb

      $launchitcmd.push ["Command name","Command action"]
      

      | is a substitute character for " gets replaced at runtime
      example:

      $launchitcmd.push ["Edit Undo","Sketchup.send_action |editUndo;|"]
      

      I'm looking into ways of automatically parsing the local plugins folder and extracting all launchable commands - but this get rather nasty since there are many ways to define and call one.

      Am looking for ideas and suggestions, I would like anyone to fetch this up and bring it to the next level. (better frontend GUI, automatic handling of all plugins present, showing icons alongside the command names, handling of conditions built inside many plugins whether to show the command in the first place, etc.)

      I only plan to add a feature when you can manually add a tool (I hope a tool observer could be used for that).

      I'm not sure if using a global array and sending this to the webdialog is the best solution - please enlighten me πŸ˜„

      P.S. I suggest you have . as a shortcut for launching it ( . already is the default keystroke to close it)

      P.S.2. It comes preloaded with command available to Sketchup itself, I have parsed my Plugins folder with Notepad++/Find in files... add_item.("

      P.S.3. I find the whole concept very handy especially when each new plugin messes the menus up.**

      1 Reply Last reply Reply Quote 0
      • R Offline
        remus
        last edited by

        Really cool idea, just going to try it out now πŸ‘

        http://remusrendering.wordpress.com/

        1 Reply Last reply Reply Quote 0
        • R Offline
          remus
          last edited by

          Hmmm, im not getting the web dialog popping up...

          http://remusrendering.wordpress.com/

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

            Cool idea. I have been thinking that Chris Glasier's scene machine dialog would make a good replacement for the Plugins menu, too.

            Hi

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

              😎

              oh no
              i have get an error ,i can't lunch it
              πŸŽ‰
              error code Display this

              Error: #<NoMethodError: undefined method visible?' for nil:NilClass> j:/Google SketchUp 7/Plugins/A4_launchit.rb:73:in launch_it'
              j:/Google SketchUp 7/Plugins/A4_launchit.rb:109
              j:/Google SketchUp 7/Plugins/A4_launchit.rb:109:in `call'

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

                πŸ˜†
                I have look at your ruby script ,
                πŸ‘ πŸ‘

                and now i want to add some scripts to get funcitons form a command txt files

                Good job

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

                  gavvy thanks for letting me know, I have changed the script - so hopefully the mentioned error is gone now.

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

                    a4chitect
                    πŸŽ‰
                    i have null serieal lines
                    def launch_it

                    if($launchitdlg.visible?)

                    $launchitdlg.close

                    return false

                    end

                    #puts $launchitcmd
                    
                    #$launchitcmd.uniq!# FF_whatis the usage????? FF_nul
                    
                    
                    functionlist = "var functionlist = Array("
                    functionaction = "var functionaction = Array("
                    

                    I just NULL it AND IT work WELL πŸ˜†

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

                      here is the change of mine !

                      I add these to change the command list easy ,but is there any ways to read the command listfile directly?

                      AND the attachment is the plugin-GUI I changed

                      Ps: I think doubleKlick is better than oneclick πŸŽ‰

                      #命什ε…₯ε †
                      @Cpath = File.dirname(FILE)
                      @Cbarset = Set.new
                      Ctbs = Dir[@Cpath +"/A4_launchit"+ "/*.txt"]

                      Ctbs.each do |tb|
                      IO.readlines(tb).each do |cmd|
                      next if cmd[0, 1] == "#"
                      #cmd, cmt = cmd.split("#")
                      next if cmd.nil?
                      cmd.strip!
                      @Cbarset = @Cbarset.insert cmd

                      	@Cbarset.each do |ca|
                      		$launchitcmd.push ca.split("|")[0..1]
                      	end
                      end
                      

                      end


                      GUI.jpg

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

                        great stuff! it's cleaner to have commands in a separate txt. I suggest you share your whole script (as a branch?)

                        Does anybody have experience with online code hosting ? like code.google.com ? Is there a branching feature to allow deviation from the main code ?

                        Regarding your question about automatic command extraction, I think this could be done by using the IO.readline to read all plugins and look for the lines which populate the menu and context (right-click) menu.

                        As I wrote in the first post, look for the

                        .add_item("
                        
                         string in all the rubies, after the double quote, there usually is a command name, and the action
                        
                        1 Reply Last reply Reply Quote 0
                        • tbdT Offline
                          tbd
                          last edited by

                          nice work a4chitect and thanks for putting my scripts as an example πŸ˜‰

                          I like github.com for hosting source and allows forking and if you want to learn about check the online book about Git

                          SketchUp Ruby Consultant | Podium 1.x developer
                          http://plugins.ro

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

                            tbd: you're welcome. will look into the github, thx

                            1 Reply Last reply Reply Quote 0
                            • S Offline
                              stanmarsh
                              last edited by

                              hello a4rchitect,

                              i was just thinking if this could combine and work with pluginloader by alexschreyer to load plugins, then use launchit as the front-end.
                              pluginloader link
                              http://www.alexschreyer.net/projects/plugin-loader-for-sketchup/

                              1 Reply Last reply Reply Quote 0
                              • R Offline
                                remus
                                last edited by

                                Added a load of plugins but only one ever shows up by adding the

                                if(defined? $launchitcmd == nil)
                                   $launchitcmd = []
                                end
                                
                                $launchitcmd.push ["Command name","Command action"]
                                

                                Bit, but only one ever shows up.

                                seems to be in alphabetical order, so weld.rb was the only one that would load, moved out of the folder then it was webconsole.rb and so on.

                                Any ideas?

                                http://remusrendering.wordpress.com/

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

                                  @a4chitect said:

                                  tbd: you're welcome. will look into the github, thx

                                  don't let this stop you from working on the plugin. Distributed version control software is nice, but can have a lengthy learning curve (my experience, at least.) If you're in it for the long haul, then learning to use git or mercurial is well worth the effort. If this is an occasional endeavor - maybe not so much.

                                  Hi

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

                                    I was playing around with speech, and this could turn out to be a good interface for voice command control of SketchUp. It's not quite working - I can speak the word and it gets typed in the filter box, but for whatever reason the list is not filtered.

                                    Hi

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

                                      doesn't seem to work on macs too well but... πŸ˜„

                                      this is built into OS X (it's not SU specific.. all apps have this ability)

                                      same deal, start typing some letters and all the options start popping up etc.. if you hover over a command for a second, it's path will be shown as well.. skindigo, fredo, etc works fine too..

                                      it's also sort of smart in that it won't display commands that aren't possible at the time (for instance, redo won't show up in the search if there's nothing to redo)

                                      i don't have anything to test it with but i'm almost positive voice cmmd will work.

                                      [flash=640,385:3v2nt73s]http://www.youtube.com/v/1HBmYx3w3W0&hl=en&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6[/flash:3v2nt73s]

                                      i'll add this.. it's a cool feature but the only time i use it is for obscure commands or when learning a new app.. once you know an app, shortcut keys are way better..

                                      dotdotdot

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

                                        Jim: I suppose that using speech for input doesn't trigger the OnKey event in the javascript - to perform the search

                                        Jeff: I envy you - because the built-in OS X functionality looks great. The whole purpose and idea of launchit was, that my plugins menu won't fit on the screen anymore, and gets 'randomized' very often - because of new plugin installations. I agree that using keyboard shortcuts is way better. I think that Google should consider integrating the shortcut preferences into the GUI. It provides the functionality of searching for commands already, but serves only to assign shortcuts.

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

                                          How's the git repo coming?

                                          Hi

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

                                            Jim: I gave up on git or any other code repos for the time being. This plugin would probably not get developed by anyone else πŸ˜„

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

                                            Advertisement