[Plugin] LaunchIt v 1.4 (14 oct 2009)
-
%(#4080BF)[short tutorial:
installation: 1. extract the provided zip file into your Sketchup\Plugins folderfirst 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
sqrt2methods:
**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
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/rememberedHistory__________________________________________________________________
**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 actionUpdate 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 this08 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.**
-
Really cool idea, just going to try it out now
-
Hmmm, im not getting the web dialog popping up...
-
Cool idea. I have been thinking that Chris Glasier's scene machine dialog would make a good replacement for the Plugins menu, too.
-
oh no
i have get an error ,i can't lunch it
error code Display thisError: #<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' -
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
-
gavvy thanks for letting me know, I have changed the script - so hopefully the mentioned error is gone now.
-
a4chitect
i have null serieal lines
def launch_itif($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
-
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
-
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
-
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
-
tbd: you're welcome. will look into the github, thx
-
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/ -
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?
-
@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.
-
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.
-
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..
-
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.
-
How's the git repo coming?
-
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
Advertisement