sketchucation logo sketchucation
    • Login
    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!
    ⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

    Ruby panel on/off

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 4 Posters 763 Views 4 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.
    • artmusicstudioA
      artmusicstudio
      last edited by

      hi,
      is there a way to hide the ruby panel from the code?

      switch on: Sketchup.send_action "showRubyPanel:" works.

      switch off : Sketchup.send_action "hideRubyPanel:" ?????

      thanx stan

      1 Reply Last reply
      Reply Quote 0
      • tt_suT
        tt_su
        last edited by

        What if there are multiple SketchUp windows open with the Ruby Console...?

        1 Reply Last reply
        Reply Quote 0
        • icehuliI
          icehuli
          last edited by

          @tt_su said:

          What if there are multiple SketchUp windows open with the Ruby Console...?

          It will not work perfectly.
          so.. update:

          
          require 'sketchup'
          require "Win32API"
          
          rb_console_title  = $suStrings.GetString("Ruby Console")
          winapi_FindWindow = Win32API.new("user32.dll", "FindWindow", ['P','P'], 'N')
          winapi_SendMessage = Win32API.new("user32.dll", "SendMessage", ['N','N','N','P'], 'N')
          winapi_GetWindowThreadProcessId = Win32API.new("user32.dll", "GetWindowThreadProcessId", ['N', 'P'], 'N')
          winapi_GetActiveWindow= Win32API.new("user32.dll", "GetActiveWindow", [], 'N')
          
          rb_console_window = winapi_FindWindow.call(0, rb_console_title)
          active_window = winapi_GetActiveWindow.call()
          active_pid = winapi_GetWindowThreadProcessId.call(active_window,0)
          rb_console_pid = winapi_GetWindowThreadProcessId.call(rb_console_window,0)
          
          winapi_SendMessage.call(rb_console_window,0x0010,0,"") if active_pid  == rb_console_pid 
          
          
          1 Reply Last reply
          Reply Quote 0
          • icehuliI
            icehuli
            last edited by

            On Windows PC:
            you can do it with WinAPI. The script is from https://sites.google.com/site/jimfoltz/my-sketchup-plugins/ruby-toolbar.

            check the better version two floors down

            
            require 'sketchup'
            require "Win32API"
            
            rb_console_title  = $suStrings.GetString("Ruby Console")
            winapi_findwindow = Win32API.new("user32.dll", "FindWindow", ['P','P'], 'N')
            winapi_sendmessage = Win32API.new("user32.dll", "SendMessage", ['N','N','N','P'], 'N')
            
            rb_console_window = winapi_findwindow.call(0, rb_console_title )
            #send the control a "WM_CLOSE" message (0x0010)
            winapi_sendmessage.call(rb_console_window,0x0010,0,"")
            
            
            
            1 Reply Last reply
            Reply Quote 0
            • artmusicstudioA
              artmusicstudio
              last edited by

              hey, very good idea to go with win.api

              i use this trick in my excel basic sound database to controll external programs from the code.
              i will try tonight and report!

              thanx stan

              1 Reply Last reply
              Reply Quote 0
              • tt_suT
                tt_su
                last edited by

                I remembered I'd been messing around with this myself a while back. For reference:
                https://bitbucket.org/thomthom/tt-library-2/src/80af18d802d2576f54016d3c48f61a5a31fc6fd9/TT_Lib2/win32.rb?at=Version%202.9#cl-220

                https://bitbucket.org/thomthom/tt-library-2/src/80af18d802d2576f54016d3c48f61a5a31fc6fd9/TT_Lib2/win32.rb?at=Version%202.9#cl-380

                1 Reply Last reply
                Reply Quote 0
                • artmusicstudioA
                  artmusicstudio
                  last edited by

                  @tt_su said:

                  I remembered I'd been messing around with this myself a while back. For reference:
                  https://bitbucket.org/thomthom/tt-library-2/src/80af18d802d2576f54016d3c48f61a5a31fc6fd9/TT_Lib2/win32.rb?at=Version%202.9#cl-220

                  https://bitbucket.org/thomthom/tt-library-2/src/80af18d802d2576f54016d3c48f61a5a31fc6fd9/TT_Lib2/win32.rb?at=Version%202.9#cl-380

                  hi,
                  from here the links are broken.
                  maybe only free for the "expert group" ?

                  regards stan

                  1 Reply Last reply
                  Reply Quote 0
                  • tt_suT
                    tt_su
                    last edited by

                    hm.. that looks like a SCF redirection error....

                    1 Reply Last reply
                    Reply Quote 0
                    • G
                      Gábor
                      last edited by

                      @tt_su said:

                      hm.. that looks like a SCF redirection error....

                      Redirect bug corrected. If the error message is cached, a browser cache-erase might be necessary.

                      1 Reply Last reply
                      Reply Quote 0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • 1 / 1
                      • First post
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement