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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    [Plugin] Ruby Toolbar

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

      Ruby Toolbar

      About

      Ruby Toolbar provides some controls over SketchUp's Ruby Panel (or Console.) It is most useful to people who are writing Ruby plugins.

      This is a Windows-only plugin.

      The 5 toolbar buttons are shown below.

      https://sites.google.com/site/jimfoltz/sketchup/my-sketchup-plugins/ruby-toolbar/0936.png?attredirects=0

      They are:

      [ Show/Hide Ruby Console | Clear Console | Load a .rb | Reload last .rb | Browse Plugins Folder ]

      If someone wanted to contribute some good, meaningful icons I'd be grateful.

      The position and size of the console is saved to the Windows Registry when the console is hidden using the toolbar, and restored between sessions.

      Requirements

      • Sketchup
      • Windows
      • Win32API.so (if not already installed.)

      Installation

      Download the .zip file, extact the files, and move them into your Plugins directory.

      Didier, this is actually an update of the RubyPanelToolbar you have archived on your site.

      Download and info here

      Hi

      1 條回覆 最後回覆 回覆 引用 0
      • Didier BurD 離線
        Didier Bur
        最後由 編輯

        Cool 😆
        very VERY VERY useful tool,
        Thanks a lot from all the developers !

        hem hem 😮 😳 where's the gem ? (didn't find it at Sketchy Endeavors 😠 )

        DB

        1 條回覆 最後回覆 回覆 引用 0
        • T 離線
          tomasz
          最後由 編輯

          Jim,

          Am I blind already? Description of your tool is so interesting ... but where is the link 😆
          Thanks a lot!

          Tomasz

          Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

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

            Oops, that was a major omission. I've added the attachment to the original post.

            Hi

            1 條回覆 最後回覆 回覆 引用 0
            • N 離線
              not registered yet
              最後由 編輯

              When I extracted your .zip file, KI restarted SketchUp and I`can't find it!!! Will you please Bugfix it?

              [Invader ZIM]

              1 條回覆 最後回覆 回覆 引用 0
              • jujuJ 離線
                juju
                最後由 編輯

                ZIM - some toolbars need to be activated under the "view" menu. Have a look to see if this is the case.

                Save the Earth, it's the only planet with chocolate.

                1 條回覆 最後回覆 回覆 引用 0
                • Didier BurD 離線
                  Didier Bur
                  最後由 編輯

                  Jim,
                  I'm having the "blank icons syndrom" (all png's are in Plugins folder)
                  The line that seems to cause the problem is:

                  imgdir = File.join(File.dirname(FILE), File.basename(FILE, ".rb"))

                  It returns: ./(eval)
                  then the icon file location File.join(imgdir, "rubypanel.png") returns: ./(eval)/rubypanel.png

                  Please help !

                  The 'toggle' method doesn't work also. 😠 At least in V5.
                  Question: Is findWindow.call(0,"Ruby Console") rely on language settings of SU ? I mean is "Ruby Console" available just for english versions of SU ? In this case the win32api call will not work with other platforms.

                  P.S.:

                  UI.openURL("c;\\program files\\google\\google sketchup 6\\plugins")
                  

                  A non hard-coded command would be handy. Why not get this path from the registry ? Or something like:

                  su_ver = Sketchup.version.split(".")[0].to_i
                  if su_ver < 6
                  devdir = File.dirname(Sketchup.find_support_file("sketchup.exe")) + "\Plugins"
                  else
                  devdir = ...
                  end

                  This makes the command compatible for SU5 and 6 (I guess), no matter where the user has installed SU.

                  Regards,

                  DB

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

                    @didier bur said:

                    Jim,
                    I'm having the "blank icons syndrom" (all png's are in Plugins folder)
                    The line that seems to cause the problem is:

                    imgdir = File.join(File.dirname(FILE), File.basename(FILE, ".rb"))

                    It returns: ./(eval)
                    then the icon file location File.join(imgdir, "rubypanel.png") returns: ./(eval)/rubypanel.png

                    Please help !

                    Didier, I'm, not sure why it works on my computer but not yours. I have updated the script to use a method that will hopefully be more robust. There should be a rubytoolbar folder in which the images are located.

                    @didier bur said:

                    The 'toggle' method doesn't work also. 😠 At least in V5.
                    Question: Is findWindow.call(0,"Ruby Console") rely on language settings of SU ? I mean is "Ruby Console" available just for english versions of SU ? In this case the win32api call will not work with other platforms.

                    This could very well be the case. If you have Ruby installed, you could try your local verion of Win32API.so located in C:\ruby\lib\ruby\1.8\i386-mswin32\Win32API.so.

                    What is the title text of your Ruby Console window? Is it English "Ruby Console", or maybe French? I think findWindow is using the name of the window.

                    @didier bur said:

                    P.S.:

                    UI.openURL("c;\\program files\\google\\google sketchup 6\\plugins")
                    

                    A non hard-coded command would be handy. Why not get this path from the registry ? Or something like:

                    su_ver = Sketchup.version.split(".")[0].to_i
                    if su_ver < 6
                    devdir = File.dirname(Sketchup.find_support_file("sketchup.exe")) + "\Plugins"
                    else
                    devdir = ...
                    end
                    This makes the command compatible for SU5 and 6 (I guess), no matter where the user has installed SU.

                    I use the find_support_file method; good idea.

                    Thank you for the report, and your patience. Please download and try the updates.

                    Hi

                    1 條回覆 最後回覆 回覆 引用 0
                    • Didier BurD 離線
                      Didier Bur
                      最後由 編輯

                      Hi Jim,
                      Thanks for the update: icons are there now 😄

                      Show/Hide console doesn't work 😕 (not very important)
                      Clear console only moves the text in the console 1 line up 8O

                      The title of the Ruby console window in french is "Console Ruby". This could cause the problem...
                      But the most important command "Reload script" works OK since the first version 😛

                      Thanks again for this very useful tool,
                      Regards,

                      DB

                      1 條回覆 最後回覆 回覆 引用 0
                      • GaieusG 離線
                        Gaieus
                        最後由 編輯

                        @didier bur said:

                        ...The title of the Ruby console window in french is "Console Ruby". This could cause the problem...

                        Thank God I don't need to deal with a "native" version of SU! 😄

                        Gai...

                        1 條回覆 最後回覆 回覆 引用 0
                        • Didier BurD 離線
                          Didier Bur
                          最後由 編輯

                          Everything's OK with the french version now, including toggle
                          Only minor tweaks were necessary 😆

                          DB

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

                            @didier bur said:

                            Everything's OK with the french version now, including toggle
                            Only minor tweaks were necessary 😆

                            Great! But would you mind sharing the minor tweaks so maybe I can make the toolbar more international?

                            Hi

                            1 條回覆 最後回覆 回覆 引用 0
                            • Didier BurD 離線
                              Didier Bur
                              最後由 編輯

                              Hi Jim,

                              @unknownuser said:

                              would you mind sharing the minor tweaks

                              I'm afraid it would be useless because I simply replaced all the calls to "Ruby Console" by "Console Ruby", but that's only for french. Each version of SU does have a particular name for the Ruby Console, so... Even a call to langhandler.rb (with 'getstring') will not work since this deals with a window name, not a message string or such. 😞

                              Regards,

                              DB

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

                                @didier bur said:

                                Hi Jim,

                                @unknownuser said:

                                would you mind sharing the minor tweaks

                                I'm afraid it would be useless because I simply replaced all the calls to "Ruby Console" by "Console Ruby", but that's only for french. Each version of SU does have a particular name for the Ruby Console, so... Even a call to langhandler.rb (with 'getstring') will not work since this deals with a window name, not a message string or such. 😞

                                Regards,

                                Didier, GetString would work, but since it's only one string, I won't use LangHandler. I've updated the plugin to support FR.

                                Hi

                                1 條回覆 最後回覆 回覆 引用 0
                                • C 離線
                                  CPhillips
                                  最後由 編輯

                                  Hi Jim,

                                  I love this toolbar. I use it constantly.

                                  Feature request: How about saving the state and position of the console in the registry? So if I close and reopen Sketchup it remembers if the console was open and where it was.

                                  Also If you want I could give you the code to read the console log window. Saving is the only use I can think of. But maybe it could be parsed to some effect.

                                  Chris

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

                                    Thanks Chris,

                                    The version I posted on SketchyUtils isn't up-to-date, I'll remove it. Download the version available in this thread.

                                    The position and size are saved in the registry, but only if the console is closed using the toolbar. Is it possible to save these settings if the console is closed using the X widget?

                                    Hi

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • C 離線
                                      CPhillips
                                      最後由 編輯

                                      Ah, much better. Yeah I was still using the old one.

                                      I didn't even know this subsection of the forums was here until yesterday.

                                      As far as detecting the window close message. It wouldn't be easy. One thing you could do is just check the position of the window ever 10 sec or so and see if it has moved/closed.

                                      Regards
                                      Chris

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • pilouP 離線
                                        pilou
                                        最後由 編輯

                                        Why put the "ruby console" and not the "Web Console" of Jim Foltz?
                                        Seems it is more easy using? 😄
                                        (but I am totally new beginner in Ruby script 💚

                                        PS With the Webconsole seems you can't save (bug ?) 😮

                                        Frenchy Pilou
                                        Is beautiful that please without concept!
                                        My Little site :)

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • B 離線
                                          BTM
                                          最後由 編輯

                                          @unknownuser said:

                                          Why put the "ruby console" and not the "Web Console" of Jim Foltz?
                                          Seems it is more easy using? 😄
                                          (but I am totally new beginner in Ruby script 💚

                                          PS With the Webconsole seems you can't save (bug ?) 😮

                                          You can save, it just doesn't say that you have the same file open after that. it's weird.

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

                                            Maybe I should combine the 2 plugins into 1?

                                            Hi

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

                                            Advertisement