Module: Sketchup

Defined in:
lib/sketchup.rb,
lib/set.rb,
lib/hlr.rb,
lib/axes.rb,
lib/loop.rb,
lib/text.rb,
lib/view.rb,
lib/menu.rb,
lib/face.rb,
lib/page.rb,
lib/edge.rb,
lib/pages.rb,
lib/tools.rb,
lib/group.rb,
lib/model.rb,
lib/style.rb,
lib/curve.rb,
lib/color.rb,
lib/layer.rb,
lib/image.rb,
lib/styles.rb,
lib/vertex.rb,
lib/camera.rb,
lib/entity.rb,
lib/layers.rb,
lib/edgeuse.rb,
lib/texture.rb,
lib/console.rb,
lib/arccurve.rb,
lib/uvhelper.rb,
lib/material.rb,
lib/behavior.rb,
lib/importer.rb,
lib/entities.rb,
lib/licensing.rb,
lib/selection.rb,
lib/materials.rb,
lib/dimension.rb,
lib/pickhelper.rb,
lib/inputpoint.rb,
lib/shadow_info.rb,
lib/appobserver.rb,
lib/sectionplane.rb,
lib/viewobserver.rb,
lib/toolsobserver.rb,
lib/modelobserver.rb,
lib/texturewriter.rb,
lib/pagesobserver.rb,
lib/drawingelement.rb,
lib/layersobserver.rb,
lib/entityobserver.rb,
lib/definitionlist.rb,
lib/optionsmanager.rb,
lib/classifications.rb,
lib/optionsprovider.rb,
lib/instanceobserver.rb,
lib/extensionlicense.rb,
lib/entitiesobserver.rb,
lib/constructionline.rb,
lib/dimension_radial.rb,
lib/dimension_linear.rb,
lib/renderingoptions.rb,
lib/materialsobserver.rb,
lib/componentinstance.rb,
lib/constructionpoint.rb,
lib/selectionobserver.rb,
lib/extensionsmanager.rb,
lib/dimension_observer.rb,
lib/shadowinfoobserver.rb,
lib/definitionobserver.rb,
lib/attributedictionary.rb,
lib/componentdefinition.rb,
lib/definitionsobserver.rb,
lib/classificationschema.rb,
lib/attributedictionaries.rb,
lib/optionsproviderobserver.rb,
lib/renderingoptionsobserver.rb

Overview

The Sketchup module namespace contains methods that might be considered "application" level methods. The "entry-point" to most plugins.

Defined Under Namespace

Modules: Licensing Classes: AppObserver, ArcCurve, AttributeDictionaries, AttributeDictionary, Axes, Behavior, Camera, ClassificationSchema, Classifications, Color, ComponentDefinition, ComponentInstance, Console, ConstructionLine, ConstructionPoint, Curve, DefinitionList, DefinitionObserver, DefinitionsObserver, Dimension, DimensionLinear, DimensionObserver, DimensionRadial, Drawingelement, Edge, EdgeUse, Entities, EntitiesObserver, Entity, EntityObserver, ExtensionsManager, Face, Group, HLR, Image, Importer, InputPoint, InstanceObserver, Layer, Layers, LayersObserver, Loop, Material, Materials, MaterialsObserver, Menu, Model, ModelObserver, OptionsManager, OptionsProvider, OptionsProviderObserver, Page, Pages, PagesObserver, PickHelper, RenderingOptions, RenderingOptionsObserver, SectionPlane, Selection, SelectionObserver, Set, ShadowInfo, ShadowInfoObserver, Style, Styles, Text, Texture, TextureWriter, Tools, ToolsObserver, UVHelper, Vertex, View, ViewObserver

Class Method Summary collapse

Class Method Details

.active_modelModel

Note:

On Windows, there is only a single active model. Since the Mac version of SketchUp can have multiple models open, this returns the currently focused model.

The model!

Examples:

model = Sketchup.active_model

Returns:

  • (Model)

    the current active model.



18
19
20
21
22
# File 'lib/sketchup.rb', line 18

def self.active_model
  if @model.class != Sketchup::Model
    @model = Sketchup::Model.new
  end
end

.add_observer(app_observer) ⇒ Object

Attaches an AppObserver to the current SketchUp Application. You should retain a reference to the observer if you need to remove it at a later time.

Examples:

app_observer = AppObserver.new
status = Sketchup.add_observer(app_observer)

Parameters:

Returns:

  • status true if successful, false if not.

See Also:

  • #remove_observer


37
38
# File 'lib/sketchup.rb', line 37

def self.add_observer(app_observer)
end

.app_nameObject



40
41
# File 'lib/sketchup.rb', line 40

def self.app_name
end

.break_edges=Object



67
68
# File 'lib/sketchup.rb', line 67

def self.break_edges=
end

.break_edges?Boolean

Returns:

  • (Boolean)


69
70
# File 'lib/sketchup.rb', line 69

def self.break_edges?
end

.create_texture_writerObject



71
72
# File 'lib/sketchup.rb', line 71

def self.create_texture_writer
end

.debug_mode=(mode) ⇒ Boolean

When enabled (true):

  • Ruby Console now warns about Ruby operations left open. Leaving operations open is typically a bad practice. We are warning developers that they should try to find a different way of doing what they want to do.
  • Ruby Console now warns when a user tries to create a nested operation. Starting a new operation while one is still open is a bad practice. We would like developers to be more aware that they are doing this so that they can fix their code.

Parameters:

  • mode (Boolean)

    true or false

Returns:

  • (Boolean)

    mode

Since:

  • SketchUp 2016



57
58
59
# File 'lib/sketchup.rb', line 57

def self.debug_mode=(mode)
   @debug_mode = mode
end

.debug_mode?Boolean

Returns:

  • (Boolean)

Since:

  • SketchUp 2016



63
64
65
# File 'lib/sketchup.rb', line 63

def self.debug_mode?
   @debug_mode
end

.display_name_from_actionObject



73
74
# File 'lib/sketchup.rb', line 73

def self.display_name_from_action
end

.extensionsExtensionsManager



80
81
# File 'lib/sketchup.rb', line 80

def self.extensions
end

.file_newObject



83
84
# File 'lib/sketchup.rb', line 83

def self.file_new
end

.find_support_fileObject



85
86
# File 'lib/sketchup.rb', line 85

def self.find_support_file
end

.find_support_filesObject



87
88
# File 'lib/sketchup.rb', line 87

def self.find_support_files
end

.format_angleObject



89
90
# File 'lib/sketchup.rb', line 89

def self.format_angle
end

.format_areaObject



91
92
# File 'lib/sketchup.rb', line 91

def self.format_area
end

.format_degreesObject



93
94
# File 'lib/sketchup.rb', line 93

def self.format_degrees
end

.format_lengthObject



95
96
# File 'lib/sketchup.rb', line 95

def self.format_length
end

.get_datfile_infoObject



97
98
# File 'lib/sketchup.rb', line 97

def self.get_datfile_info
end

.get_i18ndatfile_infoObject



99
100
# File 'lib/sketchup.rb', line 99

def self.get_i18ndatfile_info
end

.get_localeObject



101
102
# File 'lib/sketchup.rb', line 101

def self.get_locale
end

.get_resource_pathObject



103
104
# File 'lib/sketchup.rb', line 103

def self.get_resource_path
end

.get_shortcutsObject



105
106
# File 'lib/sketchup.rb', line 105

def self.get_shortcuts
end

.install_from_archive(path) ⇒ ExtensionManager

Installs the contents of a ZIP archive file into SketchUp's Plugins folder. If the ZIP contains subfolders, these will be preserved.

Returns:

  • (ExtensionManager)

Since:

  • SketchUp 8.0 M2



110
111
112
# File 'lib/sketchup.rb', line 110

def self.install_from_archive(path)

end

.is_64bit?Boolean

Returns:

  • (Boolean)

Since:

  • 2015



115
116
# File 'lib/sketchup.rb', line 115

def self.is_64bit?
end

.is_onlineObject



118
119
# File 'lib/sketchup.rb', line 118

def self.is_online
end

.is_pro?Boolean

Returns:

  • (Boolean)


120
121
# File 'lib/sketchup.rb', line 120

def self.is_pro?
end

.is_valid_filename?Boolean

Returns:

  • (Boolean)


122
123
# File 'lib/sketchup.rb', line 122

def self.is_valid_filename?
end

.load(file) ⇒ Boolean

Loads both encrypted (.rbs) and non-encrypted Ruby files.

Examples:

status = Sketchup.load("C:/cool_plugins.rbs")

Parameters:

  • file (String)

    path to a file

Returns:

  • (Boolean)

    true if successful, otherwise false



131
132
# File 'lib/sketchup.rb', line 131

def self.load(file)
end

.open_fileObject



133
134
# File 'lib/sketchup.rb', line 133

def self.open_file
end

.os_languageObject



135
136
# File 'lib/sketchup.rb', line 135

def self.os_language
end

.parse_lengthObject



137
138
# File 'lib/sketchup.rb', line 137

def self.parse_length
end

.platformObject

Since:

  • SketchUp 2014



141
142
# File 'lib/sketchup.rb', line 141

def self.platform
end

.plugins_disabled=(true_or_false) ⇒ Object

Parameters:

  • true_or_false (Boolean)

    true or false

Since:

  • SketchUp 8.0 M2



146
147
# File 'lib/sketchup.rb', line 146

def self.plugins_disabled=(true_or_false)
end

.plugins_disabled?Boolean

Returns:

  • (Boolean)

Since:

  • SketchUp 8.0 M2



149
150
# File 'lib/sketchup.rb', line 149

def self.plugins_disabled?
end

.quitObject

Since:

  • SketchUp 2014



153
154
# File 'lib/sketchup.rb', line 153

def self.quit
end

.read_defaultObject

See Also:



157
158
# File 'lib/sketchup.rb', line 157

def self.read_default
end

.register_extension(extension, load_on_start) ⇒ Object



160
161
# File 'lib/sketchup.rb', line 160

def self.register_extension(extension, load_on_start)
end

.register_importerObject



163
164
# File 'lib/sketchup.rb', line 163

def self.register_importer
end

.remove_observer(app_observer) ⇒ Boolean

Removes an attached AppObserver

Examples:

status = Sketchup.remove_observer(app_observer)

Parameters:

  • app_observer (AppObserver)

    a reference to a AppObserver instance.

Returns:

  • (Boolean)

    status true if successful, false if not.



174
175
# File 'lib/sketchup.rb', line 174

def self.remove_observer(app_observer)
end

.require(filename) ⇒ Object



177
178
# File 'lib/sketchup.rb', line 177

def self.require(filename)
end

.save_thumbnail(filename) ⇒ Object



180
181
# File 'lib/sketchup.rb', line 180

def self.save_thumbnail(filename)
end

.send_actionObject



183
184
# File 'lib/sketchup.rb', line 183

def self.send_action
end

.set_status_text(text, position) ⇒ Boolean

Display a message in SketchUp's Status Bar or VCB value or label.

Parameters:

  • text (String)

    the text to display in the staus bar.

  • position (optional)

    one of: SB_PROMPT SB_VCB_LABEL SB_VCB_VALUE

Returns:

  • (Boolean)

    true if successful, false if not.



193
194
# File 'lib/sketchup.rb', line 193

def self.set_status_text(text, position)
end

.status_text=(text) ⇒ Boolean

Returns true if successful, false if not.

Parameters:

  • text (String)

    the text to display in the staus bar.

Returns:

  • (Boolean)

    true if successful, false if not.

See Also:



199
200
# File 'lib/sketchup.rb', line 199

def self.status_text=(text)
end

.temp_dirObject

Since:

  • SketchUp 2014



203
204
# File 'lib/sketchup.rb', line 203

def self.temp_dir
end

.templateObject



206
207
# File 'lib/sketchup.rb', line 206

def self.template
end

.template=Object



208
209
# File 'lib/sketchup.rb', line 208

def self.template=
end

.template_dirObject



210
211
# File 'lib/sketchup.rb', line 210

def self.template_dir
end

.undoObject



212
213
# File 'lib/sketchup.rb', line 212

def self.undo
end

.vcb_label=(label) ⇒ Object

Sets the label for the VCB, more recently known as the Measurements box.

Parameters:

  • label (String)

    the text label for the VCB



217
218
# File 'lib/sketchup.rb', line 217

def self.vcb_label=(label)
end

.vcb_value=(str) ⇒ Object

Sets the value of the VCB, aka the Measurements box.

Parameters:

  • str (String)

    the text to place in the VCB.



222
223
# File 'lib/sketchup.rb', line 222

def self.vcb_value=(str)
end

.versionObject



225
226
# File 'lib/sketchup.rb', line 225

def self.version
end

.version_numberObject



227
228
# File 'lib/sketchup.rb', line 227

def self.version_number
end

.write_default(section, key, value) ⇒ Boolean

Write a key-value pair to the specified section of the Registry. Persistent storage. Sections appear under HKCU\Software\Google\SketchUp(v) where v is the SketchUp major version.

Examples:

status = Sketchup.write_default("MyPluginConfig", "OffsetAmount", 3.5)

Parameters:

Returns:

  • (Boolean)

    true if success, false if not.

See Also:



240
241
# File 'lib/sketchup.rb', line 240

def self.write_default(section, key, value)
end