sketchup-api-stubs 0.7.0 → 0.7.5

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.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +2 -0
  3. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +14 -10
  4. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +4 -4
  5. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +4 -4
  6. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +4 -5
  7. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +17 -17
  8. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +6 -0
  9. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +1 -2
  10. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +3 -3
  11. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +4 -0
  12. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +6 -13
  13. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +60 -4
  14. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +6 -13
  15. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +188 -0
  16. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +8 -3
  17. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +1 -2
  18. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +6 -13
  19. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +5 -1
  20. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +6 -13
  21. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +147 -4
  22. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +4 -0
  23. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +3 -3
  24. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +2 -2
  25. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +5 -0
  26. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +31 -57
  27. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +109 -208
  28. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +23 -10
  29. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +22 -7
  30. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +23 -12
  31. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +15 -8
  32. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +60 -27
  33. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +5 -3
  34. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +5 -3
  35. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +2 -8
  36. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +4 -0
  37. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +9 -3
  38. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +7 -13
  39. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +54 -25
  40. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +5 -3
  41. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +19 -14
  42. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +5 -4
  43. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +8 -7
  44. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +8 -7
  45. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +46 -44
  46. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +8 -0
  47. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +46 -6
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +10 -11
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +32 -20
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +5 -3
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +4 -1
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +112 -69
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +224 -28
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +117 -4
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +1 -12
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +7 -9
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +14 -7
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +5 -4
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +8 -10
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +122 -72
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +4 -3
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +1 -2
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +6 -6
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +3 -3
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +142 -39
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +21 -11
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +5 -4
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +36 -14
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +4 -3
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +9 -4
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +19 -19
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +4 -4
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +5 -3
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +8 -2
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +13 -21
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +30 -24
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +5 -3
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +31 -21
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +72 -66
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +5 -3
  84. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +12 -5
  85. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +34 -3
  86. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +36 -10
  87. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +2 -2
  88. data/lib/sketchup-api-stubs/stubs/_top_level.rb +2 -0
  89. data/lib/sketchup-api-stubs/stubs/geom.rb +3 -0
  90. data/lib/sketchup-api-stubs/stubs/sketchup.rb +54 -22
  91. data/lib/sketchup-api-stubs/stubs/ui.rb +9 -8
  92. metadata +4 -16
@@ -1,9 +1,11 @@
1
1
  # Copyright:: Copyright 2020 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # This observer interface is implemented to react to view events. To implement
5
- # this observer, create a Ruby class of this type, override the desired
6
- # methods, and add an instance of the observer to the view object.
4
+ # This observer interface is implemented to react to view events.
5
+ #
6
+ # @abstract To implement this observer, create a Ruby class of this type,
7
+ # override the desired methods, and add an instance of the observer to the
8
+ # view object.
7
9
  #
8
10
  # @example
9
11
  # # This is an example of an observer that watches tool interactions.
@@ -87,10 +87,10 @@ class UI::Command
87
87
  end
88
88
 
89
89
  # The large_icon= method is used to identify the icon file for the command's
90
- # large icon. large icons should be 24x24 pixel images for best display
90
+ # large icon. large icons should be 32x32 pixel images for best display
91
91
  # quality.
92
92
  #
93
- # Since SketchUp 2016 it is possible to provide vector images for the cursors.
93
+ # Since SketchUp 2016 it is possible to provide vector images for the command.
94
94
  # SVG format for Windows and PDF format for OS X. Since the vector images scale
95
95
  # for both small and large icon sizes, you may choose to use only one vector
96
96
  # image for both variants.
@@ -150,8 +150,11 @@ class UI::Command
150
150
  end
151
151
 
152
152
  # The {#set_validation_proc} method allows you to change whether the command
153
- # is enabled, checked, etc. based on the user state. For example, you might
154
- # want your command to be disabled unless the user has a current selection.
153
+ # is enabled, checked, etc. For instance, the command toggling a dialog window
154
+ # may be displayed as checked while the dialog is open.
155
+ #
156
+ # @bug On Mac the validation proc isn't called as often as it should. For
157
+ # instance a selection change doesn't trigger it.
155
158
  #
156
159
  # @example
157
160
  # # Create a command object.
@@ -168,6 +171,10 @@ class UI::Command
168
171
  # }
169
172
  # UI.menu("Draw").add_item(cmd)
170
173
  #
174
+ # @note Avoid disabling an command as it often isn't obvious to the user why
175
+ # it is disabled. Prefer keeping the command enabled but show an error
176
+ # message if pressed when it cannot be used.
177
+ #
171
178
  # @return [UI::Command]
172
179
  #
173
180
  # @version SketchUp 6.0
@@ -199,7 +206,7 @@ class UI::Command
199
206
  end
200
207
 
201
208
  # The small_icon= method is used to identify the icon file for the command's
202
- # small icon. Small icons should be 16x16 pixel images for best display
209
+ # small icon. Small icons should be 24x24 pixel images for best display
203
210
  # quality.
204
211
  #
205
212
  # Since SketchUp 2016 it is possible to provide vector images for the cursors.
@@ -14,6 +14,9 @@
14
14
  # "normal" DPI. The units given will be multiplied by the same factor as
15
15
  # returned by {UI.scale_factor}.
16
16
  #
17
+ # For usage examples, including how to migrate from the old WebDialog class,
18
+ # see https://github.com/SketchUp/htmldialog-examples.
19
+ #
17
20
  # @version SketchUp 2017
18
21
  class UI::HtmlDialog
19
22
 
@@ -141,7 +144,7 @@ class UI::HtmlDialog
141
144
  # [+UI::HtmlDialog::STYLE_UTILITY+] HtmlDialog is shown with small titlebar
142
145
  # and stays on top of SketchUp.
143
146
  #
144
- # @example
147
+ # @example With options Hash
145
148
  # dialog = UI::HtmlDialog.new(
146
149
  # {
147
150
  # :dialog_title => "Dialog Example",
@@ -161,10 +164,38 @@ class UI::HtmlDialog
161
164
  # dialog.set_url("http://www.sketchup.com")
162
165
  # dialog.show
163
166
  #
167
+ # @example With keyword style argument
168
+ # dialog = UI::HtmlDialog.new(
169
+ # dialog_title: "Dialog Example",
170
+ # preferences_key: "my_name_my_extension_my_dialog",
171
+ # scrollable: true,
172
+ # resizable: true,
173
+ # width: 600,
174
+ # height: 400,
175
+ # left: 100,
176
+ # top: 100,
177
+ # min_width: 50,
178
+ # min_height: 50,
179
+ # max_width: 1000,
180
+ # max_height: 1000,
181
+ # style: UI::HtmlDialog::STYLE_DIALOG
182
+ # )
183
+ # dialog.set_url("https://www.sketchup.com")
184
+ # dialog.show
185
+ #
164
186
  # @note Prior to SketchUp 2019 the +:width+ and +:height+ provided is ignored
165
187
  # if a +:preference_key+ is also present. To work around this bug on older
166
188
  # versions use {#set_size} after you initialize the dialog.
167
189
  #
190
+ # @note Prefix +preference_key+ with something unique to your extension.
191
+ #
192
+ # @note If there is no reference kept to the HtmlDialog object, the window
193
+ # will close once the garbage collection runs. This behavior can be confusing
194
+ # in trivial test code but is usually not a concern in real life scenarios.
195
+ # Typically a persistent reference, e.g. an instance variable, should be kept
196
+ # to bring the dialog to front, rather than creating a duplicate, if the user
197
+ # should request it a second time.
198
+ #
168
199
  # @option properties [String] :dialog_title
169
200
  #
170
201
  # @option properties [String] :preferences_key
@@ -301,7 +332,7 @@ class UI::HtmlDialog
301
332
  # specific URL. This method allows you to load web sites in a HtmlDialog.
302
333
  #
303
334
  # @example
304
- # dialog.set_url("http://www.sketchup.com")
335
+ # dialog.set_url("https://www.sketchup.com")
305
336
  #
306
337
  # @param [String] url
307
338
  # The URL for a specific web site.
@@ -343,7 +374,7 @@ class UI::HtmlDialog
343
374
  # dialog.bring_to_front
344
375
  # else
345
376
  # dialog = UI::HtmlDialog.new
346
- # dialog.set_url("http://www.sketchup.com")
377
+ # dialog.set_url("https://www.sketchup.com")
347
378
  # dialog.show
348
379
  # end
349
380
  #
@@ -2,9 +2,25 @@
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # UI::Notification objects allows you to show native notifications in the
5
- # desktop, they are positioned in the top right of your screen, they can be
6
- # customized to have a message, icon and accept and/or dismiss buttons with
7
- # callback blocks.
5
+ # desktop. Notifications can have a message, icon and accept and/or dismiss
6
+ # buttons with callback blocks.
7
+ #
8
+ # @example
9
+ # # For consistency, the accept (yes) and the dismiss (no) buttons
10
+ # # are always displayed in the same order.
11
+ # message = "A new version of pizza is available. Install now?"
12
+ # notification = UI::Notification.new(sketchup_extension, message)
13
+ # notification.on_accept("Pizza!") { puts "Pizza" }
14
+ # notification.on_dismiss("No thanks") { puts "No pizza" }
15
+ # notification.show
16
+ #
17
+ # # The two options are however not treated differently by SketchUp and can
18
+ # # also be used for questions with no strict yes/no answer.
19
+ # message = "Pizza clashes with health. Select which one to keep."
20
+ # notification = UI::Notification.new(sketchup_extension, message)
21
+ # notification.on_accept("Pizza") { puts "Pizza" }
22
+ # notification.on_dismiss("Health") { puts "Salad" }
23
+ # notification.show
8
24
  #
9
25
  # @version SketchUp 2017
10
26
  class UI::Notification
@@ -77,6 +93,9 @@ class UI::Notification
77
93
  #
78
94
  # In order to insert line breaks into the message you need to use +\\r\\n+.
79
95
  #
96
+ # @bug Prior to SketchUp 2018 messages could only be 3 lines long on Windows
97
+ # and 2 lines on Mac. Now the notification expands to fit its content.
98
+ #
80
99
  # @example
81
100
  # notification = UI::Notification.new(sketchup_extension, "Hello world", "/path/to/icon", "icon Tooltip")
82
101
  # notification.show
@@ -113,8 +132,8 @@ class UI::Notification
113
132
  def message
114
133
  end
115
134
 
116
- # Sets a new message, notifications are meant for quick & brief messages,
117
- # remember that they are dismissed automatically.
135
+ # Sets a new message. Notifications are meant for quick & brief messages.
136
+ # Remember that they disappear automatically.
118
137
  #
119
138
  # @example
120
139
  # notification = UI::Notification.new(sketchup_extension)
@@ -133,6 +152,9 @@ class UI::Notification
133
152
  # Shows a button in the notification with the given title and callback block,
134
153
  # both arguments are required.
135
154
  #
155
+ # @bug Prior to SketchUp 2019 both the accept and dismiss buttons were
156
+ # displayed, even if only one had been implemented.
157
+ #
136
158
  # @example
137
159
  # notification = UI::Notification.new(sketchup_extension, "Hello world")
138
160
  # notification.on_accept("Accept") do |notification, title|
@@ -171,8 +193,13 @@ class UI::Notification
171
193
  def on_accept_title
172
194
  end
173
195
 
174
- # Shows a button in the notification with the given title and callback block,
175
- # both arguments are required.
196
+ # Shows a button in the notification with the given title and callback block.
197
+ # Both arguments are required. This callback is only called if you press the
198
+ # Dismiss button, not when the time runs out and the notification automatically
199
+ # disappears.
200
+ #
201
+ # @bug Prior to SketchUp 2019 both the accept and dismiss buttons were
202
+ # displayed, even if only one had been implemented.
176
203
  #
177
204
  # @example
178
205
  # notification = UI::Notification.new(sketchup_extension, "Hello world")
@@ -212,9 +239,8 @@ class UI::Notification
212
239
  def on_dismiss_title
213
240
  end
214
241
 
215
- # Shows the notification in the top right of the screen, the notifications will
216
- # be ordered from top to bottom if multiple notifications are shown, it will
217
- # automatically be dismissed if no action is taken.
242
+ # Shows the notification. If not interacted with, the notification will
243
+ # disappear without calling any callbacks.
218
244
  #
219
245
  # @example
220
246
  # notification = UI::Notification.new(sketchup_extension, "Hello world")
@@ -5,7 +5,7 @@
5
5
  # boxes from Ruby.
6
6
  #
7
7
  # If your goal is to simply display a website to your users, consider using
8
- # UI.getURL, which will show them a web page in their default browser rather
8
+ # {UI.openURL}, which will show them a web page in their default browser rather
9
9
  # than inside a dialog in SketchUp.
10
10
  #
11
11
  # See this blog post for a detailed, step-by-step example:
@@ -428,7 +428,7 @@ class UI::WebDialog
428
428
  def set_background_color(color)
429
429
  end
430
430
 
431
- # The #{set_file} method is used to identify a local HTML file to display in
431
+ # The {#set_file} method is used to identify a local HTML file to display in
432
432
  # the webdialog.
433
433
  #
434
434
  # @example
@@ -147,6 +147,8 @@
147
147
  PAGE_USE_ALL = nil # Stub value.
148
148
  PAGE_USE_CAMERA = nil # Stub value.
149
149
  PAGE_USE_HIDDEN = nil # Stub value.
150
+ PAGE_USE_HIDDEN_GEOMETRY = nil # Stub value.
151
+ PAGE_USE_HIDDEN_OBJECTS = nil # Stub value.
150
152
  PAGE_USE_LAYER_VISIBILITY = nil # Stub value.
151
153
  PAGE_USE_RENDERING_OPTIONS = nil # Stub value.
152
154
  PAGE_USE_SECTION_PLANES = nil # Stub value.
@@ -167,6 +167,9 @@ module Geom
167
167
  # The {.linear_combination} method is used to compute the linear combination of
168
168
  # points or vectors.
169
169
  #
170
+ # A linear combination is a standard term for vector math. It is defined as
171
+ # vector = weight1 * vector1 + weight2 * vector2.
172
+ #
170
173
  # @example
171
174
  # point1 = Geom::Point3d.new(1, 1, 1)
172
175
  # point2 = Geom::Point3d.new(10, 10, 10)
@@ -306,7 +306,7 @@ module Sketchup
306
306
  def self.format_angle(number)
307
307
  end
308
308
 
309
- # The #{format_area} method formats a number as an area using the current units
309
+ # The {.format_area} method formats a number as an area using the current units
310
310
  # settings.
311
311
  #
312
312
  # The +number+ must be in square inches.
@@ -363,7 +363,7 @@ module Sketchup
363
363
  def self.format_length(*args)
364
364
  end
365
365
 
366
- # The #{format_volume} method formats a number as a volume using the current
366
+ # The {.format_volume} method formats a number as a volume using the current
367
367
  # units settings.
368
368
  #
369
369
  # The +number+ must be in cubic inches.
@@ -427,10 +427,9 @@ module Sketchup
427
427
  # The os_language method returns the language code for the language SketchUp
428
428
  # is running in. This is an alias for the get_locale method.
429
429
  #
430
- # Valid return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW,
431
- # pt-BR, nl, ru.
432
- # If the OS language does not have corresponding folder and files in the
433
- # SketchUp Resources folder, the returned language is, by default, en-US.
430
+ # Examples of return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW,
431
+ # pt-BR, nl, ru and sv. For an up to date list os supported languages, see
432
+ # the SketchUp download page.
434
433
  #
435
434
  # @example
436
435
  # language = Sketchup.os_language
@@ -461,7 +460,7 @@ module Sketchup
461
460
  # The get_shortcuts method retrieves an array of all keyboard shortcuts
462
461
  # currently registered with SketchUp. Each shortcut is returned as a
463
462
  # string with the shortcut and the command separated by a tab, similar
464
- # to "Ctrl+A\tEdit/Select All"
463
+ # to "Ctrl+A\\tEdit/Select All"
465
464
  #
466
465
  # @example
467
466
  # shortcuts = Sketchup.get_shortcuts
@@ -502,9 +501,15 @@ module Sketchup
502
501
  # UI.messagebox("Error during unzip: " + error)
503
502
  # end
504
503
  #
505
- # @param [String] filename
504
+ # @param [String] filepath
506
505
  # The path to the RBZ or ZIP file to install.
507
506
  #
507
+ # @param [Boolean] show_warning
508
+ # Whether to warn the user not to install untrusted extensions.
509
+ # In certain cases the warning can be confusing and redundant, e.g. when
510
+ # automatically updating a trusted extension. When the user has selected
511
+ # the archive themselves, it is best to warn about the possible risks.
512
+ #
508
513
  # @raise [Exception] If the archive cannot be installed.
509
514
  #
510
515
  # @raise [Interrupt] If the user cancel the installation.
@@ -514,7 +519,7 @@ module Sketchup
514
519
  # @return [Boolean]
515
520
  #
516
521
  # @version SketchUp 8.0 M2
517
- def self.install_from_archive(filename)
522
+ def self.install_from_archive(filepath, show_warning = true)
518
523
  end
519
524
 
520
525
  # This methods indicates whether the host SketchUp application is 64bit.
@@ -551,15 +556,15 @@ module Sketchup
551
556
  end
552
557
 
553
558
  # Returns a boolean flag indicating whether the application is SketchUp Pro.
554
- # Note that after the free trial period, SketchUp Pro will revert to regular
555
- # SketchUp and this method will return false until the user registers
556
- # the product.
557
559
  #
558
560
  # @example
559
561
  # if Sketchup.is_pro?
560
562
  # UI.messagebox("You are running SU Pro.")
561
563
  # end
562
564
  #
565
+ # @note In SketchUp Make this method will return +true+ during the Pro trial
566
+ # period and revert to +false+ when the trial period is over.
567
+ #
563
568
  # @return [Boolean]
564
569
  #
565
570
  # @version SketchUp 7.0
@@ -603,28 +608,44 @@ module Sketchup
603
608
  def self.load(path)
604
609
  end
605
610
 
606
- # The open_file method is used to open a file.
611
+ # The {.open_file} method is used to open a SketchUp model.
607
612
  #
608
613
  # @example
609
614
  # result = Sketchup.open_file("C:\\model.skp")
610
615
  #
611
- # @param [String] filename
612
- # The path and filename to open.
616
+ # @overload open_file(filename)
613
617
  #
614
- # @return [Boolean] true if opening the file succeeded,
615
- # false otherwise.
618
+ # @deprecated Prefer +with_status+ overload instead of this variant.
619
+ # @param [String] filename The model file to open.
620
+ # @return [Boolean] +true+ if opening the file succeeded,
621
+ # +false+ otherwise.
622
+ #
623
+ # @overload open_file(filename, with_status: true)
624
+ #
625
+ # Starting with SketchUp 2021.0 SketchUp attempts to load newer SketchUp
626
+ # models. If a newer model is loaded some information might have been skipped
627
+ # and extensions should be careful to not save over the file they loaded from
628
+ # as information might be lost.
629
+ #
630
+ # Success status codes:
631
+ # * {Sketchup::Model::LOAD_STATUS_SUCCESS}
632
+ # * {Sketchup::Model::LOAD_STATUS_SUCCESS_MORE_RECENT}
633
+ #
634
+ # @version SketchUp 2021.0
635
+ # @param [String] filename The model file to open.
636
+ # @return [Integer, false] status code if opening the file succeeded,
637
+ # +false+ otherwise.
616
638
  #
617
639
  # @version SketchUp 6.0
618
- def self.open_file(filename)
640
+ def self.open_file(*args)
619
641
  end
620
642
 
621
643
  # The os_language method returns the language code for the language SketchUp
622
644
  # is running in. This is an alias for the get_locale method.
623
645
  #
624
- # Valid return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW,
625
- # pt-BR, nl, ru.
626
- # If the OS language does not have corresponding folder and files in the
627
- # SketchUp Resources folder, the returned language is, by default, en-US.
646
+ # Examples of return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW,
647
+ # pt-BR, nl, ru and sv. For an up to date list os supported languages, see
648
+ # the SketchUp download page.
628
649
  #
629
650
  # @example
630
651
  # language = Sketchup.os_language
@@ -751,6 +772,17 @@ module Sketchup
751
772
  def self.read_default(section, variable, default = nil)
752
773
  end
753
774
 
775
+ # The redo method is used redo the last transaction on the redo stack.
776
+ #
777
+ # @example
778
+ # Sketchup.redo
779
+ #
780
+ # @return [nil]
781
+ #
782
+ # @version SketchUp 2021.0
783
+ def self.redo
784
+ end
785
+
754
786
  # The register_extension method is used to register an extension with
755
787
  # SketchUp's extension manager (in SketchUp preferences).
756
788
  #
@@ -70,8 +70,8 @@ module UI
70
70
  # UI.set_cursor(cursor_id)
71
71
  # end
72
72
  #
73
- # @param [String] filename
74
- # Filename for an image.
73
+ # @param [String] path
74
+ # File path to an image.
75
75
  #
76
76
  # @param [Integer] hot_x
77
77
  # An x coordinate that is the "hotpoint" for the cursor
@@ -88,7 +88,7 @@ module UI
88
88
  # @return [Integer] ID associated with the cursor
89
89
  #
90
90
  # @version SketchUp 6.0
91
- def self.create_cursor(filename, hot_x, hot_y)
91
+ def self.create_cursor(path, hot_x, hot_y)
92
92
  end
93
93
 
94
94
  # Creates a dialog box for inputting user information. The dialog box contains
@@ -325,7 +325,9 @@ module UI
325
325
  end
326
326
 
327
327
  # The preferences_pages method is used to returns the names of all the
328
- # preferences pages. These include windows like Extensions.
328
+ # preferences pages. These include windows like Templates.
329
+ #
330
+ # [SketchUp 2017] <code>"Extensions"</code> page was removed.
329
331
  #
330
332
  # @example
331
333
  # prefs = UI.preferences_pages
@@ -469,7 +471,7 @@ module UI
469
471
  def self.select_directory(options = {})
470
472
  end
471
473
 
472
- # The #{set_cursor} method is used to change the cursor to a new cursor with a
474
+ # The {.set_cursor} method is used to change the cursor to a new cursor with a
473
475
  # given cursor id. See UI.create_cursor and the Tool class for details
474
476
  # on creating your own tools with arbitrary cursors.
475
477
  #
@@ -543,7 +545,6 @@ module UI
543
545
  # {UI.model_info_pages}.
544
546
  #
545
547
  # [SketchUp 2014] <code>"Classifications"</code> page was added.
546
- # [SketchUp 2017] <code>"Extensions"</code> page was removed.
547
548
  #
548
549
  # @example
549
550
  # UI.show_model_info('Credits')
@@ -558,9 +559,9 @@ module UI
558
559
  end
559
560
 
560
561
  # The show_preferences method is used to display a SketchUp preferences dialog.
561
- # You can get the list of valid dialogs with UI.preferences_pages.
562
+ # You can get the list of valid dialogs with {UI.preferences_pages}.
562
563
  #
563
- # Note that under OSX this method doesn't currently work.
564
+ # @bug Under OSX this method doesn't currently work.
564
565
  #
565
566
  # @example
566
567
  # status = UI.show_preferences('GraphicsCard')