sketchup-api-stubs 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/SketchUp/Geom/BoundingBox.rb +17 -20
- data/SketchUp/Geom/Bounds2d.rb +172 -0
- data/SketchUp/Geom/LatLong.rb +31 -16
- data/SketchUp/Geom/OrientedBounds2d.rb +102 -0
- data/SketchUp/Geom/Point2d.rb +365 -0
- data/SketchUp/Geom/Point3d.rb +121 -110
- data/SketchUp/Geom/PolygonMesh.rb +30 -21
- data/SketchUp/Geom/Transformation.rb +8 -4
- data/SketchUp/Geom/Transformation2d.rb +125 -0
- data/SketchUp/Geom/UTM.rb +43 -37
- data/SketchUp/Geom/Vector2d.rb +497 -0
- data/SketchUp/Geom/Vector3d.rb +143 -131
- data/SketchUp/Layout.rb +25 -0
- data/SketchUp/Layout/AngularDimension.rb +569 -0
- data/SketchUp/Layout/AutoTextDefinition.rb +417 -0
- data/SketchUp/Layout/AutoTextDefinitions.rb +186 -0
- data/SketchUp/Layout/ConnectionPoint.rb +70 -0
- data/SketchUp/Layout/Document.rb +458 -0
- data/SketchUp/Layout/Ellipse.rb +29 -0
- data/SketchUp/Layout/Entities.rb +155 -0
- data/SketchUp/Layout/Entity.rb +363 -0
- data/SketchUp/Layout/FormattedText.rb +349 -0
- data/SketchUp/Layout/Grid.rb +131 -0
- data/SketchUp/Layout/Group.rb +261 -0
- data/SketchUp/Layout/Image.rb +86 -0
- data/SketchUp/Layout/Label.rb +371 -0
- data/SketchUp/Layout/Layer.rb +222 -0
- data/SketchUp/Layout/LayerInstance.rb +128 -0
- data/SketchUp/Layout/Layers.rb +232 -0
- data/SketchUp/Layout/LinearDimension.rb +563 -0
- data/SketchUp/Layout/LockedEntityError.rb +10 -0
- data/SketchUp/Layout/LockedLayerError.rb +11 -0
- data/SketchUp/Layout/Page.rb +187 -0
- data/SketchUp/Layout/PageInfo.rb +393 -0
- data/SketchUp/Layout/Pages.rb +216 -0
- data/SketchUp/Layout/Path.rb +326 -0
- data/SketchUp/Layout/Rectangle.rb +174 -0
- data/SketchUp/Layout/SketchUpModel.rb +522 -0
- data/SketchUp/Layout/Style.rb +1520 -0
- data/SketchUp/Layout/Table.rb +290 -0
- data/SketchUp/Layout/TableCell.rb +149 -0
- data/SketchUp/Layout/TableColumn.rb +139 -0
- data/SketchUp/Layout/TableRow.rb +135 -0
- data/SketchUp/Sketchup/Animation.rb +7 -4
- data/SketchUp/Sketchup/ArcCurve.rb +10 -10
- data/SketchUp/Sketchup/AttributeDictionaries.rb +13 -4
- data/SketchUp/Sketchup/AttributeDictionary.rb +12 -12
- data/SketchUp/Sketchup/Color.rb +68 -78
- data/SketchUp/Sketchup/ComponentDefinition.rb +60 -60
- data/SketchUp/Sketchup/ComponentInstance.rb +57 -55
- data/SketchUp/Sketchup/DefinitionList.rb +34 -17
- data/SketchUp/Sketchup/Drawingelement.rb +19 -21
- data/SketchUp/Sketchup/Edge.rb +22 -24
- data/SketchUp/Sketchup/Entities.rb +173 -162
- data/SketchUp/Sketchup/Entity.rb +71 -55
- data/SketchUp/Sketchup/Face.rb +45 -44
- data/SketchUp/Sketchup/Group.rb +47 -49
- data/SketchUp/Sketchup/Image.rb +16 -0
- data/SketchUp/Sketchup/ImageRep.rb +226 -0
- data/SketchUp/Sketchup/InstancePath.rb +13 -13
- data/SketchUp/Sketchup/Layer.rb +15 -17
- data/SketchUp/Sketchup/Material.rb +40 -30
- data/SketchUp/Sketchup/Materials.rb +40 -22
- data/SketchUp/Sketchup/Menu.rb +5 -5
- data/SketchUp/Sketchup/Model.rb +230 -228
- data/SketchUp/Sketchup/Page.rb +32 -0
- data/SketchUp/Sketchup/Pages.rb +3 -4
- data/SketchUp/Sketchup/RenderingOptions.rb +21 -16
- data/SketchUp/Sketchup/SectionPlane.rb +64 -0
- data/SketchUp/Sketchup/Selection.rb +20 -28
- data/SketchUp/Sketchup/ShadowInfo.rb +14 -14
- data/SketchUp/Sketchup/Text.rb +24 -26
- data/SketchUp/Sketchup/Texture.rb +28 -12
- data/SketchUp/Sketchup/Vertex.rb +14 -11
- data/SketchUp/Sketchup/View.rb +126 -116
- data/SketchUp/UI/Command.rb +17 -17
- data/SketchUp/UI/HtmlDialog.rb +8 -5
- data/SketchUp/UI/Notification.rb +1 -1
- data/SketchUp/UI/Toolbar.rb +13 -14
- data/SketchUp/UI/WebDialog.rb +55 -59
- data/SketchUp/_top_level.rb +139 -27
- data/SketchUp/{Array.rb → array.rb} +167 -30
- data/SketchUp/{Geom.rb → geom.rb} +9 -7
- data/SketchUp/{LanguageHandler.rb → languagehandler.rb} +15 -15
- data/SketchUp/{Length.rb → length.rb} +15 -15
- data/SketchUp/{Numeric.rb → numeric.rb} +19 -19
- data/SketchUp/sketchup.rb +167 -156
- data/SketchUp/{SketchupExtension.rb → sketchupextension.rb} +27 -27
- data/SketchUp/{String.rb → string.rb} +1 -1
- data/SketchUp/ui.rb +113 -87
- metadata +46 -9
@@ -51,7 +51,7 @@ class SketchupExtension
|
|
51
51
|
# # And this will load the extension.
|
52
52
|
# ext_c.check
|
53
53
|
#
|
54
|
-
# @return
|
54
|
+
# @return [Boolean] whether the load succeeded
|
55
55
|
#
|
56
56
|
# @version SketchUp 8.0 M2
|
57
57
|
def check
|
@@ -67,7 +67,7 @@ class SketchupExtension
|
|
67
67
|
# extension.copyright = '2008'
|
68
68
|
# copyright = extension.copyright
|
69
69
|
#
|
70
|
-
# @return
|
70
|
+
# @return [String] the Extension copyright
|
71
71
|
#
|
72
72
|
# @version SketchUp 6.0
|
73
73
|
def copyright
|
@@ -83,10 +83,10 @@ class SketchupExtension
|
|
83
83
|
# extension.copyright = '2008'
|
84
84
|
# copyright = extension.copyright
|
85
85
|
#
|
86
|
-
# @param copyright
|
86
|
+
# @param [String] copyright
|
87
87
|
# The copyright to set
|
88
88
|
#
|
89
|
-
# @return
|
89
|
+
# @return [String] the new copyright
|
90
90
|
#
|
91
91
|
# @version SketchUp 6.0
|
92
92
|
def copyright=(copyright)
|
@@ -102,7 +102,7 @@ class SketchupExtension
|
|
102
102
|
# extension.creator = 'Trimble Navigation, Inc.'
|
103
103
|
# creator = extension.creator
|
104
104
|
#
|
105
|
-
# @return
|
105
|
+
# @return [String] the Extension creator
|
106
106
|
#
|
107
107
|
# @version SketchUp 6.0
|
108
108
|
def creator
|
@@ -118,10 +118,10 @@ class SketchupExtension
|
|
118
118
|
# extension.creator = 'Trimble Navigation, Inc.'
|
119
119
|
# creator = extension.creator
|
120
120
|
#
|
121
|
-
# @param creator
|
121
|
+
# @param [String] creator
|
122
122
|
# The creator to set
|
123
123
|
#
|
124
|
-
# @return
|
124
|
+
# @return [String] the new creator
|
125
125
|
#
|
126
126
|
# @version SketchUp 6.0
|
127
127
|
def creator=(creator)
|
@@ -137,7 +137,7 @@ class SketchupExtension
|
|
137
137
|
# extension.description = 'My description.'
|
138
138
|
# description = extension.description
|
139
139
|
#
|
140
|
-
# @return
|
140
|
+
# @return [String] the Extension description
|
141
141
|
#
|
142
142
|
# @version SketchUp 6.0
|
143
143
|
def description
|
@@ -153,10 +153,10 @@ class SketchupExtension
|
|
153
153
|
# extension.description = 'My description.'
|
154
154
|
# description = extension.description
|
155
155
|
#
|
156
|
-
# @param description
|
156
|
+
# @param [String] description
|
157
157
|
# The description string to set.
|
158
158
|
#
|
159
|
-
# @return
|
159
|
+
# @return [String] the Extension description
|
160
160
|
#
|
161
161
|
# @version SketchUp 6.0
|
162
162
|
def description=(description)
|
@@ -165,7 +165,7 @@ class SketchupExtension
|
|
165
165
|
# The extension_path method returns the file system path to the extension's
|
166
166
|
# outer rb file.
|
167
167
|
#
|
168
|
-
# @return
|
168
|
+
# @return [String] the file system path to the extension
|
169
169
|
#
|
170
170
|
# @version SketchUp 2013
|
171
171
|
def extension_path
|
@@ -173,7 +173,7 @@ class SketchupExtension
|
|
173
173
|
|
174
174
|
# The id method returns the Extension Warehouse ID string.
|
175
175
|
#
|
176
|
-
# @return
|
176
|
+
# @return [String] the Extension Warehouse ID
|
177
177
|
#
|
178
178
|
# @version SketchUp 2013
|
179
179
|
def id
|
@@ -193,14 +193,14 @@ class SketchupExtension
|
|
193
193
|
# # telling SketchUp to load the extension by default.
|
194
194
|
# Sketchup.register_extension(extension, true)
|
195
195
|
#
|
196
|
-
# @param title
|
196
|
+
# @param [String] title
|
197
197
|
# The name of the extension
|
198
198
|
#
|
199
|
-
# @param path
|
199
|
+
# @param [String] path
|
200
200
|
# The relative path to the script that loads your
|
201
201
|
# plugin.
|
202
202
|
#
|
203
|
-
# @return
|
203
|
+
# @return [Sketchup::Extension] the new Extension object
|
204
204
|
#
|
205
205
|
# @version SketchUp 6.0
|
206
206
|
def initialize(title, path)
|
@@ -214,7 +214,7 @@ class SketchupExtension
|
|
214
214
|
# Sketchup.register_extension(ext, true)
|
215
215
|
# UI.messagebox("load_on_start? is now true: #{ext.load_on_start?.to_s}")
|
216
216
|
#
|
217
|
-
# @return
|
217
|
+
# @return [Boolean]
|
218
218
|
#
|
219
219
|
# @return [Boolean]
|
220
220
|
#
|
@@ -228,10 +228,10 @@ class SketchupExtension
|
|
228
228
|
# @example
|
229
229
|
# ext = SketchupExtension.new('Stair Tools', 'StairTools/core.rb')
|
230
230
|
# UI.messagebox("loaded? is false: #{ext.loaded?.to_s}")
|
231
|
-
# Sketchup.register_extension
|
231
|
+
# Sketchup.register_extension(ext, true)
|
232
232
|
# UI.messagebox("loaded? is now true: #{ext.loaded?.to_s}")
|
233
233
|
#
|
234
|
-
# @return
|
234
|
+
# @return [Boolean]
|
235
235
|
#
|
236
236
|
# @return [Boolean]
|
237
237
|
#
|
@@ -248,7 +248,7 @@ class SketchupExtension
|
|
248
248
|
# extension = SketchupExtension.new('Stair Tools', 'StairTools/core.rb')
|
249
249
|
# name = extension.name
|
250
250
|
#
|
251
|
-
# @return
|
251
|
+
# @return [String] the Extension name
|
252
252
|
#
|
253
253
|
# @version SketchUp 6.0
|
254
254
|
def name
|
@@ -263,10 +263,10 @@ class SketchupExtension
|
|
263
263
|
# extension = SketchupExtension.new('Stair Tools', 'StairTools/core.rb')
|
264
264
|
# extension.name = 'Renamed Stair Tools'
|
265
265
|
#
|
266
|
-
# @param name
|
266
|
+
# @param [String] name
|
267
267
|
# The new name
|
268
268
|
#
|
269
|
-
# @return
|
269
|
+
# @return [String] the Extension name
|
270
270
|
#
|
271
271
|
# @version SketchUp 6.0
|
272
272
|
def name=(name)
|
@@ -281,7 +281,7 @@ class SketchupExtension
|
|
281
281
|
# Sketchup.register_extension(ext, true)
|
282
282
|
# UI.messagebox("Now registered? is now true: #{ext.registered?.to_s}")
|
283
283
|
#
|
284
|
-
# @return
|
284
|
+
# @return [Boolean]
|
285
285
|
#
|
286
286
|
# @return [Boolean]
|
287
287
|
#
|
@@ -303,7 +303,7 @@ class SketchupExtension
|
|
303
303
|
# extension.uncheck
|
304
304
|
# }
|
305
305
|
#
|
306
|
-
# @return
|
306
|
+
# @return [Boolean] whether the unload succeeded
|
307
307
|
#
|
308
308
|
# @version SketchUp 8.0 M2
|
309
309
|
def uncheck
|
@@ -319,7 +319,7 @@ class SketchupExtension
|
|
319
319
|
# extension.version = '5.0'
|
320
320
|
# version = extension.version
|
321
321
|
#
|
322
|
-
# @return
|
322
|
+
# @return [String] the Extension version
|
323
323
|
#
|
324
324
|
# @version SketchUp 6.0
|
325
325
|
def version
|
@@ -335,10 +335,10 @@ class SketchupExtension
|
|
335
335
|
# extension.version = '5.0'
|
336
336
|
# version = extension.version
|
337
337
|
#
|
338
|
-
# @param version
|
338
|
+
# @param [String] version
|
339
339
|
# The version string to set.
|
340
340
|
#
|
341
|
-
# @return
|
341
|
+
# @return [String] the Extension version
|
342
342
|
#
|
343
343
|
# @version SketchUp 6.0
|
344
344
|
def version=(version)
|
@@ -346,7 +346,7 @@ class SketchupExtension
|
|
346
346
|
|
347
347
|
# The version_id method returns the Extension Warehouse Version ID string.
|
348
348
|
#
|
349
|
-
# @return
|
349
|
+
# @return [String] the Extension Warehouse Version ID string
|
350
350
|
#
|
351
351
|
# @version SketchUp 2013
|
352
352
|
def version_id
|
data/SketchUp/ui.rb
CHANGED
@@ -29,7 +29,7 @@ module UI
|
|
29
29
|
# }
|
30
30
|
# end
|
31
31
|
#
|
32
|
-
# @return
|
32
|
+
# @return [Integer] the number of context handlers that are
|
33
33
|
# registered
|
34
34
|
#
|
35
35
|
# @version SketchUp 6.0
|
@@ -46,7 +46,7 @@ module UI
|
|
46
46
|
# @example
|
47
47
|
# UI.beep
|
48
48
|
#
|
49
|
-
# @return nil
|
49
|
+
# @return [nil]
|
50
50
|
#
|
51
51
|
# @version SketchUp 6.0
|
52
52
|
def self.beep
|
@@ -70,14 +70,10 @@ module UI
|
|
70
70
|
# UI.set_cursor(cursor_id)
|
71
71
|
# end
|
72
72
|
#
|
73
|
-
# @param filename
|
73
|
+
# @param [String] filename
|
74
74
|
# Filename for an image.
|
75
75
|
#
|
76
|
-
# @param
|
77
|
-
# An x coordinate that is the "hotpoint" for the cursor
|
78
|
-
# computed from the left edge of your cursor image.
|
79
|
-
#
|
80
|
-
# @param hot_y
|
76
|
+
# @param [Integer] hot_y
|
81
77
|
# A y coordinate that is the "hotpoint" for the cursor
|
82
78
|
# computed from the top edge of the of your cursor image.
|
83
79
|
# For example, a value of (hot_x, hot_y) = (5,10) would
|
@@ -85,7 +81,11 @@ module UI
|
|
85
81
|
# the left edge of your cursor image and 10 pixels from
|
86
82
|
# the top edge of your cursor image.
|
87
83
|
#
|
88
|
-
# @
|
84
|
+
# @param [Integer] hot_x
|
85
|
+
# An x coordinate that is the "hotpoint" for the cursor
|
86
|
+
# computed from the left edge of your cursor image.
|
87
|
+
#
|
88
|
+
# @return [Integer] ID associated with the cursor
|
89
89
|
#
|
90
90
|
# @version SketchUp 6.0
|
91
91
|
def self.create_cursor(filename, hot_x, hot_y)
|
@@ -112,30 +112,37 @@ module UI
|
|
112
112
|
# list = ["", "", "Male|Female"]
|
113
113
|
# input = UI.inputbox(prompts, defaults, list, "Tell me about yourself.")
|
114
114
|
#
|
115
|
-
# @
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# @
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
115
|
+
# @overload inputbox(prompts, defaults, title)
|
116
|
+
#
|
117
|
+
# @param [Array<String>] prompts
|
118
|
+
# An array of prompt names appearing in the input box
|
119
|
+
# adjacent to input fields.
|
120
|
+
# @param [Array<String>] defaults
|
121
|
+
# An array of default values for the input
|
122
|
+
# fields.
|
123
|
+
# @param [String] title
|
124
|
+
# The title for the input box.
|
125
|
+
#
|
126
|
+
# @overload inputbox(prompts, defaults, list, title)
|
127
|
+
#
|
128
|
+
# @param [Array<String>] prompts
|
129
|
+
# An array of prompt names appearing in the input box
|
130
|
+
# adjacent to input fields.
|
131
|
+
# @param [Array<String>] defaults
|
132
|
+
# An array of default values for the input
|
133
|
+
# fields.
|
134
|
+
# @param [String, Array<String>] list
|
135
|
+
# An array containing pipe-separated strings of options.
|
136
|
+
# @param [String] title
|
137
|
+
# The title for the input box.
|
138
|
+
#
|
139
|
+
# @return [Array<String>, false] An array of returned values if the user did
|
133
140
|
# not cancel the dialog. If the user canceled the
|
134
141
|
# dialog, false is returned. The returned values in the
|
135
142
|
# array will be in the same order as the input fields.
|
136
143
|
#
|
137
144
|
# @version SketchUp 6.0
|
138
|
-
def self.inputbox(
|
145
|
+
def self.inputbox(*args)
|
139
146
|
end
|
140
147
|
|
141
148
|
# The inspector_names method is used to returns the names of all the
|
@@ -146,37 +153,39 @@ module UI
|
|
146
153
|
# @example
|
147
154
|
# inspectors = UI.inspector_names
|
148
155
|
#
|
149
|
-
# @return
|
156
|
+
# @return [Array<String>] an array of strings containing the names
|
150
157
|
# of inspectors.
|
151
158
|
#
|
152
159
|
# @version SketchUp 6.0
|
153
160
|
def self.inspector_names
|
154
161
|
end
|
155
162
|
|
156
|
-
# The menu method retrieves a SketchUp's menu object with a given name. This
|
163
|
+
# The {#menu} method retrieves a SketchUp's menu object with a given name. This
|
157
164
|
# is the first step toward adding your own custom items to the bottom
|
158
165
|
# of SketchUp's menus.
|
159
166
|
#
|
160
167
|
# Valid menu names are: "File", "Edit", "View", "Camera", "Draw", "Tools",
|
161
168
|
# "Window", "Extensions" and "Help".
|
162
169
|
#
|
163
|
-
# Note that the "Extensions" menu was named "Plugins" prior to SketchUp 2015.
|
164
|
-
# For backward compatibility "Plugins" still works.
|
165
|
-
#
|
166
170
|
# @example
|
167
171
|
# tool_menu = UI.menu("Tools")
|
168
172
|
# tool_menu.add_item("Cheese Tool") {
|
169
173
|
# UI.messagebox("Cheese activated.")
|
170
174
|
# }
|
171
175
|
#
|
172
|
-
# @
|
173
|
-
#
|
174
|
-
#
|
176
|
+
# @note The "Extensions" menu was named "Plugins" prior to SketchUp 2015.
|
177
|
+
# For backward compatibility "Plugins" still works.
|
178
|
+
#
|
179
|
+
# @note In versions prior to SketchUp 2018 this would crash if you passed an
|
180
|
+
# empty string.
|
181
|
+
#
|
182
|
+
# @param menu_name
|
183
|
+
# The name of an existing top level menu.
|
175
184
|
#
|
176
|
-
# @return
|
185
|
+
# @return [Sketchup::Menu]
|
177
186
|
#
|
178
187
|
# @version SketchUp 6.0
|
179
|
-
def self.menu(
|
188
|
+
def self.menu(menu_name = "Plugins")
|
180
189
|
end
|
181
190
|
|
182
191
|
# Creates a dialog box containing static text with a series of buttons for
|
@@ -230,14 +239,14 @@ module UI
|
|
230
239
|
# @example
|
231
240
|
# mypages = UI.model_info_pages
|
232
241
|
#
|
233
|
-
# @return
|
242
|
+
# @return [Array<String>] an array of strings containing the names of
|
234
243
|
# model info pages.
|
235
244
|
#
|
236
245
|
# @version SketchUp 6.0
|
237
246
|
def self.model_info_pages
|
238
247
|
end
|
239
248
|
|
240
|
-
# The {
|
249
|
+
# The {.openURL} method is used to open the default Web browser to a URL.
|
241
250
|
#
|
242
251
|
# @example
|
243
252
|
# status = UI.openURL("http://www.sketchup.com")
|
@@ -266,13 +275,10 @@ module UI
|
|
266
275
|
# chosen_image = UI.openpanel("Open Image File", "c:/", "Image Files|*.jpg;*.png;||")
|
267
276
|
# chosen_image = UI.openpanel("Open CAD File", "c:/", "DXF|*.dxf|DWG|*.dwg||")
|
268
277
|
#
|
269
|
-
# @param title
|
278
|
+
# @param [String] title
|
270
279
|
# The title to apply to the open dialog box.
|
271
280
|
#
|
272
|
-
# @param
|
273
|
-
# The default directory for the open panel.
|
274
|
-
#
|
275
|
-
# @param filename
|
281
|
+
# @param [String] filename
|
276
282
|
# The default filename for the open panel. On Windows, you
|
277
283
|
# can alternatively pass a wildcard filter using this
|
278
284
|
# format: UIname|wildcard||. Additional filter dropdown
|
@@ -283,7 +289,10 @@ module UI
|
|
283
289
|
# single line using a semicolon-separated list in the
|
284
290
|
# filter field: ui_name|wildcard1;wildcard2||.
|
285
291
|
#
|
286
|
-
# @
|
292
|
+
# @param [String] directory
|
293
|
+
# The default directory for the open panel.
|
294
|
+
#
|
295
|
+
# @return [String] the full path and name of the file selected, or
|
287
296
|
# nil if the dialog was canceled.
|
288
297
|
#
|
289
298
|
# @version SketchUp 6.0
|
@@ -296,13 +305,13 @@ module UI
|
|
296
305
|
# @example
|
297
306
|
# UI.play_sound "Plugins/mediadiscussion.wav"
|
298
307
|
#
|
299
|
-
# @param filename
|
308
|
+
# @param [String] filename
|
300
309
|
# the relative path to the filename from the SketchUp
|
301
310
|
# install directory, or an absolute path to the file. (See
|
302
311
|
# Sketchup.find_support_file for a way to search for a
|
303
312
|
# specific file.)
|
304
313
|
#
|
305
|
-
# @return nil
|
314
|
+
# @return [nil]
|
306
315
|
#
|
307
316
|
# @version SketchUp 6.0
|
308
317
|
def self.play_sound(filename)
|
@@ -314,8 +323,8 @@ module UI
|
|
314
323
|
# @example
|
315
324
|
# prefs = UI.preferences_pages
|
316
325
|
#
|
317
|
-
# @return
|
318
|
-
# of
|
326
|
+
# @return [Array<String>] an array of strings containing the names
|
327
|
+
# of preference pages.
|
319
328
|
#
|
320
329
|
# @version SketchUp 6.0
|
321
330
|
def self.preferences_pages
|
@@ -330,12 +339,28 @@ module UI
|
|
330
339
|
# @example
|
331
340
|
# UI.refresh_inspectors
|
332
341
|
#
|
333
|
-
# @return nil
|
342
|
+
# @return [nil]
|
334
343
|
#
|
335
344
|
# @version SketchUp 7.0
|
336
345
|
def self.refresh_inspectors
|
337
346
|
end
|
338
347
|
|
348
|
+
# Tells SketchUp to refresh all floating toolbars. This is useful when you need
|
349
|
+
# to manually force a refresh after you've made a change to the document via
|
350
|
+
# Ruby. Generally, SketchUp will keep these in sync for you, but occasionally
|
351
|
+
# it does not, such as when {Sketchup::Model#start_operation} has disabled UI
|
352
|
+
# updates.
|
353
|
+
# This only affects macOS, on Windows the toolbars are always refreshing.
|
354
|
+
#
|
355
|
+
# @example
|
356
|
+
# UI.refresh_toolbars
|
357
|
+
#
|
358
|
+
# @return [nil]
|
359
|
+
#
|
360
|
+
# @version SketchUp 2018
|
361
|
+
def self.refresh_toolbars
|
362
|
+
end
|
363
|
+
|
339
364
|
# The savepanel method is used to display the Save dialog box. The path that
|
340
365
|
# is returned can then be used inside code to save out a text or image file.
|
341
366
|
# See the standard Ruby class File for examples of reading and writing from
|
@@ -349,13 +374,10 @@ module UI
|
|
349
374
|
# @example
|
350
375
|
# path_to_save_to = UI.savepanel("Save Image File", "c:\\", "Shapes.jpg")
|
351
376
|
#
|
352
|
-
# @param title
|
377
|
+
# @param [String] title
|
353
378
|
# The title to apply to the save dialog box.
|
354
379
|
#
|
355
|
-
# @param
|
356
|
-
# The default directory for the save panel.
|
357
|
-
#
|
358
|
-
# @param filename
|
380
|
+
# @param [String] filename
|
359
381
|
# The default filename for the save panel. On Windows, you
|
360
382
|
# can alternatively pass a mask, like "*.txt", to have all
|
361
383
|
# the .txt files display. If you want multiple file types
|
@@ -363,7 +385,10 @@ module UI
|
|
363
385
|
# filename and separate them with a semicolon, like this:
|
364
386
|
# "*.txt;*.doc".
|
365
387
|
#
|
366
|
-
# @
|
388
|
+
# @param [String] directory
|
389
|
+
# The default directory for the save panel.
|
390
|
+
#
|
391
|
+
# @return [String] the full path and name of the file
|
367
392
|
# selected or nil if the dialog was canceled.
|
368
393
|
#
|
369
394
|
# @version SketchUp 6.0
|
@@ -424,12 +449,10 @@ module UI
|
|
424
449
|
# directory: "C:/images"
|
425
450
|
# )
|
426
451
|
#
|
427
|
-
# @param options
|
428
|
-
#
|
429
|
-
# providing a hash or named arguments of
|
430
|
-
# options.
|
452
|
+
# @param [Hash] options
|
453
|
+
# The dialog can be customized by providing a hash or named arguments of options.
|
431
454
|
#
|
432
|
-
# @return
|
455
|
+
# @return [String, Array<String>] A string with the full path of the
|
433
456
|
# directory selected when
|
434
457
|
# :select_multiple option is set to
|
435
458
|
# false otherwise an array of strings
|
@@ -452,10 +475,10 @@ module UI
|
|
452
475
|
# UI.set_cursor(cursor_id)
|
453
476
|
# end
|
454
477
|
#
|
455
|
-
# @param cursor_id
|
478
|
+
# @param [Integer] cursor_id
|
456
479
|
# The id of the cursor you want to display.
|
457
480
|
#
|
458
|
-
# @return nil
|
481
|
+
# @return [nil]
|
459
482
|
#
|
460
483
|
# @version SketchUp 6.0
|
461
484
|
def self.set_cursor(cursor_id)
|
@@ -469,13 +492,13 @@ module UI
|
|
469
492
|
# @example
|
470
493
|
# status = UI.set_toolbar_visible("Camera", true)
|
471
494
|
#
|
472
|
-
# @param name
|
495
|
+
# @param [String] name
|
473
496
|
# The name of a Ruby toolbar.
|
474
497
|
#
|
475
|
-
# @param visible
|
498
|
+
# @param [Boolean] visible
|
476
499
|
# True to make the toolbar visible, false to hide it.
|
477
500
|
#
|
478
|
-
# @return
|
501
|
+
# @return [Boolean] true if successful, false if not.
|
479
502
|
#
|
480
503
|
# @version SketchUp 6.0
|
481
504
|
def self.set_toolbar_visible(name, visible)
|
@@ -497,28 +520,31 @@ module UI
|
|
497
520
|
# name. You can get the list of valid inspectors with UI.inspector_names.
|
498
521
|
#
|
499
522
|
# @example
|
500
|
-
# status = UI.show_inspector
|
523
|
+
# status = UI.show_inspector("Components")
|
501
524
|
#
|
502
|
-
# @param name
|
525
|
+
# @param [String] name
|
503
526
|
# The name of inspector that you want to display.
|
504
527
|
#
|
505
|
-
# @return
|
528
|
+
# @return [Boolean] true if successful, false if unsuccessful
|
506
529
|
#
|
507
530
|
# @version SketchUp 6.0
|
508
531
|
def self.show_inspector(name)
|
509
532
|
end
|
510
533
|
|
511
|
-
# The show_model_info method is used to display the model info dialog for a
|
534
|
+
# The {.show_model_info} method is used to display the model info dialog for a
|
512
535
|
# specific page. You can get the list of valid dialogs with
|
513
|
-
# UI.model_info_pages.
|
536
|
+
# {UI.model_info_pages}.
|
537
|
+
#
|
538
|
+
# [SketchUp 2014] <code>"Classifications"</code> page was added.
|
539
|
+
# [SketchUp 2017] <code>"Extensions"</code> page was removed.
|
514
540
|
#
|
515
541
|
# @example
|
516
|
-
#
|
542
|
+
# UI.show_model_info('Credits')
|
517
543
|
#
|
518
|
-
# @param page_name
|
544
|
+
# @param [String] page_name
|
519
545
|
# The name of the model info dialog you want to display.
|
520
546
|
#
|
521
|
-
# @return
|
547
|
+
# @return [Boolean]
|
522
548
|
#
|
523
549
|
# @version SketchUp 6.0
|
524
550
|
def self.show_model_info(page_name)
|
@@ -532,10 +558,10 @@ module UI
|
|
532
558
|
# @example
|
533
559
|
# status = UI.show_preferences('GraphicsCard')
|
534
560
|
#
|
535
|
-
# @param page_name
|
561
|
+
# @param [String] page_name
|
536
562
|
# The name of the preferences dialog you want to display.
|
537
563
|
#
|
538
|
-
# @return
|
564
|
+
# @return [Boolean] true
|
539
565
|
#
|
540
566
|
# @version SketchUp 6.0
|
541
567
|
def self.show_preferences(page_name)
|
@@ -554,14 +580,14 @@ module UI
|
|
554
580
|
# # Beep once after 10 seconds.
|
555
581
|
# id = UI.start_timer(10, false) { UI.beep }
|
556
582
|
#
|
557
|
-
# @param [
|
583
|
+
# @param [Boolean] repeat
|
558
584
|
# true if you want the timer to repeat, false
|
559
585
|
# (or omit) if you do not want it to repeat.
|
560
586
|
#
|
561
|
-
# @param seconds
|
587
|
+
# @param [Numeric] seconds
|
562
588
|
# The time in seconds before your code should be called.
|
563
589
|
#
|
564
|
-
# @return
|
590
|
+
# @return [Integer] a timer ID
|
565
591
|
#
|
566
592
|
# @version SketchUp 6.0
|
567
593
|
#
|
@@ -577,10 +603,10 @@ module UI
|
|
577
603
|
# id = UI.start_timer(10) { UI.beep }
|
578
604
|
# UI.stop_timer(id)
|
579
605
|
#
|
580
|
-
# @param id
|
606
|
+
# @param [Integer] id
|
581
607
|
# The timer id for the timer that you want to stop.
|
582
608
|
#
|
583
|
-
# @return nil
|
609
|
+
# @return [nil]
|
584
610
|
#
|
585
611
|
# @version SketchUp 6.0
|
586
612
|
def self.stop_timer(id)
|
@@ -592,10 +618,10 @@ module UI
|
|
592
618
|
# @example
|
593
619
|
# toolbar = UI.toolbar('Test')
|
594
620
|
#
|
595
|
-
# @param name
|
621
|
+
# @param [String] name
|
596
622
|
# The name of the Ruby toolbar.
|
597
623
|
#
|
598
|
-
# @return
|
624
|
+
# @return [UI::Toolbar] a Toolbar object
|
599
625
|
#
|
600
626
|
# @version SketchUp 6.0
|
601
627
|
def self.toolbar(name)
|
@@ -608,7 +634,7 @@ module UI
|
|
608
634
|
# @example
|
609
635
|
# names = UI.toolbar_names
|
610
636
|
#
|
611
|
-
# @return
|
637
|
+
# @return [Array<String>] Array of strings representing toolbar names.
|
612
638
|
#
|
613
639
|
# @version SketchUp 6.0
|
614
640
|
def self.toolbar_names
|
@@ -622,10 +648,10 @@ module UI
|
|
622
648
|
# @example
|
623
649
|
# status = UI.toolbar_visible?("Camera")
|
624
650
|
#
|
625
|
-
# @param name
|
651
|
+
# @param [String] name
|
626
652
|
# The name of a native toolbar.
|
627
653
|
#
|
628
|
-
# @return
|
654
|
+
# @return [Boolean]
|
629
655
|
#
|
630
656
|
# @return [Boolean]
|
631
657
|
#
|