sketchup-api-stubs 0.7.2 → 0.7.7

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 (149) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +3 -1
  3. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +15 -11
  4. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +5 -5
  5. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +5 -5
  6. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
  7. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +5 -6
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +18 -18
  9. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +27 -10
  10. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +1 -1
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +1 -1
  12. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +1 -1
  13. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +2 -3
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +4 -4
  15. data/lib/sketchup-api-stubs/stubs/Layout.rb +1 -1
  16. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +5 -1
  17. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +1 -1
  18. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +7 -14
  19. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +1 -1
  20. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +61 -5
  21. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +1 -1
  22. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +7 -14
  23. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +1 -1
  24. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +1 -1
  25. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +189 -1
  26. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +1 -1
  27. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +9 -4
  28. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +2 -3
  29. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +1 -1
  30. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +1 -1
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +7 -14
  32. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +6 -2
  33. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +1 -1
  34. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +1 -1
  35. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +1 -1
  36. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +1 -1
  37. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +7 -14
  38. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +1 -1
  39. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
  40. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +148 -5
  41. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1 -1
  42. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +1 -1
  43. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +1 -1
  44. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +1 -1
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +1 -1
  46. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +5 -1
  47. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +4 -4
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +1 -1
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +3 -3
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +6 -1
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +1 -1
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +32 -58
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +110 -209
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +1 -1
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +1 -1
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +24 -11
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +24 -9
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +58 -57
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +1 -1
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +1 -1
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +16 -9
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +135 -39
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +6 -4
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +6 -4
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +1 -1
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +3 -9
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +5 -1
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +1 -1
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +10 -4
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +8 -14
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +1 -1
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +55 -26
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +6 -4
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +20 -15
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +6 -5
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +9 -8
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +232 -65
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +1 -1
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +98 -45
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +48 -41
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +7 -7
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +60 -1
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +47 -7
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +11 -12
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +33 -21
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +6 -4
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +5 -2
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +115 -68
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +225 -29
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +118 -5
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +2 -2
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +1 -1
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +2 -13
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +1 -1
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +8 -10
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +16 -9
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +6 -5
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +9 -11
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +126 -73
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +5 -4
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +2 -3
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +7 -7
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +4 -4
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +143 -40
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +22 -12
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +6 -5
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +37 -15
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +1 -1
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +5 -4
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +10 -5
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +20 -20
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -1
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +5 -5
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +6 -4
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +1 -1
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +9 -3
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +1 -1
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +14 -22
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +1 -1
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +31 -25
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +2 -2
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +6 -4
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +32 -22
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +1 -1
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +73 -67
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +6 -4
  134. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +13 -6
  135. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +132 -10
  136. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +94 -54
  137. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +1 -1
  138. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +3 -3
  139. data/lib/sketchup-api-stubs/stubs/_top_level.rb +3 -1
  140. data/lib/sketchup-api-stubs/stubs/array.rb +1 -1
  141. data/lib/sketchup-api-stubs/stubs/geom.rb +4 -1
  142. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +1 -1
  143. data/lib/sketchup-api-stubs/stubs/length.rb +1 -1
  144. data/lib/sketchup-api-stubs/stubs/numeric.rb +1 -1
  145. data/lib/sketchup-api-stubs/stubs/sketchup.rb +66 -23
  146. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +1 -1
  147. data/lib/sketchup-api-stubs/stubs/string.rb +1 -1
  148. data/lib/sketchup-api-stubs/stubs/ui.rb +17 -12
  149. metadata +5 -3
@@ -1,10 +1,11 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # This observer interface is implemented to react to pages events. To
5
- # implement this observer, create a Ruby class of this type, override the
6
- # desired methods, and add an instance of the observer to the objects of
7
- # interests.
4
+ # This observer interface is implemented to react to pages events.
5
+ #
6
+ # @abstract To implement this observer, create a Ruby class of this type, override the
7
+ # desired methods, and add an instance of the observer to the objects of
8
+ # interests.
8
9
  #
9
10
  # @example
10
11
  # # This is an example of an observer that watches the pages for new ones.
@@ -1,15 +1,26 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # The PickHelper class is used to pick entities that reside under the current
5
- # cursor location. PickHelper and InputPoint are similar, but InputPoint also
6
- # uses inferencing. You can retrieve a PickHelper object using the pick_helper
7
- # method on a View object.
4
+ # The {Sketchup::PickHelper} class is used to pick entities that reside under
5
+ # the current cursor location, similar to native Select tool. Unlike
6
+ # {Sketchup::InputPoint}, {Sketchup::PickHelper} uses no inference.
7
+ #
8
+ # Only {Sketchup::Tool}s react to cursor location and most of these methods are
9
+ # only useful in the context of a tool. For example, if you want to determine
10
+ # the entity you just clicked, you would use {#do_pick} from within your
11
+ # {Sketchup::Tool#onLButtonDown} method.
12
+ #
13
+ # You can retrieve a PickHelper object using the {Sketchup::View#pick_helper}
14
+ # method.
8
15
  #
9
16
  # Entities that are picked (found under the
10
17
  # cursor when a mouse or keyboard event occurs), are called Pick Records and
11
18
  # are placed in an indexed list.
12
19
  #
20
+ # @note The same {Sketchup::Pickhelper} instance is being reused by SketchUp.
21
+ # Don't extend, add methods or redefine methods on this object as it can
22
+ # clash with other extensions.
23
+ #
13
24
  # @version SketchUp 6.0
14
25
  class Sketchup::PickHelper
15
26
 
@@ -110,8 +121,8 @@ class Sketchup::PickHelper
110
121
  # entities in the list of pick records.
111
122
  #
112
123
  # @example
113
- # ph = view.pick_helper
114
- # ph.do_pick(x, y)
124
+ # pickhelper = view.pick_helper
125
+ # pickhelper.do_pick(x, y)
115
126
  # # Iterate all pick-routes:
116
127
  # pickhelper.count.times { |pick_path_index|
117
128
  # puts pickhelper.depth_at(pick_path_index)
@@ -156,8 +167,8 @@ class Sketchup::PickHelper
156
167
  # Use count() to get the number of possible pick paths.
157
168
  #
158
169
  # @example
159
- # ph = view.pick_helper
160
- # ph.do_pick(x, y)
170
+ # pickhelper = view.pick_helper
171
+ # pickhelper.do_pick(x, y)
161
172
  # # Iterate all pick-routes:
162
173
  # pickhelper.count.times { |pick_path_index|
163
174
  # puts pickhelper.element_at(pick_path_index)
@@ -212,8 +223,8 @@ class Sketchup::PickHelper
212
223
  # Use count() to get the number of possible pick paths.
213
224
  #
214
225
  # @example
215
- # ph = view.pick_helper
216
- # ph.do_pick(x, y)
226
+ # pickhelper = view.pick_helper
227
+ # pickhelper.do_pick(x, y)
217
228
  # # Iterate all pick-routes:
218
229
  # pickhelper.count.times { |pick_path_index|
219
230
  # p pickhelper.leaf_at(pick_path_index)
@@ -239,8 +250,8 @@ class Sketchup::PickHelper
239
250
  # item will be a drawing element that is not a group, component or image.
240
251
  #
241
252
  # @example
242
- # ph = view.pick_helper
243
- # ph.do_pick(x, y)
253
+ # pickhelper = view.pick_helper
254
+ # pickhelper.do_pick(x, y)
244
255
  # # Iterate all pick-routes:
245
256
  # pickhelper.count.times { |pick_path_index|
246
257
  # p pickhelper.path_at(pick_path_index)
@@ -399,13 +410,24 @@ class Sketchup::PickHelper
399
410
  # coordinates of the leaf entity into the coordinates of the active entities.
400
411
  #
401
412
  # @example
402
- # ph = view.pick_helper
403
- # ph.do_pick(x, y)
413
+ # pickhelper = view.pick_helper
414
+ # pickhelper.do_pick(x, y)
404
415
  # # Iterate all pick-routes:
405
416
  # pickhelper.count.times { |pick_path_index|
406
417
  # puts pickhelper.transformation_at(pick_path_index)
407
418
  # }
408
419
  #
420
+ # @example Get transformation for specific picked element
421
+ # pickhelper = view.pick_helper
422
+ # pickhelper.do_pick(x, y)
423
+ # face = pickhelper.picked_face # Face may be inside a group or component.
424
+ #
425
+ # index = pickhelper.count.times.find { |i| pickhelper.leaf_at(i) == face }
426
+ # transformation = index ? pickhelper.transformation_at(index) : IDENTITY
427
+ #
428
+ # # Face#area is one method that may need a transformation.
429
+ # area = face.area(transformation)
430
+ #
409
431
  # @param index
410
432
  # The index where the transformation should be retrieved.
411
433
  #
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The {Sketchup::RegionalSettings} module contains methods getting information about the
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The RenderingOptions class contains method to extract the rendering
@@ -1,10 +1,11 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # This observer interface is implemented to react to rendering options events.
5
- # To implement this observer, create a Ruby class of this type, implement the
6
- # desired methods, and add an instance of the observer to the objects of
7
- # interests.
5
+ #
6
+ # @abstract To implement this observer, create a Ruby class of this type, implement the
7
+ # desired methods, and add an instance of the observer to the objects of
8
+ # interests.
8
9
  #
9
10
  # @example
10
11
  # # This is an example of an observer that watches the rendering options
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The SectionPlane class represents a section plane in a SketchUp model. Note
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # A set of the currently selected entities. Use the Model.selection method
@@ -38,7 +38,7 @@ class Sketchup::Selection
38
38
  # @param [Integer] index
39
39
  # The index of the Entity object to retrieve.
40
40
  #
41
- # @return [Sketchup::Entitiy, nil]
41
+ # @return [Sketchup::Entity, nil]
42
42
  #
43
43
  # @see #at
44
44
  #
@@ -108,7 +108,7 @@ class Sketchup::Selection
108
108
  # @param [Integer] index
109
109
  # The index of the Entity object to retrieve.
110
110
  #
111
- # @return [Sketchup::Entitiy, nil]
111
+ # @return [Sketchup::Entity, nil]
112
112
  #
113
113
  # @see #[]
114
114
  #
@@ -172,7 +172,12 @@ class Sketchup::Selection
172
172
  # efficient than using [].
173
173
  #
174
174
  # @example
175
- # selection.each { |entity| UI.messagebox(entity) }
175
+ # selection.each { |entity| puts entity }
176
+ #
177
+ # @note Don't remove content from this collection while iterating over it with
178
+ # {#each}. This would change the size of the collection and cause elemnts to
179
+ # be skipped as the indices change. Instead copy the current collection to an
180
+ # array using +to_a+ and then use +each+ on the array, when removing content.
176
181
  #
177
182
  # @return [nil]
178
183
  #
@@ -232,7 +237,7 @@ class Sketchup::Selection
232
237
  def include?(entity)
233
238
  end
234
239
 
235
- # The #{invert} method is used to invert the selection.
240
+ # The {#invert} method is used to invert the selection.
236
241
  #
237
242
  # @example
238
243
  # model = Sketchup.active_model
@@ -1,10 +1,11 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # This observer interface is implemented to react to selection events. To
5
- # implement this observer, create a Ruby class of this type, override the
6
- # desired methods, and add an instance of the observer to the objects of
7
- # interests.
4
+ # This observer interface is implemented to react to selection events.
5
+ #
6
+ # @abstract To implement this observer, create a Ruby class of this type, override the
7
+ # desired methods, and add an instance of the observer to the objects of
8
+ # interests.
8
9
  #
9
10
  # @example
10
11
  # # This is an example of an observer that watches the selection for
@@ -30,7 +31,7 @@ class Sketchup::SelectionObserver
30
31
  # end
31
32
  #
32
33
  # @note This event might not trigger even if a single element is selected. For
33
- # instance the Selection tool will trigger #onSelectionBulkChange regardless.
34
+ # instance the Selection tool will trigger {#onSelectionBulkChange} regardless.
34
35
  #
35
36
  # @param [Sketchup::Selection] selection
36
37
  #
@@ -53,7 +54,7 @@ class Sketchup::SelectionObserver
53
54
  #
54
55
  # @example
55
56
  # def onSelectionBulkChange(selection)
56
- # puts "onSelectionRemoved: #{selection}"
57
+ # puts "onSelectionBulkChange: #{selection}"
57
58
  # end
58
59
  #
59
60
  # @param [Sketchup::Selection] selection
@@ -80,27 +81,26 @@ class Sketchup::SelectionObserver
80
81
  def onSelectionCleared(selection)
81
82
  end
82
83
 
84
+ #
85
+ # @bug Due to a bug in SketchUp this event doesn't trigger. Instead
86
+ # +onSelectedRemoved+ is called.
83
87
  #
84
88
  # @example
85
89
  # class MySelectionObserver < Sketchup::SelectionObserver
86
- # # Note that there is a bug that prevent this from being called. Instead
87
- # # listen to onSelectedRemoved until the bug is fixed.
88
- # def onSelectionRemoved(selection, entity)
89
- # puts "onSelectionRemoved: #{entity}"
90
- # end
91
- # # To work around this you must catch this event instead until the bug is
92
- # # fixed:
93
- # def onSelectedRemoved(selection, entity)
94
- # # You can forward it to the correct event to be future compatible.
95
- # onSelectionRemoved(selection, entity)
96
- # end
90
+ # def onSelectionRemoved(selection, entity)
91
+ # puts "onSelectionRemoved: #{entity}"
92
+ # end
93
+ #
94
+ # # Due to a SketchUp bug, this method is called by the wrong name.
95
+ # alias_method :onSelectedRemoved, :onSelectionRemoved
97
96
  # end
98
97
  #
99
98
  # # Attach the observer.
100
99
  # Sketchup.active_model.selection.add_observer(MySelectionObserver.new)
101
100
  #
102
- # @note Due to a bug in SketchUp this event doesn't trigger. Instead
103
- # +onSelectedRemoved+ is called.
101
+ # @note This event might not trigger even if a single element is deselected.
102
+ # For instance the Selection tool will trigger {#onSelectionBulkChange}
103
+ # regardless.
104
104
  #
105
105
  # @param [Sketchup::Selection] selection
106
106
  #
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The set class represents a collection of unique objects. This class is useful
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The ShadowInfo class contains method to extract the shadow information for a
@@ -20,7 +20,7 @@
20
20
  # - +Latitude+ (in Model Info > Geo-location > Set Manual Location...)
21
21
  # - +Light+ (in Window > Shadows)
22
22
  # - +Longitude+ (in Model Info > Geo-location > Set Manual Location...)
23
- # - +North+ Angle (in View > Toolbars > Solar North) Note that 'Toolbar' is called 'Tool Palettes' on Mac
23
+ # - +NorthAngle+ (in View > Toolbars > Solar North) Note that 'Toolbar' is called 'Tool Palettes' on Mac
24
24
  # - +ShadowTime+ (in Window > Shadows)
25
25
  # - +ShadowTime_time_t+ (ShadowTime in Epoch time)
26
26
  # - +SunDirection+ (Generated based on ShadowTime)
@@ -50,7 +50,7 @@ class Sketchup::ShadowInfo < Sketchup::Entity
50
50
  # The each_key method iterates through all of the shadow information keys.
51
51
  #
52
52
  # @example
53
- # shadowinfo.each_key { |key| UI.messagebox(key) }
53
+ # shadowinfo.each_key { |key| puts key }
54
54
  #
55
55
  # @return [nil]
56
56
  #
@@ -165,7 +165,7 @@ class Sketchup::ShadowInfo < Sketchup::Entity
165
165
  # The each_key method iterates through all of the shadow information keys.
166
166
  #
167
167
  # @example
168
- # shadowinfo.each_key { |key| UI.messagebox(key) }
168
+ # shadowinfo.each_key { |key| puts key }
169
169
  #
170
170
  # @return [nil]
171
171
  #
@@ -175,7 +175,7 @@ class Sketchup::ShadowInfo < Sketchup::Entity
175
175
  def each_key
176
176
  end
177
177
 
178
- # The #{each_pair} method is an alias for {#each}.
178
+ # The {#each_pair} method is an alias for {#each}.
179
179
  #
180
180
  # @example
181
181
  # model = Sketchup.active_model
@@ -1,10 +1,12 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # This observer interface is implemented to react to changes to the shadow
5
- # settings. To implement this observer, create a Ruby class of this type,
6
- # override the desired methods, and add an instance of the observer to the
7
- # {Sketchup::ShadowInfo} object.
5
+ # settings.
6
+ #
7
+ # @abstract To implement this observer, create a Ruby class of this type,
8
+ # override the desired methods, and add an instance of the observer to the
9
+ # {Sketchup::ShadowInfo} object.
8
10
  #
9
11
  # @example
10
12
  # # This is an example of an observer that watches the selection for
@@ -0,0 +1,40 @@
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The {Sketchup::Skp} module is used to read metadata from external SketchUp
5
+ # files without loading the whole file.
6
+ #
7
+ # @version SketchUp 2021.0
8
+ module Sketchup::Skp
9
+
10
+ # Class Methods
11
+
12
+ # The {.read_guid} method is used to read the GUID, globally unique identifier,
13
+ # for an external model.
14
+ #
15
+ # In SketchUp, GUIDs are used to test if {Sketchup::ComponentDefinition}s and
16
+ # {Sketchup::Model}s match (a component being an embedded model).
17
+ # When you insert a component to a model, its GUID is compared to existing
18
+ # component definitions in that model, and if there is a match the existing
19
+ # component definition is re-used rather than a duplicate being added.
20
+ # When a component definition is modified or a model is saved, their GUIDs are
21
+ # renewed.
22
+ #
23
+ # @example
24
+ # model = Sketchup.active_model
25
+ # definitions = model.definitions
26
+ # definition = definitions.find { |definition| !definition.internal? }
27
+ # # true if component matches its external file.
28
+ # definition.guid == Sketchup::Skp.read_guid(definition.path)
29
+ #
30
+ # @param [String] filepath
31
+ #
32
+ # @raise [ArgumentError] if the file is missing or is not a SketchUp model.
33
+ #
34
+ # @return [String]
35
+ #
36
+ # @version SketchUp 2021.0
37
+ def self.read_guid(filepath)
38
+ end
39
+
40
+ end
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The Style class contains methods for modifying information about a specific
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The Styles class contains methods for manipulating a collection of styles in
@@ -38,7 +38,12 @@ class Sketchup::Styles < Sketchup::Entity
38
38
  def [](arg)
39
39
  end
40
40
 
41
- # The #{active_style} method is used to retrieve the active style.
41
+ # The {#active_style} method is used to retrieve the active style.
42
+ #
43
+ # While {#selected_style} is the style being selected in the Style Browser,
44
+ # the #{active_style} is a different object also including any unsaved style
45
+ # changes. These changes are silently dropped once a new style is selected.
46
+ # To save these changes to the selected style, call #{update_selected_style}.
42
47
  #
43
48
  # @example
44
49
  # styles = Sketchup.active_model.styles
@@ -152,7 +157,8 @@ class Sketchup::Styles < Sketchup::Entity
152
157
  def purge_unused
153
158
  end
154
159
 
155
- # The {#selected_style} method is used to retrieve the currently selected style.
160
+ # The {#selected_style} method is used to retrieve the style currently
161
+ # selected in the Styles Browser.
156
162
  #
157
163
  # @example
158
164
  # styles = Sketchup.active_model.styles
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The Text class contains method to manipulate a Text entity object.
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The Texture class contains methods for obtaining information about textures
@@ -41,27 +41,19 @@ class Sketchup::Texture < Sketchup::Entity
41
41
  def average_color
42
42
  end
43
43
 
44
- # The filename method retrieves the entire path, including the file, for a
44
+ # The {#filename} method retrieves the entire path, including the file, for a
45
45
  # texture object.
46
46
  #
47
47
  # @example
48
48
  # model = Sketchup.active_model
49
- # materials=model.materials
50
- # # Adds a material as an in model material
51
- # m = materials.add "Test Color"
52
- # begin
53
- # # Returns nil if not successful, path if successful
54
- # m.texture = "c:\\Materials\\Carpet.jpg"
55
- # rescue
56
- # UI.messagebox $!.message
57
- # end
58
- # texture = m.texture
49
+ # materials = model.materials
50
+ # material = materials.add("Test Color")
51
+ # material.texture = "c:\\Materials\\Carpet.jpg"
52
+ # texture = material.texture
59
53
  # filename = texture.filename
60
- # if (filename)
61
- # UI.messagebox filename
62
- # else
63
- # UI.messagebox "Failure"
64
- # end
54
+ #
55
+ # @note Since SketchUp 2021.0 this method will append a file extension matching
56
+ # the image format if the file extension is missing from stored filepath.
65
57
  #
66
58
  # @return [String] a string representation of the path and
67
59
  # filename used for the texture.
@@ -206,11 +198,11 @@ class Sketchup::Texture < Sketchup::Entity
206
198
  # @example
207
199
  # material = Sketchup.active_model.materials[0]
208
200
  # basename = File.basename(material.texture.filename)
209
- # filename = File.join(Sketchup.temp_dir, basename)
210
- # material.texture.write(filename)
201
+ # path = File.join(Sketchup.temp_dir, basename)
202
+ # material.texture.write(path)
211
203
  #
212
- # @param [String] filename
213
- # String - The filename to write the texture to.
204
+ # @param [String] path
205
+ # The file path to write the texture to.
214
206
  #
215
207
  # @param [Boolean] colorize
216
208
  # Boolean - Allows for the texture to
@@ -219,7 +211,7 @@ class Sketchup::Texture < Sketchup::Entity
219
211
  # @return [Boolean] true if the method succeeded
220
212
  #
221
213
  # @version SketchUp 2016
222
- def write(filename, colorize = false)
214
+ def write(path, colorize = false)
223
215
  end
224
216
 
225
217
  end