Ruby panel on/off
-
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
-
What if there are multiple SketchUp windows open with the Ruby Console...?
-
@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 -
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,"") -
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
-
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 -
@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-220hi,
from here the links are broken.
maybe only free for the "expert group" ?regards stan
-
hm.. that looks like a SCF redirection error....
-
@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.
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 LoginAdvertisement