sketchucation logo sketchucation
    • 登入
    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!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    [concept] plugin launcher

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    39 貼文 10 Posters 6.1k 瀏覽 10 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • A 離線
      Aerilius
      最後由 編輯

      Thank you so much for your efforts! I included it in the code. For me it used to work in my browsers/configurations, so otherwise I couldn't have found these solutions on my own.

      I did some search about comments between doctype and <html>, but didn't find anything about issues. I probably leave the comment completely away (or does it work with the comment after <html> ?)

      I was a bit hesitant about %(#000000)[input type="search"] because it's not standard (html4), but since unknown type defaults always to text, it shouldn't be a problem and doesn't break anything in Internet Explorer.

      1 條回覆 最後回覆 回覆 引用 0
      • Dan RathbunD 離線
        Dan Rathbun
        最後由 編輯

        @jim said:

        I put the doctype back in and removed just the comment - it worked.

        It IS a bit weird that the comment is outside the <html> block... I would put it inside the <head> block as well.

        I'm not here much anymore.

        1 條回覆 最後回覆 回覆 引用 0
        • D 離線
          driven
          最後由 編輯

          Hi all,

          I'm bumping this, because I want to modify it to work with 'on_off' http://forums.sketchucation.com/viewtopic.php?f=180&t=41994#p372262

          Using the option to open SU without rubies but with Ruby we have the ability to open individual .rbfiles or folders containing .rb files using Alex's + Jim's methods or load from RC, which is great.

          However if you want TIG's 2DTools [for example] you need to change all the 'requires' in all the scripts into 'load' + full the path before it will run with 'rubies' turned 'off'. I've got that working and it will still run as normal with them 'on', but would be a pain to do for each new version for all my rubies. I haven't worked out any of Fredo's yet, but I'm sure there's a way.

          So I'm thinking it would be a lot easier to parse the plugins each time you call one to 'load' and leave the originals intact,
          if it needs support files they can be added, but also need full path's.

          Basically, use 'LaunchUp' to select the 'standard' ruby rather then it's individual items,
          because you only need to have a few sets on at a time the toolbar count is still low.
          when you get to many you start again.

          I'm stumbling through so any feed back is appreciated.
          john

          learn from the mistakes of others, you may not live long enough to make them all yourself...

          1 條回覆 最後回覆 回覆 引用 0
          • A 離線
            Aerilius
            最後由 編輯

            Hi,
            This is very far from a proper plugin. Parsing other ruby files in order to get commands is not an ideal solution and needs always manual editing. I would not publish the current state as a plugin.

            I've played around with alternatives (should probably make my current version ready and post it here). I tried aliasing the UI::Command before all plugins load. Problem is that this way I modify core methods, I have to make sure that my plugin loads always first and it can be harmful if another plugin aliases UI::Command.

            Jim inspired me to get the commands with Objectspace, which works for all the command's metadata, but I haven't figured out how to call the proc.

            Third possibility is to continue hoping and begging for SU9 that we will have better access to commands (and maybe removing/modifying toolbars and menus).

            1 條回覆 最後回覆 回覆 引用 0
            • L 離線
              lapx
              最後由 編輯

              This idea deserves an award! I spend too much time trying to find certain commands and dealing with grey out issue.
              Is it necessary to create another plugin folder or can I just check not load at start up.
              Have'nt tried yet but appears to be a winning concept if it can work smoothly.

              1 條回覆 最後回覆 回覆 引用 0
              • D 離線
                driven
                最後由 編輯

                Hi Aerilius,

                thanks for replying

                I may have found a workaround for what I'm after using Fred's '000_AdditionalPluginFolders.rb' with 'on off.rb',

                I've made and registered some subfolders in SU, then when I launch with 'rubies OFF' and run '000_AdditionalPluginFolders.rb' I get asked which I want to instal, so I can choose 'Base Set', '2D', 'Fredo' or 'TIG', etc...

                This avoids having to look at or modify the rubies content at all and with a simple folder creator/sorter WebDialog this is almost doing what I want [on mac at least] and without any .rbs [but they can be accessed via a full startup].

                I'll keep digging
                john

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                1 條回覆 最後回覆 回覆 引用 0
                • J 離線
                  Jim
                  最後由 編輯

                  @aerilius said:

                  but I haven't figured out how to call the proc.

                  Once you have a reference to a proc, call call on it.

                  pr = Proc.new { puts "Hi" } pr.call Hi

                  Hi

                  1 條回覆 最後回覆 回覆 引用 0
                  • A 離線
                    Aerilius
                    最後由 編輯

                    But can I get the proc from Objectspace? I didn't get it to work...

                    1 條回覆 最後回覆 回覆 引用 0
                    • J 離線
                      Jim
                      最後由 編輯

                      @aerilius said:

                      But can I get the proc from Objectspace? I didn't get it to work...

                      Oh yeah. You can get UI::Command objects from ObjectSpace, but you can't get a handle to a Command's associated Proc.

                      You can get Proc objects from ObjectSpace

                      ObjectSpace.each_object(Proc) {|pr| puts pr }

                      But there is no handy way to know which command a Proc is associated with other than the String representation (which is the filename and line number where the command is created.)

                      So no "good" solution. I have asked Google for a method to access the Proc of a Command. That would make things sooo much simpler.

                      Hi

                      1 條回覆 最後回覆 回覆 引用 0
                      • dukejazzD 離線
                        dukejazz
                        最後由 編輯

                        Your idea of a launcher with a quick search, is something Im looking for. Type a search for any plugin/tool that you want to execute. If the plugin is not yet loaded, it will be loaded instantly.

                        "The basic purpose is to keep only a small range of standard plugins (=> quicker start of SketchUp and uncluttered interface), but make it easy to load rarely used plugins when you need them. You don't have to bother anymore if a plugin is disabled/archived or not."

                        You created a prototype. It uses an index file that contains a list of info.
                        This is your primiss. I did tryed your plugin and its a qood ideal.

                        There are several things your are worrying about:
                        " 1) It should be at least techinically possible to load any existing plugin that is disabled"

                        2)"But how to get the commands that should be executed, a proper name, icons, eventually keywords?" Well this is to much work for me?. I try to useing SUTool: a new way to manager your RB script but it dosn't load every thing. You have to double buffer everything "(since some plugins contain complex structures of classes and wrapper methods, not to speak of .rbs plugins)"
                        SUTool:
                        These were my ini files
                        01file.txt
                        02edit.txt
                        03toolbars.txt
                        04view.txt
                        05camera.txt
                        06draw.txt
                        07tool.txt
                        08plugins.txt
                        09context.txt

                        (Stage 1)
                        Is there a better solution? yes window/preferences_shortcuts,a dummy key, with a macro.ank, it would give API access to all commands created with UI::Command,

                        (Stage 2)
                        pic_0042.jpg

                        I will tell you how at My tips about running more than one sketchup
                        http://forums.sketchucation.com/viewtopic.php?f=79&t=40254

                        1 條回覆 最後回覆 回覆 引用 0
                        • thomthomT 離線
                          thomthom
                          最後由 編輯

                          @jim said:

                          @aerilius said:

                          But can I get the proc from Objectspace? I didn't get it to work...

                          Oh yeah. You can get UI::Command objects from ObjectSpace, but you can't get a handle to a Command's associated Proc.

                          You can get Proc objects from ObjectSpace

                          ObjectSpace.each_object(Proc) {|pr| puts pr }

                          But there is no handy way to know which command a Proc is associated with other than the String representation (which is the filename and line number where the command is created.)

                          So no "good" solution. I have asked Google for a method to access the Proc of a Command. That would make things sooo much simpler.

                          I have a proof of concept that intercepts the creation of Command objects and make everything available. Even the procs. I hooked into menu and toolbars as well so I could traverse them in a tree structure. I was able to do a string search of the commands, much like the described concept of OP. But I haven't released it as it would need testing and a robust error handling.

                          Thomas Thomassen — SketchUp Monkey & Coding addict
                          List of my plugins and link to the CookieWare fund

                          1 條回覆 最後回覆 回覆 引用 0
                          • A 離線
                            Aerilius
                            最後由 編輯

                            I had experimented with intercepting commands, but I found it too risky for me because I don't have enough Ruby experience. When there are two scripts intercepting the same methods, it would crash SketchUp.

                            Nice to see that this idea is becoming more common, it isn't really special. If only SketchUp made it's commands easierly accessible...
                            HUD.jpg
                            http://www.markshuttleworth.com/archives/939

                            1 條回覆 最後回覆 回覆 引用 0
                            • Dan RathbunD 離線
                              Dan Rathbun
                              最後由 編輯

                              One major problem: the menu_text is localized (or can be.)

                              We need a ruby_text attribute that is always English.

                              What I have been doing is attaching singleton methods for ruby_text to my individual command objects after instantiating them (to avoid changing the base class.)

                              It would be nice if extensions, menus and toolbars has this attribute also.

                              I'm not here much anymore.

                              1 條回覆 最後回覆 回覆 引用 0
                              • halroachH 離線
                                halroach
                                最後由 編輯

                                Is this plugin still under development?
                                The menu works very nicely, finding all the right plugins I'm looking for. But it's not working yet, is it?

                                I've tried launchit plugin v1.4 and it just doesn't find all the plugins I have installed...

                                eagerly waiting! 😄

                                FlexTools - Super Quick Windows, Doors, Slats...

                                1 條回覆 最後回覆 回覆 引用 0
                                • A 離線
                                  Aerilius
                                  最後由 編輯

                                  LaunchUp has never been released as a finished version and it's currently paused until the SketchUp Ruby API adds the required methods (ie. not more than UI::Command.proc). There hasn't been a SketchUp major release for quite some time (over 2½ years) but is coming soon. I hope it contains finally some advances.

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • D 離線
                                    driven
                                    最後由 編輯

                                    hi aerilius,

                                    can Win32 get the 'menu items' by name and send 'click on name in menu' events?

                                    I've got that working fully from 'osascript and in part from 'macRuby' in 'Ruby Console' so far, but curious if there's a PC equivalent.

                                    john

                                    learn from the mistakes of others, you may not live long enough to make them all yourself...

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • thomthomT 離線
                                      thomthom
                                      最後由 編輯

                                      Should be possible with the Win32 API.

                                      Thomas Thomassen — SketchUp Monkey & Coding addict
                                      List of my plugins and link to the CookieWare fund

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • D 離線
                                        driven
                                        最後由 編輯

                                        here's a 'mac' test in a Ui.messagebox, but it can work from a Toolbar button or a Webdialog, so LaunchUp can be populated with any/all of the available menu items, I can add a new 'plugin' then auto update the 'list' in use. I can harvest most images files grep-ing the menu name in it's host folder from the 'load paths' array.

                                        if this type of 'thing' is possible with win32 API maybe someone wants to combine forces for a duel platform solution?

                                         result = UI.messagebox "Do you want to Weld these edges?", MB_YESNO
                                         if result == 6 # Yes
                                           runAppleScript=Thread.new{
                                        `osascript <<EOF
                                        activate application "Sketchup"
                                        tell application "System Events"
                                        	tell process "SketchUp"
                                        		click menu item "Weld" of menu "Plugins" of menu bar 1
                                        	end tell
                                        end tell
                                        EOF
                                        `
                                        }
                                        runAppleScript.kill
                                         end
                                        

                                        learn from the mistakes of others, you may not live long enough to make them all yourself...

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • A 離線
                                          Aerilius
                                          最後由 編輯

                                          If your were interested in LaunchUp, don't miss that it is no an official plugin:
                                          → LaunchUp – A Quick Launcher for SketchUp

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • 1
                                          • 2
                                          • 2 / 2
                                          • 第一個貼文
                                            最後的貼文
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement