Module: Sketchup

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



42
43
# File 'lib/sketchup.rb', line 42

def self.break_edges=
end

.break_edges?Boolean

Returns:

  • (Boolean)


44
45
# File 'lib/sketchup.rb', line 44

def self.break_edges?
end

.create_texture_writerObject



46
47
# File 'lib/sketchup.rb', line 46

def self.create_texture_writer
end

.display_name_from_actionObject



48
49
# File 'lib/sketchup.rb', line 48

def self.display_name_from_action
end

.extensionsExtensionsManager



55
56
# File 'lib/sketchup.rb', line 55

def self.extensions
end

.file_newObject



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

def self.file_new
end

.find_support_fileObject



60
61
# File 'lib/sketchup.rb', line 60

def self.find_support_file
end

.find_support_filesObject



62
63
# File 'lib/sketchup.rb', line 62

def self.find_support_files
end

.format_angleObject



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

def self.format_angle
end

.format_areaObject



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

def self.format_area
end

.format_degreesObject



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

def self.format_degrees
end

.format_lengthObject



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

def self.format_length
end

.get_datfile_infoObject



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

def self.get_datfile_info
end

.get_i18ndatfile_infoObject



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

def self.get_i18ndatfile_info
end

.get_localeObject



76
77
# File 'lib/sketchup.rb', line 76

def self.get_locale
end

.get_resource_pathObject



78
79
# File 'lib/sketchup.rb', line 78

def self.get_resource_path
end

.get_shortcutsObject



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

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



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

def self.install_from_archive(path)

end

.is_64bit?Boolean

Returns:

  • (Boolean)

Since:

  • 2015



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

def self.is_64bit?
end

.is_onlineObject



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

def self.is_online
end

.is_pro?Boolean

Returns:

  • (Boolean)


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

def self.is_pro?
end

.is_valid_filename?Boolean

Returns:

  • (Boolean)


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

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



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

def self.load(file)
end

.open_fileObject



108
109
# File 'lib/sketchup.rb', line 108

def self.open_file
end

.os_languageObject



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

def self.os_language
end

.parse_lengthObject



112
113
# File 'lib/sketchup.rb', line 112

def self.parse_length
end

.platformObject

Since:

  • SketchUp 2014



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

def self.platform
end

.plugins_disabled=(true_or_false) ⇒ Object

Parameters:

  • true_or_false (Boolean)

    true or false

Since:

  • SketchUp 8.0 M2



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

def self.plugins_disabled=(true_or_false)
end

.plugins_disabled?Boolean

Returns:

  • (Boolean)

Since:

  • SketchUp 8.0 M2



124
125
# File 'lib/sketchup.rb', line 124

def self.plugins_disabled?
end

.quitObject

Since:

  • SketchUp 2014



128
129
# File 'lib/sketchup.rb', line 128

def self.quit
end

.read_defaultObject

See Also:



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

def self.read_default
end

.register_extensionObject



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

def self.register_extension
end

.register_importerObject



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

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.



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

def self.remove_observer(app_observer)
end

.requireObject



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

def self.require
end

.save_thumbnailObject



155
156
# File 'lib/sketchup.rb', line 155

def self.save_thumbnail
end

.send_actionObject



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

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.



168
169
# File 'lib/sketchup.rb', line 168

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:



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

def self.status_text=(text)
end

.temp_dirObject

Since:

  • SketchUp 2014



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

def self.temp_dir
end

.templateObject



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

def self.template
end

.template=Object



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

def self.template=
end

.template_dirObject



185
186
# File 'lib/sketchup.rb', line 185

def self.template_dir
end

.undoObject



187
188
# File 'lib/sketchup.rb', line 187

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



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

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.



197
198
# File 'lib/sketchup.rb', line 197

def self.vcb_value=(str)
end

.versionObject



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

def self.version
end

.version_numberObject



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

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:



215
216
# File 'lib/sketchup.rb', line 215

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