Module: AMS::Sketchup
- Defined in:
- Documentation/ams/sketchup.rb
Overview
Windows only!
The Sketchup namespace contains functions that allow user to get various information on SketchUp window and its child windows.
Class Method Summary collapse
-
.activate ⇒ Boolean
(also: bring_to_top)
Set main window active.
-
.activate_scenes_bar_tab(tab_index) ⇒ Boolean
Activate (highlight) scene tab without activating the associated page.
-
.add_observer(object) ⇒ Boolean
Add object to the observers list.
-
.close ⇒ Boolean
Close current SketchUp application.
-
.close_dialogs ⇒ Fixnum
Close all dialogs and trays.
-
.close_toolbars ⇒ Fixnum
Close all floating toolbars.
-
.close_trays ⇒ Fixnum
Close all trays.
-
.find_child_window_by_caption(parent_handle, caption, include_sub_childs = false, full_match = true, case_sensitive = true) ⇒ Fixnum?
Find handle to a child window with a specific caption.
-
.find_child_window_by_class_name(parent_handle, class_name, include_sub_childs = false, full_match = true, case_sensitive = true) ⇒ Fixnum?
Find handle to a child window with a specific class name.
-
.find_window_by_caption(caption, full_match = true, case_sensitive = true) ⇒ Fixnum?
Find handle to a window with a specific caption.
-
.find_window_by_class_name(class_name, full_match = true, case_sensitive = true) ⇒ Fixnum?
Find handle to a window with a specific class name.
-
.get_active_dialogs ⇒ Array<Fixnum>
Get all used pop-up windows of the current SketchUp application.
-
.get_active_toolbars ⇒ Array<Fixnum>
Get all used floating toolbars.
-
.get_caption ⇒ String
Get main window title text.
-
.get_dialogs ⇒ Array<Fixnum>
Get all pop-up windows of the current SketchUp application.
-
.get_executable_path ⇒ String
Get full path to SketchUp.exe.
-
.get_executalbe_name ⇒ String
Get executable name of this application.
-
.get_main_window ⇒ Fixnum
Get handle to the main window of the current SketchUp application.
-
.get_menu_bar ⇒ Fixnum
Get handle to the menu bar of the main window.
-
.get_module_handle ⇒ Fixnum
Get module handle to the current SketchUp application.
-
.get_other_main_windows ⇒ Array<Fixnum>
Get handles to all SketchUp main windows, except for the current one.
-
.get_process_id ⇒ Fixnum
Get process id of the current SketchUp application.
-
.get_registry_path ⇒ String
Get registry path of the current SketchUp application.
-
.get_scenes_bar ⇒ Fixnum
Get handle to the scenes bar of the main window.
-
.get_status_bar ⇒ Fixnum
Get handle to the status bar of the main window.
-
.get_thread_id ⇒ Fixnum
Get thread id of the current SketchUp application.
-
.get_toolbar_containers ⇒ Array<Fixnum>
Get handles to the four toolbar containers of the main window.
-
.get_toolbars ⇒ Array<Fixnum>
Get all floating toolbars of the current SketchUp application.
-
.get_viewport ⇒ Fixnum
Get handle to the view window of the main window.
-
.get_viewport_center ⇒ Array<Fixnum>
Get viewport center in screen coordinates.
-
.get_viewport_origin ⇒ Array<Fixnum>
Get upper-left corner of the view window in screen coordinates.
-
.get_viewport_rect ⇒ Array<Fixnum>
Get upper-left and lower-right corners of the view window in screen coordinates, relative to the upper-left corner of the screen.
-
.get_viewport_size ⇒ Array<Fixnum>
Get width and height of the view window in pixels.
-
.get_visible_dialogs ⇒ Array<Fixnum>
Get all visible pop-up windows of the current SketchUp application.
-
.get_visible_toolbars ⇒ Array<Fixnum>
Get all visible floating toolbars of the current SketchUp application.
-
.ignore_dialog(handle) ⇒ Boolean
Elude dialog from the Sketchup.show_dialogs and Sketchup.close_dialogs operations.
-
.ignore_toolbar(handle) ⇒ Boolean
Elude toolbar from the Sketchup.show_toolbars and Sketchup.close_toolbars operations.
-
.include_dialog(handle) ⇒ Boolean
Include dialog in the Sketchup.show_dialogs and Sketchup.close_dialogs operations.
-
.include_toolbar(handle) ⇒ Boolean
Include toolbar in the Sketchup.show_toolbars and Sketchup.close_toolbars operations.
-
.is_active? ⇒ Boolean
Determine whether the current active window belongs to the current SketchUp application.
-
.is_full_screen? ⇒ Boolean
Determine whether main window is full screen.
-
.is_main_window_active? ⇒ Boolean
Determine whether SketchUp main window is active.
-
.is_maximized? ⇒ Boolean
Determine whether main window is maximized.
-
.is_menu_bar_set? ⇒ Boolean
Determine whether menu bar is set.
-
.is_minimized? ⇒ Boolean
Determine whether main window is minimized.
-
.is_restored? ⇒ Boolean
Determine whether main window is restored.
-
.is_scenes_bar_empty? ⇒ Boolean
Determine whether scenes bar is empty.
-
.is_scenes_bar_filled? ⇒ Boolean
Determine whether scenes bar is filled.
-
.is_scenes_bar_visible? ⇒ Boolean
Determine whether scenes bar is visible.
-
.is_status_bar_visible? ⇒ Boolean
Determine whether status bar is visible.
-
.is_toolbar_container_empty?(bar) ⇒ Boolean
Determine whether toolbar container(s) is/are empty.
-
.is_toolbar_container_filled?(bar) ⇒ Boolean
Determine whether toolbar container(s) is/are filled.
-
.is_toolbar_container_visible?(bar) ⇒ Boolean
Determine whether toolbar container(s) is/are visible.
-
.is_viewport_border_set? ⇒ Boolean
Determine whether viewport border is set.
-
.maximize ⇒ Boolean
Set main window maximized.
-
.minimize ⇒ Boolean
Set main window minimized.
-
.refresh ⇒ Boolean
Refresh the current SketchUp application.
-
.remove_observer(object) ⇒ Boolean
Remove object from the observers list.
-
.restore ⇒ Boolean
Set main window to normal placement.
-
.send_user_message(receiver_handle, id, user_data) ⇒ Boolean
Send information to another window.
-
.set_caption(caption) ⇒ Boolean
Set main window title text.
-
.set_menu_bar(state) ⇒ Boolean
Set/Remove menu bar.
-
.set_viewport_border(state) ⇒ Boolean
Set/Remove viewport border, a thin edge surrounding the view.
-
.show_dialogs(state) ⇒ Fixnum
Show/hide all dialogs and trays.
-
.show_scenes_bar(state, refresh = true) ⇒ Boolean
Show/hide scenes bar.
-
.show_status_bar(state, refresh = true) ⇒ Boolean
Show/hide status bar.
-
.show_toolbar_container(bar, state, refresh = true) ⇒ Boolean
Show/hide toolbar container(s).
-
.show_toolbars(state) ⇒ Fixnum
Show/hide all floating toolbars.
-
.show_trays(state) ⇒ Fixnum
Show/hide all trays.
-
.switch_full_screen(state, reset_mode = 2, set_mode = 1) ⇒ Boolean
Switch main window full screen.
-
.threaded_messagebox(caption, text, type = 0x00002030, owner_handle = nil) {|result| ... } ⇒ Fixnum?
Display a messagebox on a separate thread.
Class Method Details
.activate ⇒ Boolean Also known as: bring_to_top
Set main window active.
.activate_scenes_bar_tab(tab_index) ⇒ Boolean
Activate (highlight) scene tab without activating the associated page.
.add_observer(object) ⇒ Boolean
An observer can be a class, module, or a class instance. Your observer will work as long as the callback methods are public.
Your observer is not supposed to contain every callback method from the observers list. You may include/elude those as you wish.
A unique extension swp
or swo
is added in front
of each observer method. SWP stands for Sketchup Window Procedure, and SWO
stands for Sketchup Window Observer. Both SWP and SWO events are capable to
monitor window messages, but SWP events are also capable to make decisions
to the message, whether or not the message should interact with SketchUp
window. If the return value for the SWP callback method is 1, the message
associated with the event will not interact with SketchUp window. For
example, returning 1 in the swp_on_key_down event will prevent the key from
interacting with SketchUp window, which means any shortcut associated with
such key will not be triggered. SWP events may come in handy for extensions
that want more control over SketchUp.
Add object to the observers list.
.close ⇒ Boolean
This behaves the same way as clicking the 'X' button.
Close current SketchUp application.
.close_dialogs ⇒ Fixnum
Ignored dialogs won't be included in this operation.
Close all dialogs and trays.
.close_toolbars ⇒ Fixnum
Close all floating toolbars.
.close_trays ⇒ Fixnum
Close all trays.
.find_child_window_by_caption(parent_handle, caption, include_sub_childs = false, full_match = true, case_sensitive = true) ⇒ Fixnum?
This function will iterate through windows belonging to the current SketchUp process only. All windows belonging to a different process or a different SketchUp application will not be searched.
Find handle to a child window with a specific caption.
.find_child_window_by_class_name(parent_handle, class_name, include_sub_childs = false, full_match = true, case_sensitive = true) ⇒ Fixnum?
This function will iterate through windows belonging to the current SketchUp process only. All windows belonging to a different process or a different SketchUp application will not be searched.
Find handle to a child window with a specific class name.
.find_window_by_caption(caption, full_match = true, case_sensitive = true) ⇒ Fixnum?
This function will iterate through windows belonging to the current SketchUp process only. All windows belonging to a different process or a different SketchUp application will not be searched.
Find handle to a window with a specific caption.
.find_window_by_class_name(class_name, full_match = true, case_sensitive = true) ⇒ Fixnum?
This function will iterate through windows belonging to the current SketchUp process only. All windows belonging to a different process or a different SketchUp application will not be searched.
Find handle to a window with a specific class name.
.get_active_dialogs ⇒ Array<Fixnum>
Ignored dialogs are not included in this list.
Get all used pop-up windows of the current SketchUp application.
.get_active_toolbars ⇒ Array<Fixnum>
Ignored toolbars are not included in this list.
Get all used floating toolbars.
.get_caption ⇒ String
Get main window title text.
.get_dialogs ⇒ Array<Fixnum>
Ignored dialogs are not included in this list.
Get all pop-up windows of the current SketchUp application.
.get_executable_path ⇒ String
Get full path to SketchUp.exe.
.get_executalbe_name ⇒ String
Get executable name of this application. In most cases it would be “SketchUp.exe”.
.get_main_window ⇒ Fixnum
Get handle to the main window of the current SketchUp application.
.get_menu_bar ⇒ Fixnum
Get handle to the menu bar of the main window.
.get_module_handle ⇒ Fixnum
Get module handle to the current SketchUp application.
.get_other_main_windows ⇒ Array<Fixnum>
Get handles to all SketchUp main windows, except for the current one.
.get_process_id ⇒ Fixnum
Get process id of the current SketchUp application.
.get_registry_path ⇒ String
Get registry path of the current SketchUp application.
.get_scenes_bar ⇒ Fixnum
Get handle to the scenes bar of the main window.
.get_status_bar ⇒ Fixnum
Get handle to the status bar of the main window.
.get_thread_id ⇒ Fixnum
Get thread id of the current SketchUp application.
.get_toolbar_containers ⇒ Array<Fixnum>
Get handles to the four toolbar containers of the main window.
.get_toolbars ⇒ Array<Fixnum>
Ignored toolbars are not included in this list.
Get all floating toolbars of the current SketchUp application.
.get_viewport ⇒ Fixnum
Get handle to the view window of the main window.
.get_viewport_center ⇒ Array<Fixnum>
Get viewport center in screen coordinates.
.get_viewport_origin ⇒ Array<Fixnum>
Get upper-left corner of the view window in screen coordinates.
.get_viewport_rect ⇒ Array<Fixnum>
Get upper-left and lower-right corners of the view window in screen coordinates, relative to the upper-left corner of the screen.
.get_viewport_size ⇒ Array<Fixnum>
This is same as view.vp_width
and view.vp_height
.
Get width and height of the view window in pixels.
.get_visible_dialogs ⇒ Array<Fixnum>
Ignored dialogs are not included in this list.
Get all visible pop-up windows of the current SketchUp application.
.get_visible_toolbars ⇒ Array<Fixnum>
Ignored toolbars are not included in this list.
Get all visible floating toolbars of the current SketchUp application.
.ignore_dialog(handle) ⇒ Boolean
Elude dialog from the show_dialogs and close_dialogs operations.
.ignore_toolbar(handle) ⇒ Boolean
Elude toolbar from the show_toolbars and close_toolbars operations.
.include_dialog(handle) ⇒ Boolean
By default, all dialogs are included in the show/hide/close dialogs operation. This method is used to remove dialog from the ignore list.
Include dialog in the show_dialogs and close_dialogs operations.
.include_toolbar(handle) ⇒ Boolean
By default, all toolbars are included in the show/hide/close toolbars operation. This method is used to remove toolbar from the ignore list.
Include toolbar in the show_toolbars and close_toolbars operations.
.is_active? ⇒ Boolean
Determine whether the current active window belongs to the current SketchUp application.
.is_full_screen? ⇒ Boolean
Determine whether main window is full screen.
.is_main_window_active? ⇒ Boolean
Determine whether SketchUp main window is active.
.is_maximized? ⇒ Boolean
Determine whether main window is maximized.
.is_menu_bar_set? ⇒ Boolean
Determine whether menu bar is set.
.is_minimized? ⇒ Boolean
Determine whether main window is minimized.
.is_restored? ⇒ Boolean
Determine whether main window is restored.
.is_scenes_bar_empty? ⇒ Boolean
Determine whether scenes bar is empty. Scenes bar is empty if there are no pages in the model.
.is_scenes_bar_filled? ⇒ Boolean
Determine whether scenes bar is filled. Scenes bar is filled if there is at least one page in the model.
.is_scenes_bar_visible? ⇒ Boolean
Determine whether scenes bar is visible.
.is_status_bar_visible? ⇒ Boolean
Determine whether status bar is visible.
.is_toolbar_container_empty?(bar) ⇒ Boolean
Determine whether toolbar container(s) is/are empty.
.is_toolbar_container_filled?(bar) ⇒ Boolean
Determine whether toolbar container(s) is/are filled.
.is_toolbar_container_visible?(bar) ⇒ Boolean
Determine whether toolbar container(s) is/are visible.
.is_viewport_border_set? ⇒ Boolean
Determine whether viewport border is set.
.maximize ⇒ Boolean
Set main window maximized.
.minimize ⇒ Boolean
Set main window minimized.
.refresh ⇒ Boolean
Refresh the current SketchUp application.
.remove_observer(object) ⇒ Boolean
Remove object from the observers list.
.restore ⇒ Boolean
Set main window to normal placement.
.send_user_message(receiver_handle, id, user_data) ⇒ Boolean
If a destination window that a message is sent to by this function has an
active swo_on_user_message
observer, in most cases, it will
receive the message sent by this function; otherwise, it wont.
This function waits until the receiving window completes processing a message before returning.
32-bit SU windows cannot communicate to 64-bit SU windows; However, 64-bit
SU windows can communicate to 32-bit SU windows. For example, assume you
have two SU windows open, SU2014 (32-bit) and SU2016 (64-bit). Calling
send_user_message
from the SU2014 window to the SU2016 window,
will not succeed in the SU2016 window receiving the message. However, if
you call send_user_message
from the SU2016 window to the
SU2014 window, the message will succeed in being received by the SU2014
window.
Send information to another window.
.set_caption(caption) ⇒ Boolean
Set main window title text.
.set_menu_bar(state) ⇒ Boolean
Set/Remove menu bar.
.set_viewport_border(state) ⇒ Boolean
Set/Remove viewport border, a thin edge surrounding the view.
.show_dialogs(state) ⇒ Fixnum
Ignored dialogs won't be included in this operation.
Show/hide all dialogs and trays.
.show_scenes_bar(state, refresh = true) ⇒ Boolean
Show/hide scenes bar.
.show_status_bar(state, refresh = true) ⇒ Boolean
Show/hide status bar.
.show_toolbar_container(bar, state, refresh = true) ⇒ Boolean
Show/hide toolbar container(s).
.show_toolbars(state) ⇒ Fixnum
Show/hide all floating toolbars.
.show_trays(state) ⇒ Fixnum
Show/hide all trays.
.switch_full_screen(state, reset_mode = 2, set_mode = 1) ⇒ Boolean
Switch main window full screen.
.threaded_messagebox(caption, text, type = 0x00002030, owner_handle = nil) {|result| ... } ⇒ Fixnum?
Any errors occurring in the threaded block will be ignored.
Display a messagebox on a separate thread.