sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Ruby panel on/off

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 4 Posters 407 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 Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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 Offline
                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 Offline
                  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 Offline
                    tt_su
                    last edited by

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

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      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
                      • 1 / 1
                      • First post
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement