[Plugin] LaunchIt v 1.4 (14 oct 2009)

[Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby a4chitect » Thu Oct 08, 2009 9:40 pm

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
A4_launchit v1.4.zip

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

v1.4.png

circle-area-formula.png

circle-area.png


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 :D )
3.allow the choice of closing after launch to be saved/remembered

History__________________________________________________________________

Update 12 oct 2009 v 1.0
A4_launchit v1.2.zip

if you have SkIndigo installed, please add the following first line to skindigo ruby file
Code: Select all
#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 :D

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
Code: Select all
#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

Code: Select all
if(defined? $launchitcmd == nil)
   $launchitcmd = []
end

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


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

Code: Select all
$launchitcmd.push ["Command name","Command action"]


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

Code: Select all
$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.
0
Last edited by a4chitect on Wed Oct 14, 2009 1:44 pm, edited 26 times in total.

a4chitect 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby remus » Thu Oct 08, 2009 11:28 pm

Really cool idea, just going to try it out now :thumb:
0

remus 
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby remus » Thu Oct 08, 2009 11:37 pm

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

remus 
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby Jim » Thu Oct 08, 2009 11:43 pm

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

Jim 
Global Moderator
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby gavvy » Fri Oct 09, 2009 2:25 am

8-)

oh no
i have get an error ,i can't lunch it
:bounce:
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'
0

gavvy 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby gavvy » Fri Oct 09, 2009 3:23 am

:lol:
I have look at your ruby script ,
:thumb: :thumb:

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

Good job
0

gavvy 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby a4chitect » Fri Oct 09, 2009 6:29 am

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

a4chitect 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby gavvy » Fri Oct 09, 2009 7:40 am

a4chitect
:bounce:
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 :lol:
0

gavvy 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby gavvy » Fri Oct 09, 2009 10:45 am

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 :bounce:



#命令入堆
@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
0

gavvy 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby a4chitect » Fri Oct 09, 2009 11:09 am

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
Code: Select all
.add_item("
string in all the rubies, after the double quote, there usually is a command name, and the action
0

a4chitect 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby tbd » Fri Oct 09, 2009 11:43 am

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
0
SketchUp Ruby Consultant | Podium 1.x developer
http://plugins.ro
User avatar
tbd 
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby a4chitect » Fri Oct 09, 2009 12:37 pm

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

a4chitect 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby stanmarsh » Fri Oct 09, 2009 3:03 pm

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/pl ... -sketchup/
0

stanmarsh 
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby remus » Fri Oct 09, 2009 4:37 pm

Added a load of plugins but only one ever shows up by adding the
Code: Select all
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?
0

remus 
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby Jim » Sat Oct 10, 2009 8:10 pm

a4chitect wrote: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.
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] LaunchIt (12 oct 2009)

Postby Jim » Tue Oct 13, 2009 5:56 am

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.
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] LaunchIt (12 oct 2009)

Postby jeff hammond » Tue Oct 13, 2009 6:59 am

doesn't seem to work on macs too well but... :D

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.




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..
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: [Plugin] LaunchIt (12 oct 2009)

Postby a4chitect » Tue Oct 13, 2009 8:31 am

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.
0

a4chitect 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt (12 oct 2009)

Postby Jim » Tue Oct 13, 2009 3:56 pm

How's the git repo coming?
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] LaunchIt (12 oct 2009)

Postby a4chitect » Wed Oct 14, 2009 1:18 pm

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 :)
0

a4chitect 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby Jim » Wed Oct 14, 2009 1:34 pm

a4chitect wrote: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 :)


I can understand. But I did actually want to look at this as the menu for a "Protable Plugins" project to create a plugins folder people can carry with them on a portable device.
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby a4chitect » Wed Oct 14, 2009 1:40 pm

you are welcome to use/reuse/change the code ;)

I would love someone to upgrade the command-extraction routine from present ruby files, the current version is weak (fails at extracting fredo6 commands, dynamic commands, and actually at all not simple ones)

I was hoping that all visiting ruby developers could agree on one method of the sketchup-top-menu and context-menu population, which could simplify any GUI replacement projects.

Even at this stage a GUI replacement in html+javascript could be easily done, thanks to the wonderful sketchup-ruby architecture.
0

a4chitect 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby gavvy » Fri Oct 16, 2009 5:03 am

:roll:
oh NO ,
IN YOUR V1.4 I get a lot of error BECAUSE OF your html FILES
is there times for us to disscusion through MSN or QQ?
I have some idea to your plugins
0

gavvy 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby orei » Sat Oct 17, 2009 1:37 pm

if i regenerate the list of ruby... doesn't appear all my ruby script.. why?? i've so many ruby.. but in the list there are only a part
0

orei 
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby gavvy » Sun Oct 18, 2009 11:03 am

now i have null your script and change some part of it .
1. Just use the Java script to Filit or return the command name ,then index the command in the command array.
because if you throuh the javascript to launch the below commands it get errors :shock:
========
Joint Push Pull|JointPushPull.execute 'J'|jointpushpull|jpp_j|Joint Push Pull
Vector Push Pull|JointPushPull.execute 'V'|jointpushpull|JPP_V|Vector Push Pull
Normal Push Pull|JointPushPull.execute 'N'|jointpushpull|JPP_N|沿法线挤出
Undo Push Pull|JointPushPull.redo|jointpushpull|JPP_Undo|返回
RDC_ROUND|RoundCorner.launch :RDC_ROUND_ ||RDC_icon_Round_16|Round corners in 3D
RDC_SHARP|RoundCorner.launch(:RDC_SHARP_, { :sharp => true }) ||RDC_icon_Sharp_16|Sharp corners in 3D
RDC_BEVEL|RoundCorner.launch(:RDC_BEVEL_, { :profile_type => ['C', 1] }) ||RDC_icon_Bevel_16|Bevel edges and corners
=======

the index code

ame=$launchitcmd.find{|n|n.index(params.to_s)}


so i change to just to return the command name to ruby.

2. I try to use the winole.so to connect to the access file ,and the Excel files ,it work well and fast, :D but it must work on the mechine which have install the sofeware.



2.
0

gavvy 
PluginStore Author
PluginStore Author
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby haynesc » Wed Jan 06, 2010 1:33 pm

how comes not all my plugins get loaded into the menu 'weld' is not there for eg ...
0

haynesc 
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby Edson » Wed Jan 06, 2010 4:50 pm

forgive me for being a bit on the dumb side, but this first post could declare what the plugin is supposed to do. it is only through reading the whole thread that one is able to understand its function.
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby arjunmax09 » Sun Feb 21, 2010 3:59 pm

hi a4chitect!! i installed your launchit plugin in my sketchup plugins folder... unfortunately when i start sketchup the following message appears

Error Loading File A4_launchit.rb
undefined method `file_loaded?' for #<Object:0xbd292d0 @ignorelist=["launchit", "indigo"]>


what should i do??
0
when you fail at something....you haven't really failed...you've found one way the thing will not work out

arjunmax09 
Banned
 

Re: [Plugin] LaunchIt (08 oct 2009)

Postby glro » Mon Aug 06, 2012 4:15 pm

This plugin seems a very good idea to me, because i experienced that too many icons make sketchup unstable

gavvy: I modified the original code as you have indicated, and it seems to work better, but i still have a problem:

If i uncheck "close?", the plugin seems to freeze, nothing happens; i can only use it once, and the box closes; each time i want to use it again, i have to open it again

Did you experience the same problem?
Is there a way to fix it?

To have only the plugins i want in the box, i just deleted the lines corresponding to the unwanted plugins in "plugins.rb", and deleted "builtin-pc.rb" and "builtin.rb"
0

glro 
 

Re: [Plugin] LaunchIt v 1.4 (14 oct 2009)

Postby glro » Mon Aug 06, 2012 5:54 pm

a4chitect wrote:[color=#4080BF]short tutorial:
installation: 1. extract the provided zip file into your Sketchup\Plugins folder

Future
...
3.allow the choice of closing after launch to be saved/remembered



This plugin might be a solution to the instability i noticed when too many icons are shown on sketchup screen

one minor problem: only one operation at a time, the dialog box can not stay opened, even if i uncheck the "close" rectangle

so i have to re open it each time i need it; any other solution?
0

glro 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: thinga, zul6041 and 24 guests

Visit our sponsors: