Module: Sketchup
Overview
The Sketchup module contains a number of important utility methods for use in your Ruby scripts. Many of the classes in the API are implemented beneath this module. You can think of the Sketchup
module as the “root” of the application tree. Most ruby calls start from the currently active model, and this is accessed via the Sketchup
.active_model method.
Class Attribute Summary
-
.break_edges=(enabled) ⇒ Boolean
rw
The break_edges= method can be used to disable or enable the break edges feature.
-
.break_edges? ⇒ Boolean
rw
The break_edges? method indicates whether the break edges feature is currently turned on.
-
.debug_mode=(enabled) ⇒ Boolean
rw
The debug_mode= method lets you controls whether SketchUp will output warnings to the console when it detects incorrect usage of the API.
-
.debug_mode? ⇒ Boolean
rw
The debug_mode? controls whether SketchUp will output warnings to the console when it detects incorrect usage of the API.
-
.fix_shadow_strings=(enabled) ⇒ Boolean
rw
The fix_shadow_strings= method lets you control whether shadow rendering attempts to fix an artifact commonly referred to as “strings”.
-
.fix_shadow_strings? ⇒ Boolean
rw
The fix_shadow_strings? method indicates whether the a fix for a shadow rendering artifact commonly referred to as “strings” is enabled.
-
.is_64bit? ⇒ Boolean
readonly
This methods indicates whether the host SketchUp application is 64bit.
-
.is_pro? ⇒ Boolean
readonly
Returns a boolean flag indicating whether the application is SketchUp Pro.
-
.plugins_disabled=(enabled) ⇒ Boolean
rw
The plugins_disabled= method lets you control whether SketchUp will load Ruby scripts from the plugins directory at startup time.
-
.plugins_disabled? ⇒ Boolean
rw
The plugins_disabled? method indicates whether Ruby scripts in the plugins directory will be loaded at startup time.
-
.status_text=(status_text) ⇒ String
writeonly
The status_text= method is used to set the text appearing on the status bar within the drawing window.
-
.template ⇒ String
rw
The template method is used to get the file name of the current template.
-
.template=(filename) ⇒ String
rw
The template= method is used to set the file name of the current template.
-
.vcb_label=(label_text) ⇒ String
writeonly
The vcb_label= method is used to set the label that appears on the vcb, or the “value control box”, which is another word for the “measurements” text entry box that appears at the bottom on the SketchUp window.
-
.vcb_value=(value) ⇒ String
writeonly
The vcb_value= method is used to set the value that appears on the vcb, or the “value control box”, which is another word for the “measurements” text entry box that appears at the bottom on the SketchUp window.
Class Method Summary
-
.active_model ⇒ Sketchup::Model
The active_model method returns the currently active SketchUp model.
-
.add_observer(observer) ⇒ Boolean
The add_observer method is used to add an observer to the current object.
-
.app_name ⇒ String
The app_name method is used to retrieve the current application name.
-
.create_texture_writer ⇒ Sketchup::TextureWriter
The create_texture_writer method is used to create a
TextureWriter
object. -
.display_name_from_action(action_name) ⇒ String
The display_name_from_action method is used to gets a user-friendly name from an action string.
-
.extensions ⇒ Sketchup::ExtensionsManager
Returns the
ExtensionsManager
where you can find all registered::SketchupExtension
objects. -
.file_new ⇒ Module
The file_new method is used to create a new file.
-
.find_support_file(filename, directory) ⇒ String
The find_support_files method is used to retrieve the relative path and name of a file within the SketchUp installation directory.
-
.find_support_files(filename, directory) ⇒ Array<String>
The find_support_files method is used to retrieve the path and name of all matching files within the SketchUp installation directory.
-
.focus
The .focus method is used to focus the active model window.
-
.format_angle(number) ⇒ String
The format_angle method takes a number as an angle in radians and formats it into degrees.
-
.format_area(number) ⇒ String
The .format_area method formats a number as an area using the current units settings.
-
.format_degrees(number) ⇒ String
The format_degrees method formats a number as an angle given in degrees.
-
.format_length(number) ⇒ String
The .format_length method formats a number as a length using the current units settings.
-
.format_volume(number) ⇒ String
The .format_volume method formats a number as a volume using the current units settings.
-
.get_datfile_info(key, default_value) ⇒ String
The get_datfile_info method is used to retrieve the value for the given key from
Sketchup
.dat. -
.get_i18n_datfile_info(key, default_value) ⇒ String
The .get_i18n_datfile_info method is used to retrieve the value for the given key from the internationalization file that SketchUp uses to work in multiple languages.
-
.get_locale ⇒ String
The os_language method returns the language code for the language SketchUp is running in.
-
.get_resource_path(filename) ⇒ String
The get_resource_path is used to retrieve the directory where “resource” files are stored by SketchUp.
-
.get_shortcuts ⇒ Array<String>
The get_shortcuts method retrieves an array of all keyboard shortcuts currently registered with SketchUp.
-
.install_from_archive(filepath, show_warning = true) ⇒ Boolean
Installs the contents of a ZIP archive file into SketchUp’s Plugins folder.
-
.is_online ⇒ Boolean
The is_online method is used to verify a connection to the Internet.
-
.is_valid_filename?(filename) ⇒ Boolean
The is_valid_filename? method is used to determine whether a filename contains illegal characters.
-
.load(path) ⇒ Boolean
The load method is used to include encrypted and nonencrypted ruby files.
-
.open_file(filename) ⇒ Boolean
The .open_file method is used to open a SketchUp model.
-
.os_language ⇒ String
The os_language method returns the language code for the language SketchUp is running in.
-
.parse_length(string) ⇒ Float
The parse_length method parses a string as a length.
-
.platform ⇒ Symbol
This methods returns a symbol indicating the current platform.
-
.quit ⇒ Object
The quit method is used to terminate the application.
-
.read_default(section, variable, default = nil) ⇒ Object?
The read_default method is used to retrieve the string associated with a value within the specified sub-section section of a .INI file or registry (within the Software > SketchUp > SketchUp [Version] section).
-
.redo ⇒ nil
The redo method is used redo the last transaction on the redo stack.
-
.register_extension(extension, load_on_start = false) ⇒ Boolean
The register_extension method is used to register an extension with SketchUp’s extension manager (in SketchUp preferences).
-
.register_importer(importer) ⇒ Boolean
The register_importer method is used to register an importer with SketchUp.
-
.remove_observer(observer) ⇒ Boolean
The remove_observer method is used to remove an observer from the current object.
-
.require(path) ⇒ Boolean
The require method is used to include encrypted and nonencrypted ruby files.
-
.resize_viewport(model, width, height) ⇒ Boolean
The .resize_viewport method changes the pixel size of the viewport and SketchUp window.
-
.save_thumbnail(skp_filename, img_filename) ⇒ Boolean
The save_thumbnail method is used to generate a thumbnail for any SKP file - not necessarily the loaded model.
-
.send_action(action) ⇒ Boolean
The send_action method sends a message to the message queue to perform some action asynchronously.
-
.send_to_layout(file) ⇒ Boolean
The .send_to_layout method is used to open a file in LayOut.
-
.set_status_text ⇒ nil
The set_status_text method is used to set the text appearing on the status bar within the drawing window.
-
.temp_dir ⇒ String
The temp_dir method is used to retrieve the OS temporary directory for the current user.
-
.template_dir ⇒ String
The template_dir is used to retrieve the directory where templates are stored by the SketchUp install.
-
.undo ⇒ nil
The undo method is used undo the last transaction on the undo stack.
-
.version ⇒ String
Gets the current version of sketchup in decimal form.
-
.version_number(*args) ⇒ Integer
Get the current version of sketchup as a whole number for comparisons.
-
.write_default(section, key, value) ⇒ Boolean
The write_default method is used to set the string associated with a variable within the specified sub-section of a .plist file on the Mac or the registry on Windows (within the Software > SketchUp > SketchUp [Version] section).
Class Attribute Details
.break_edges=(enabled) ⇒ Boolean
(rw)
The break_edges= method can be used to disable or enable the break edges feature. Break edges is the SketchUp 7 feature that automatically splits edges that the user draws which cross over one another.
This feature is always on by default and cannot be disabled by the user via the user interface, but you can call this method to disable it. Be cautious in doing so, however, as the resulting model could then be altered when the user later draws lines into it with the break edges feature reactivated.
.break_edges? ⇒ Boolean
(rw)
The break_edges? method indicates whether the break edges feature is currently turned on. Break edges is the SketchUp 7 feature that automatically splits edges that the user draws which cross over one another. This feature is always on by default and cannot be disabled by the user via the user interface.
.debug_mode=(enabled) ⇒ Boolean
(rw)
Changing this value within your extension can cause problems for other extension developers who rely on the debug information for their own work. Only use this locally; never change this value in an extension you publish.
The debug_mode= method lets you controls whether SketchUp will output warnings to the console when it detects incorrect usage of the API. The setting takes effect right away, no need to restart SketchUp.
.debug_mode? ⇒ Boolean
(rw)
The debug_mode? controls whether SketchUp will output warnings to the console when it detects incorrect usage of the API.
.fix_shadow_strings=(enabled) ⇒ Boolean
(rw)
The fix_shadow_strings= method lets you control whether shadow rendering attempts to fix an artifact commonly referred to as “strings”. The fix is actually very model dependent and not controllable from the ::UI
, so this method can be used to control it.
.fix_shadow_strings? ⇒ Boolean
(rw)
The fix_shadow_strings? method indicates whether the a fix for a shadow rendering artifact commonly referred to as “strings” is enabled. The fix is actually very model dependent and not controllable from the ::UI
, so this method can be used to test it.
.is_64bit? ⇒ Boolean
(readonly)
This methods indicates whether the host SketchUp application is 64bit. Useful for extensions that ship with binaries and need to determine which versions to load.
.is_pro? ⇒ Boolean
(readonly)
In SketchUp Make this method will return true
during the Pro trial period and revert to false
when the trial period is over.
Returns a boolean flag indicating whether the application is SketchUp Pro.
.plugins_disabled=(enabled) ⇒ Boolean
(rw)
The plugins_disabled= method lets you control whether SketchUp will load Ruby scripts from the plugins directory at startup time. This is primarily a trouble-shooting method. If you are having strange behavior in SketchUp that you suspect is from a bad script, you can type Sketchup
.plugins_disabled=true into the Ruby console and restart SketchUp to see if the problem is fixed.
.plugins_disabled? ⇒ Boolean
(rw)
The plugins_disabled? method indicates whether Ruby scripts in the plugins directory will be loaded at startup time.
.status_text=(status_text) ⇒ String (writeonly)
The status_text= method is used to set the text appearing on the status bar within the drawing window.
This is the same as calling set_status_text with a 2nd parameter of SB_PROMPT.
.template ⇒ String (rw)
The template method is used to get the file name of the current template. Templates are the .skp files that are loaded when the user select File > New.
.template=(filename) ⇒ String (rw)
The template= method is used to set the file name of the current template. Templates are the .skp files that are loaded when the user select File > New.
.vcb_label=(label_text) ⇒ String (writeonly)
The vcb_label= method is used to set the label that appears on the vcb, or the “value control box”, which is another word for the “measurements” text entry box that appears at the bottom on the SketchUp window.
This is the same as calling set_status_text with a 2nd parameter of SB_VCB_LABEL.
.vcb_value=(value) ⇒ String (writeonly)
The vcb_value= method is used to set the value that appears on the vcb, or the “value control box”, which is another word for the “measurements” text entry box that appears at the bottom on the SketchUp window.
This is the same as calling set_status_text with a 2nd parameter of SB_VCB_VALUE.
Class Method Details
.active_model ⇒ Sketchup::Model
The active_model method returns the currently active SketchUp model. On the PC, this is the only model that one can have access to via the API, but Macintosh versions of SketchUp can have multiple models open at once, in which case the method will return the model that the user currently has focused.
.add_observer(observer) ⇒ Boolean
The add_observer method is used to add an observer to the current object.
.app_name ⇒ String
The app_name method is used to retrieve the current application name.
.create_texture_writer ⇒ Sketchup::TextureWriter
The create_texture_writer method is used to create a ::Sketchup::TextureWriter
object.
.display_name_from_action(action_name) ⇒ String
This method has been non-functional on Mac since SketchUp 8.
The display_name_from_action method is used to gets a user-friendly name from an action string. See Sketchup.send_action for a list of valid action strings.
.extensions ⇒ Sketchup::ExtensionsManager
Returns the ::Sketchup::ExtensionsManager
where you can find all registered ::SketchupExtension
objects.
#extension.loaded?
“
}
.file_new ⇒ Module
The file_new method is used to create a new file.
.find_support_file(filename, directory) ⇒ String
The find_support_files method is used to retrieve the relative path and name of a file within the SketchUp installation directory.
Forward slashes must be used to delimit between directory names.
.find_support_files(filename, directory) ⇒ Array<String>
The find_support_files method is used to retrieve the path and name of all matching files within the SketchUp installation directory.
Forward slashes must be used to delimit between directory names.
.focus
The .focus
method is used to focus the active model window.
.format_angle(number) ⇒ String
The format_angle method takes a number as an angle in radians and formats it into degrees. For example, format_angle(Math::PI) will return 180.0.
.format_area(number) ⇒ String
The .format_area
method formats a number as an area using the current units settings.
The number
must be in square inches.
.format_degrees(number) ⇒ String
The format_degrees method formats a number as an angle given in degrees. For example, 10 becomes 10.0. This is the equivalent to a to_f call.
The .format_length
method formats a number as a length using the current units settings.
The default unit setting is inches. For example, 10 becomes 10“.
.format_volume(number) ⇒ String
The .format_volume
method formats a number as a volume using the current units settings.
The number
must be in cubic inches.
.get_datfile_info(key, default_value) ⇒ String
The get_datfile_info method is used to retrieve the value for the given key from Sketchup
.dat.
If the key is not found, default_value is returned.
.get_i18n_datfile_info(key, default_value) ⇒ String
The .get_i18n_datfile_info
method is used to retrieve the value for the given key from the internationalization file that SketchUp uses to work in multiple languages.
If the key
is not found, default_value
is returned.
.get_locale ⇒ String
The os_language method returns the language code for the language SketchUp is running in. This is an alias for the get_locale method.
Examples of return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW, pt-BR, nl, ru and sv. For an up to date list os supported languages, see the SketchUp download page.
.get_resource_path(filename) ⇒ String
The get_resource_path is used to retrieve the directory where “resource” files are stored by SketchUp. Resource files include things like language localization files.
.get_shortcuts ⇒ Array<String>
The get_shortcuts method retrieves an array of all keyboard shortcuts currently registered with SketchUp. Each shortcut is returned as a string with the shortcut and the command separated by a tab, similar to “Ctrl+A\tEdit/Select All”
.install_from_archive(filepath, show_warning = true) ⇒ Boolean
Installs the contents of a ZIP archive file into SketchUp’s Plugins folder. If the ZIP contains subfolders, these will be preserved. This allows for a Ruby API plugin or Extension developer to distribute their plugin as a single file regardless of how many asset files must be included.
The user will be shown a warning message that they must agree to before the install proceeds. If they do not agree, an Interrupt error will be raised. If the user does agree but there is a problem with the unzip process, an Exception will be raised. You can capture these states via a begin/rescue. See the example below.
If the install is successful, any Ruby files that have been added to the Plugins folder will immediately be executed, saving the user a restart.
To create an archive file, use your favorite tool (7zip, Winzip, etc.) to zip up any files and folders in your plugins directory. If the archive contains a ::SketchupExtension
that you would like users to be able to install from the Preferences > Extensions panel, rename your file to have a .rbz file extension.
.is_online ⇒ Boolean
The is_online method is used to verify a connection to the Internet. This method can take some time to execute, so be careful not to call it more often than you need.
.is_valid_filename?(filename) ⇒ Boolean
The is_valid_filename? method is used to determine whether a filename contains illegal characters.
.load(path) ⇒ Boolean
The load method is used to include encrypted and nonencrypted ruby files.
You do not need to include the file extension on the path. This method will look for .rb first (unencrypted) and then .rbe (encrypted) and finally .rbs (the deprecated scrambled format) files. See the “Distributing your Plugin” article for details.
.open_file(filename) ⇒ Boolean
.open_file(filename, with_status: true) ⇒ Integer
, false
Boolean
.open_file(filename, with_status: true) ⇒ Integer
, false
The .open_file
method is used to open a SketchUp model.
.os_language ⇒ String
The os_language method returns the language code for the language SketchUp is running in. This is an alias for the get_locale method.
Examples of return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW, pt-BR, nl, ru and sv. For an up to date list os supported languages, see the SketchUp download page.
.parse_length(string) ⇒ Float
The parse_length method parses a string as a length.
For example, “200” becomes 200.0.
.platform ⇒ Symbol
This methods returns a symbol indicating the current platform.
It should be used over RUBY_PLATFORM as this returns a different value for Windows since SketchUp 2014.
Older SketchUp versions still need to check RUBY_PLATFORM.include?('mswin')
or RUBY_PLATFORM.include?('darwin')
.
Possible return values:
-
:platform_win
-
:platform_osx
.quit ⇒ Object
The quit method is used to terminate the application. This will pop-up the usual model save prompts if there are unsaved models open. User can cancel the model save, in which case the application will not terminate.
.read_default(section, variable, default = nil) ⇒ Object
?
The read_default method is used to retrieve the string associated with a value within the specified sub-section section of a .INI file or registry (within the Software > SketchUp > SketchUp [Version] section).
.redo ⇒ nil
The redo method is used redo the last transaction on the redo stack.
.register_extension(extension, load_on_start = false) ⇒ Boolean
It is recommended to set load_on_start
to true unless you have a very good reason not to.
The register_extension method is used to register an extension with SketchUp’s extension manager (in SketchUp preferences).
.register_importer(importer) ⇒ Boolean
The register_importer method is used to register an importer with SketchUp.
.remove_observer(observer) ⇒ Boolean
The remove_observer method is used to remove an observer from the current object.
.require(path) ⇒ Boolean
The require method is used to include encrypted and nonencrypted ruby files. This is an alias of the Sketchup
.load method.
You do not need to include the file extension on the path. This method will look for .rbe first (encrypted) and then .rbs (the deprecated scrambled format) and finally .rb (unencrypted) files. The loading order was changed in SketchUp 2016 when the new .rbe encryption was introduced. Prior to SketchUp 2016 the loading order was first .rb then .rbs.
.resize_viewport(model, width, height) ⇒ Boolean
In SketchUp 2024.0 and later this method doesn’t behave correctly in all cases on Windows. The passed values are internally converted to logical pixels, rounded and converted back to physical pixels. This means certain sizes, such as 1000 px at 150% scaling, cannot be accurately set.
As a workaround in you can use sizes that are evenly divisible with common scale factors, if you depend on pixel perfect sizes.
# Changes by 1 px :(
((1000/1.5).round * 1.5).round # => 1001
# Survives the round-trip :)
((1500/1.5).round * 1.5).round # => 1500
((1500/1.25).round * 1.25).round # => 1500
The .resize_viewport
method changes the pixel size of the viewport and SketchUp window. This can be useful for producing a consistent behavior in automatic testing, regardless of the display resolution.
.save_thumbnail(skp_filename, img_filename) ⇒ Boolean
The save_thumbnail method is used to generate a thumbnail for any SKP file - not necessarily the loaded model.
.send_action(action) ⇒ Boolean
The send_action method sends a message to the message queue to perform some action asynchronously.
Valid actions are:
-
showRubyPanel:
-
viewBack:
-
viewBottom:
-
viewFront:
-
viewIso:
-
viewLeft:
-
viewRight:
-
viewTop:
-
viewPerspective:
-
viewShowAxes:
-
viewShowHidden:
-
viewZoomExtents:
-
viewZoomToSelection:
-
viewUndo:
-
selectOrbitTool:
-
selectPositionCameraTool:
-
selectDollyTool:
-
selectTurnTool:
-
selectWalkTool:
-
selectZoomTool:
-
selectFieldOfViewTool:
-
selectZoomWindowTool:
-
pageAdd:
-
pageDelete:
-
pageUpdate:
-
pageNext:
-
pagePrevious:
-
renderWireframe:
-
renderHiddenLine:
-
renderMonochrome:
-
renderShaded:
-
renderTextures:
-
selectArcTool:
-
selectArc3PointTool:
-
selectArc3PointPieTool:
-
selectAxisTool:
-
selectCircleTool:
-
selectEraseTool:
-
selectFreehandTool:
-
selectLineTool:
-
selectMeasureTool:
-
selectMoveTool:
-
selectOffsetTool:
-
selectPaintTool:
-
selectPolygonTool:
-
selectProtractorTool:
-
selectPushPullTool:
-
selectRectangleTool:
-
selectRectangle3PointTool:
-
selectRotateTool:
-
selectScaleTool:
-
selectSectionPlaneTool:
-
selectTextTool:
-
selectDimensionTool:
-
selectExtrudeTool:
-
selectSelectionTool:
-
editUndo:
-
editRedo:
-
editHide:
-
editUnhide:
-
fixNonPlanarFaces:
Added in SketchUp 8.0+:
-
addBuilding:
-
getPhotoTexture:
-
selectImageIglooTool:
-
selectNorthTool:
Added in SketchUp 2013+:
-
showExtensionStore:
Removed in SketchUp 2013+:
-
addBuilding:
On the PC only, you can also send these numeric values. (Note that these are officially “unsupported” and are not guaranteed to work in current or future versions of the API.)
-
10501: set view to Top
-
10502: set view to Front
-
10503: set view to Rear
-
10504: set view to Left
-
10505: set view to Right
-
10506: set view to Bottom
-
10507: set view to Axonometric
-
10510: set render mode to Wire
-
10511: set render mode to Hidden lines removal
-
10512: set render mode to Surfaces Shading
-
10513: set render mode to Transparency
-
10519: set camera to ortho (removes perspective)
-
10520: walk tool
-
10521: display the System Preferences dialog box (Files tab)
-
10522: removes axes display
-
10523: pan tool
-
10525: set the interactive eye height feature
-
10526: zoom window
-
10527: zoom extents
-
10529: zoom out 2
-
10531: toggle the Standard toolbar
-
10532: toggle the
::Sketchup::Camera
toolbar -
10533: display the Shadows Settings dialog box
-
10537: toggle the Views toolbar
-
10538: display the System Preferences dialog box (Display tab)
-
10545: toggle Shadows
-
10546: toggle Shadows toolbar
-
10551: toogle Large icons
-
10576: toggle Render Mode toolbar
-
21019: hide Status bar and VCB
-
21020: show Status bar and VCB
-
21022: hide Status bar and VCB
-
21023: place 3d text box
-
21024: select the Measure tool
-
21031: select the Freehand Draw tool
-
21041: select the PushPull tool
-
21048: select the Move tool
-
21052: hide selected objects
-
21056: create face with selected edges closed loop
-
21057: select the Protractor tool
-
21060: display Components Window
-
21061: toggle Draw toolbar
-
21063: toggle
::Sketchup::Model
Bounding Box display -
21065: select the Arc tool
-
21067: creat a new
::Sketchup::Page
-
21069: select the Arc 3 Point tool
-
21070: select the Arc 3 Point Pie tool
-
21074: show the
::Sketchup::Materials
Browser Window -
21076: display the Preferences dialog box (Text activated)
-
21077: display the Tip of the day Window
-
21078: select the Paint Bucket tool
-
21080: display the
::Sketchup::Page
Manager Window -
21082: display the Macros Dialog Box
-
21086: display the Components Browser Window
-
21094: select the Rectangle tool
-
21095: select the Polygon tool
-
21096: select the Circle tool
-
21098: open the Open Window
-
21100: select the Offset tool
-
21101: select all objects
-
21107: invert selection
-
21112: open the Import Window
-
21124: launch the validity check tool
-
21126: select the
::Sketchup::Axes
tool -
21029: select the Rotate tool
-
21032: toggle
::Sketchup::Layer
toolbar -
21036: display the Save as Window
-
21046: spin the model a full 360° and display report
-
21047: fast Pick Time report
-
21049: open the Export model Window
-
21169: select the Position Camera tool
-
21170: display the Preferences, Tour Guide activated
-
21180: create a new
::Sketchup::Page
just right of selected page -
21200: display the Insert Image Window
-
21233: display Area of selected face
-
21234: display Area of all faces with selected material
-
21236: select the Scale tool
-
21237: display the Export 2D Graphics Window
-
21245: display a Polygon Offset Factors dialog box
-
21276: reverse selected face(s)
-
21287: select the Divide feature
-
21337: select the Section Plane Placement tool
-
21354: open the
::Sketchup::Layer
Window -
21386: open the Export Animation Window
-
21405: select the
::Sketchup::Text
tool -
21406: display Fog dialog box
-
21410: select the Dim tool
-
21433: toggle Edit toolbar
-
21442: select the FollowMe tool
-
21448: select the
::Sketchup::Axes
tool -
21453: select all objects
-
21460: display Licence
-
21462: display Authorization dialog box
-
21463: display un-authorizing message
-
21464: display Open Licence files (Network) Window
-
21466: display Quick reference Card in Adobe Reader
-
21467: display Licences in use dialog box
-
21469: zoom extents to selected objects
-
21476: perform a non-planar check on selected objects
-
21477: list accelerators in window
-
21485: erase selected objects
-
21487: display Edit current material dialog box
-
21485: erase all new created pages
-
21488: display
::Sketchup::Entity
Info Window -
21490: display Soften Edges Window
-
21491: display Profiles
-
21492: display Extended Edges
-
21493: display Jitter Lines
-
21494: select Field of view tool
-
21513: display the outliner
-
21520: override Tile Rendering Size dialog box
-
21525: select the FollowMe tool
-
21542: display the Insert Image Window
-
21560 and up: causes a runtime Error
.send_to_layout(file) ⇒ Boolean
The .send_to_layout
method is used to open a file in LayOut.
.set_status_text ⇒ nil
.set_status_text(status_text = '', position = SB_PROMPT) ⇒ nil
nil
.set_status_text(status_text = '', position = SB_PROMPT) ⇒ nil
The set_status_text method is used to set the text appearing on the status bar within the drawing window.
If no arguments are passed, the status bar content is cleared. Valid positions are:
-
SB_PROMPT
- the text will appear at the left-side of the status bar -
SB_VCB_LABEL
- the text will appear in place of the VCB label -
SB_VCB_VALUE
- the text will appear in the VCB
.temp_dir ⇒ String
The temp_dir method is used to retrieve the OS temporary directory for the current user. You can use this directory to write temporary files that are not required to persist between SketchUp sessions.
.template_dir ⇒ String
The template_dir is used to retrieve the directory where templates are stored by the SketchUp install. Templates are the .skp files that are loaded when the user select File > New.
.undo ⇒ nil
The undo method is used undo the last transaction on the undo stack.
.version ⇒ String
Gets the current version of sketchup in decimal form.
.version_number(*args) ⇒ Integer
Get the current version of sketchup as a whole number for comparisons. The number returned has the major, minor, and build values packed into an integer value as follows:
-
Major version = X
-
Minor version = Y
-
Build number = Z
SketchUp 6.0 - SketchUp 2015
-
XXYYYZZZ
SketchUp 2016+
-
XXYZZZZZZZ
.write_default(section, key, value) ⇒ Boolean
The write_default method is used to set the string associated with a variable within the specified sub-section of a .plist file on the Mac or the registry on Windows (within the Software > SketchUp > SketchUp [Version] section).