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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7515fa1b0378994644bdfad8f24f5f3c413c8f8eafe95157fe2c332c81c17a3
4
- data.tar.gz: dc488129bd90c5bfdba9e210cf7ace6296b315bce1a51d0dfffb03d0417335c1
3
+ metadata.gz: df20d75744c6496aa0a1c242f2c95a854a14b426252a6d96440c54671916f90b
4
+ data.tar.gz: d504706510a4267fd6651f8a4061cba83c2637266fc43a9b10de3134f4682207
5
5
  SHA512:
6
- metadata.gz: 2d70441053546ca8f65e677403882a3ed9fe3d73589271c96a3cb55f9e661a3997f3149d51a0eee3883b7fef6b2b92313fd05d1d6b6d43089e10bebe157477fc
7
- data.tar.gz: f55bc89cfd036c6690f047acd372d943daef6f532f981090022bf30d8fb728bff404cc0b0e7f291ab24971089f1e89e1ba929801589bfc3654e1174fcfb9177b
6
+ metadata.gz: f9b7449db18cac6f521868bfb57f38838c29d8d5387616fdde883f599ec1d30290c434850942e9451af38b260ce007a76ddf573fb9fabe03883e84d483fbbdac
7
+ data.tar.gz: 4ae01a4e7bc65fca2484d247d285873a344ca9e5fc2e43eee3d07e391ece4747a121db1cc08f89ea1b2afc64c636b217c51edf24c1d99f7fdf94317c351ec685
@@ -94,6 +94,7 @@ require 'sketchup-api-stubs/stubs/Sketchup/InputPoint.rb'
94
94
  require 'sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb'
95
95
  require 'sketchup-api-stubs/stubs/Sketchup/InstancePath.rb'
96
96
  require 'sketchup-api-stubs/stubs/Sketchup/Layer.rb'
97
+ require 'sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb'
97
98
  require 'sketchup-api-stubs/stubs/Sketchup/Layers.rb'
98
99
  require 'sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb'
99
100
  require 'sketchup-api-stubs/stubs/Sketchup/Licensing.rb'
@@ -123,6 +124,7 @@ require 'sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb'
123
124
  require 'sketchup-api-stubs/stubs/Sketchup/Set.rb'
124
125
  require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb'
125
126
  require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb'
127
+ require 'sketchup-api-stubs/stubs/Sketchup/Skp.rb'
126
128
  require 'sketchup-api-stubs/stubs/Sketchup/Style.rb'
127
129
  require 'sketchup-api-stubs/stubs/Sketchup/Styles.rb'
128
130
  require 'sketchup-api-stubs/stubs/Sketchup/Text.rb'
@@ -2,7 +2,7 @@
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # Bounding boxes are three-dimensional boxes (eight corners), aligned with the
5
- # global axes, that surround entities within your model. There is a default
5
+ # axes, that surround entities within your model. There is a default
6
6
  # bounding box for any new model that will surround all entities,
7
7
  # including all groups and components. Additionally, there are
8
8
  # bounding boxes for Drawingelement objects, including components and groups.
@@ -154,15 +154,17 @@ class Geom::BoundingBox
154
154
  def corner(corner_index)
155
155
  end
156
156
 
157
- # The {#depth} method is used to retrieve the depth of the bounding box.
157
+ # The {#depth} method is used to retrieve the Z extents of the bounding box.
158
158
  #
159
159
  # @example
160
160
  # boundingbox = Geom::BoundingBox.new
161
161
  # boundingbox.add([100, 200, -400], [200, 400, 100])
162
162
  # # This will return a Length of 500.0.
163
- # length = boundingbox.depth
163
+ # height = boundingbox.depth
164
164
  #
165
- # @return [Length] the depth of the bounding box
165
+ # @note In SketchUp's coordinate system, this corresponds to the height.
166
+ #
167
+ # @return [Length]
166
168
  #
167
169
  # @version SketchUp 6.0
168
170
  def depth
@@ -200,15 +202,17 @@ class Geom::BoundingBox
200
202
  def empty?
201
203
  end
202
204
 
203
- # The {#height} method is used to retrieve the height of the bounding box.
205
+ # The {#height} method is used to retrieve the Y extent of the bounding box.
204
206
  #
205
207
  # @example
206
208
  # boundingbox = Geom::BoundingBox.new
207
209
  # boundingbox.add([100, 200, -400], [200, 400, 100])
208
210
  # # This will return a Length of 200.0.
209
- # length = boundingbox.height
211
+ # depth = boundingbox.height
212
+ #
213
+ # @note In SketchUp's coordinate system, this corersponds to the depth.
210
214
  #
211
- # @return [Length] the height of the bounding box
215
+ # @return [Length]
212
216
  #
213
217
  # @version SketchUp 6.0
214
218
  def height
@@ -301,15 +305,15 @@ class Geom::BoundingBox
301
305
  def valid?
302
306
  end
303
307
 
304
- # The {#width} method is used to retrieve the width of the bounding box.
308
+ # The {#width} method is used to retrieve the X extent of the bounding box.
305
309
  #
306
310
  # @example
307
311
  # boundingbox = Geom::BoundingBox.new
308
312
  # boundingbox.add([100, 200, -400], [200, 400, 100])
309
313
  # # This will return a Length of 100.0.
310
- # length = boundingbox.width
314
+ # width = boundingbox.width
311
315
  #
312
- # @return [Length] the width of the bounding box
316
+ # @return [Length]
313
317
  #
314
318
  # @version SketchUp 6.0
315
319
  def width
@@ -27,7 +27,7 @@ class Geom::Bounds2d
27
27
  # The {#height} method returns the height of the {Geom::Bounds2d}.
28
28
  #
29
29
  # @example
30
- # bounds = Geom::Bounds2d.new({0.0, 0.0, 1.0, 1.0})
30
+ # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
31
31
  # height = bounds.height
32
32
  #
33
33
  # @return [Geom::Point2d]
@@ -80,7 +80,7 @@ class Geom::Bounds2d
80
80
  # corner of the {Geom::Bounds2d}.
81
81
  #
82
82
  # @example
83
- # bounds = Geom::Bounds2d.new({0.0, 0.0, 1.0, 1.0})
83
+ # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
84
84
  # l_r = bounds.lower_right
85
85
  #
86
86
  # @return [Geom::Point2d]
@@ -148,7 +148,7 @@ class Geom::Bounds2d
148
148
  # of the {Geom::Bounds2d}.
149
149
  #
150
150
  # @example
151
- # bounds = Geom::Bounds2d.new({0.0, 0.0, 1.0, 1.0})
151
+ # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
152
152
  # u_l = bounds.upper_left
153
153
  #
154
154
  # @return [Geom::Point2d]
@@ -160,7 +160,7 @@ class Geom::Bounds2d
160
160
  # The {#width} method returns the width of the {Geom::Bounds2d}.
161
161
  #
162
162
  # @example
163
- # bounds = Geom::Bounds2d.new({0.0, 0.0, 1.0, 1.0})
163
+ # bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
164
164
  # width = bounds.width
165
165
  #
166
166
  # @return [Geom::Point2d]
@@ -26,18 +26,18 @@ class Geom::LatLong
26
26
  #
27
27
  # @overload initialize(latlong)
28
28
  #
29
- # @param latlong [Geom::LatLong]
29
+ # @param [Geom::LatLong] latlong
30
30
  # @return [Geom::LatLong]
31
31
  #
32
32
  # @overload initialize(latlong_array)
33
33
  #
34
- # @param latlong_array [Array(Numeric, Numeric)]
34
+ # @param [Array(Numeric, Numeric)] latlong_array
35
35
  # @return [Geom::LatLong]
36
36
  #
37
37
  # @overload initialize(lat, long)
38
38
  #
39
- # @param lat [Numeric]
40
- # @param long [Numeric]
39
+ # @param [Numeric] lat
40
+ # @param [Numeric] long
41
41
  # @return [Geom::LatLong]
42
42
  #
43
43
  # @version SketchUp 6.0
@@ -1,12 +1,11 @@
1
1
  # Copyright:: Copyright 2020 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # The {Geom::Vector2d} class allows you to work with a point in 2D space.
5
- # {Geom::Point2d} is basically just a series of values representing x and y
6
- # coordinates.
4
+ # The {Geom::Point2d} class allows you to work with a point in 2D space.
5
+ # {Geom::Point2d} is a series of values representing x and y coordinates.
7
6
  #
8
- # The values are specified as [x, y]. For example [1, 1].
9
- # To create a point call Geom::Point2d.new, where the creation method
7
+ # The values are specified as +[x, y]+. For example [1, 1].
8
+ # To create a point call +Geom::Point2d.new+, where the creation method
10
9
  # can take a variety of arguments:
11
10
  #
12
11
  # @example
@@ -31,8 +31,10 @@ class Geom::Point3d
31
31
 
32
32
  # Class Methods
33
33
 
34
- # The linear_combination method is used to create a new point as a linear
35
- # combination of two points. This method is generally used to get a point at
34
+ # The {.linear_combination} method is used to create a new point as a linear
35
+ # combination of two points.
36
+ #
37
+ # This method is generally used to get a point at
36
38
  # some percentage along a line connecting the two points.
37
39
  #
38
40
  # A linear combination is a standard term for vector math. It is defined as
@@ -41,26 +43,24 @@ class Geom::Point3d
41
43
  # @example
42
44
  # point1 = Geom::Point3d.new(1,1,1)
43
45
  # point2 = Geom::Point3d.new(10,10,10)
44
- # # Gets the point on the line segment connecting point1 and point2 that is
45
- # # 3/4 the way from point1 to point2.
46
+ #
47
+ # # Get the point that is half the way from point1 to point2.
48
+ # points = Geom::Point3d.linear_combination(0.5, point1, 0.5, point2)
49
+ #
50
+ # # Get the point that is 3/4 the way from point1 to point2.
46
51
  # point = Geom::Point3d.linear_combination(0.25, point1, 0.75, point2)
47
- # if (point)
48
- # UI.messagebox(point)
49
- # else
50
- # UI.messagebox("Failure")
51
- # end
52
+ #
53
+ # # Get the point that is 70% the way from point1 to point2.
54
+ # percentage = 0.7
55
+ # point = Geom::Point3d.linear_combination(1.0 - percentage, point1, percentage, point2)
52
56
  #
53
57
  # @param [Float] weight1
54
- # A weight or percentage.
55
58
  #
56
- # @param [Float] point1
57
- # The start point on the line.
59
+ # @param [Geom::Point3d] point1
58
60
  #
59
61
  # @param [Float] weight2
60
- # A weight or percentage.
61
62
  #
62
- # @param [Float] point2
63
- # The end point of the line.
63
+ # @param [Geom::Point3d] point2
64
64
  #
65
65
  # @return [Geom::Point3d]
66
66
  #
@@ -226,7 +226,7 @@ class Geom::Point3d
226
226
  # @param [Geom::Point3d] point2
227
227
  # The Point3d object to compute the distance to.
228
228
  #
229
- # @return [Length] the distance in current units
229
+ # @return [Length]
230
230
  #
231
231
  # @version SketchUp 6.0
232
232
  def distance(point2)
@@ -484,7 +484,7 @@ class Geom::Point3d
484
484
  #
485
485
  # @overload set!(point3d)
486
486
  #
487
- # @param point3d [Geom::Point3d]
487
+ # @param [Geom::Point3d] point3d
488
488
  # @return [Geom::Point3d]
489
489
  #
490
490
  # @version SketchUp 6.0
@@ -353,6 +353,8 @@ class Geom::PolygonMesh
353
353
  # index = mesh.add_point(point1)
354
354
  # mesh.set_point(index, point2)
355
355
  #
356
+ # @note Index starts at 1.
357
+ #
356
358
  # @param [Integer] index
357
359
  # The index where the point will be set.
358
360
  #
@@ -408,6 +410,8 @@ class Geom::PolygonMesh
408
410
  # @note If you don't specify how many points you will be adding to the mesh
409
411
  # when you initiate it you may risk the UV data becoming out of sync.
410
412
  #
413
+ # @note Index starts at 1.
414
+ #
411
415
  # @param [Integer] index
412
416
  # An Integer representing the UV index.
413
417
  #
@@ -458,6 +462,8 @@ class Geom::PolygonMesh
458
462
  # @example
459
463
  # point = mesh.uv_at(1, true)
460
464
  #
465
+ # @note Index starts at 1.
466
+ #
461
467
  # @param [Integer] index
462
468
  # The index for the texture coordinate.
463
469
  #
@@ -1,8 +1,7 @@
1
1
  # Copyright:: Copyright 2020 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
- # The Vector2d class represents vectors in a 2 dimensional space.
5
- # Vectors in LayOut have a direction and a length, but not a starting point.
4
+ # The {Geom::Vector2d} class represents vectors in a 2 dimensional space.
6
5
  #
7
6
  # There are numerous tutorials on 2D vectors available on the internet.
8
7
  #
@@ -333,7 +333,7 @@ class Geom::Vector3d
333
333
  #
334
334
  # @overload initialize(vector)
335
335
  #
336
- # @param vector [Geom::Vector3d] A Vector3d object.
336
+ # @param [Geom::Vector3d] vector A Vector3d object.
337
337
  # @return [Geom::Vector3d]
338
338
  #
339
339
  # @version SketchUp 6.0
@@ -504,12 +504,12 @@ class Geom::Vector3d
504
504
  #
505
505
  # @overload set!(array3d)
506
506
  #
507
- # @param array3d [Array(Numeric, Numeric, Numeric)]
507
+ # @param [Array(Numeric, Numeric, Numeric)] array3d
508
508
  # @return [Geom::Vector3d]
509
509
  #
510
510
  # @overload set!(vector)
511
511
  #
512
- # @param vector [Geom::Vector3d]
512
+ # @param [Geom::Vector3d] vector
513
513
  # @return [Geom::Vector3d]
514
514
  #
515
515
  # @overload set!(x, y, z)
@@ -536,6 +536,10 @@ class Layout::AngularDimension < Layout::Entity
536
536
  # dim = Layout::AngularDimension.new(start_point, end_point, start_extent, end_extent, inner_angle)
537
537
  # text = dim.text
538
538
  #
539
+ # @note With the addition of auto-text in dimensions for LayOut 2019.2, the
540
+ # copy of the dimension text incorrectly provided the plain text when
541
+ # requesting the display text. This has been fixed for LayOut 2020.1.
542
+ #
539
543
  # @return [Layout::FormattedText]
540
544
  #
541
545
  # @version LayOut 2018
@@ -88,6 +88,11 @@ class Layout::AutoTextDefinitions
88
88
  # puts auto_text.name
89
89
  # }
90
90
  #
91
+ # @note Don't remove content from this collection while iterating over it with
92
+ # {#each}. This would change the size of the collection and cause elements to
93
+ # be skipped as the indices change. Instead copy the current collection to an
94
+ # array using +to_a+ and then use +each+ on the array, when removing content.
95
+ #
91
96
  # @version LayOut 2018
92
97
  #
93
98
  # @yieldparam [Layout::AutoTextDefinition] auto_text
@@ -129,6 +134,7 @@ class Layout::AutoTextDefinitions
129
134
  # @version LayOut 2018
130
135
  def length
131
136
  end
137
+ alias_method :size, :length
132
138
 
133
139
  # The {#remove} method removes an {Layout::AutoTextDefinition} from the
134
140
  # {Layout::Document}.
@@ -170,17 +176,4 @@ class Layout::AutoTextDefinitions
170
176
  def remove(*args)
171
177
  end
172
178
 
173
- # The {#length} method returns the number of {Layout::AutoTextDefinition}s.
174
- #
175
- # @example
176
- # doc = Layout::Document.open("C:/path/to/document.layout")
177
- # auto_texts = doc.auto_text_definitions
178
- # num_auto_texts = auto_texts.length
179
- #
180
- # @return [Integer]
181
- #
182
- # @version LayOut 2018
183
- def size
184
- end
185
-
186
179
  end
@@ -46,6 +46,7 @@ class Layout::Document
46
46
  VERSION_2018 = nil # Stub value.
47
47
  VERSION_2019 = nil # Stub value.
48
48
  VERSION_2020 = nil # Stub value.
49
+ VERSION_2021 = nil # Stub value.
49
50
  VERSION_3 = nil # Stub value.
50
51
  VERSION_CURRENT = nil # Stub value.
51
52
 
@@ -143,6 +144,61 @@ class Layout::Document
143
144
  def auto_text_definitions
144
145
  end
145
146
 
147
+ # The {#export} method exports the {Layout::Document} to a given file format.
148
+ # It knows which format to export based on the file extension you place on the
149
+ # file name. For example, a filename of "thing.pdf" will export a PDF file,
150
+ # whereas "thing.png" will export a set of PNG images.
151
+ #
152
+ # For LayOut version 2020.1, valid extensions include .pdf, .jpg, and .png.
153
+ #
154
+ # @example PDF Export Examples
155
+ # doc = Layout::Document.open("c:/path/to/document.layout")
156
+ #
157
+ # # Export pdf file on a PC, with default settings.
158
+ # status = doc.export("c:/my_export.pdf")
159
+ #
160
+ # # Export pages one through three at high quality, compressing jpeg images
161
+ # # at 0.75 compression quality (valid range is 0.0 - 1.0). Note that the
162
+ # # first page of a {Layout::Document} is index 0.
163
+ # options = { start_page: 1,
164
+ # end_page: 3,
165
+ # output_resolution: Layout::PageInfo::RESOLUTION_HIGH,
166
+ # compress_images: TRUE,
167
+ # compress_quality: 0.75 }
168
+ #
169
+ # status = doc.export("c:/my_export.pdf", options)
170
+ #
171
+ # @example Image Set Export Examples
172
+ # doc = Layout::Document.open("c:/path/to/document.layout")
173
+ #
174
+ # # Export png files on macOS, with default settings.
175
+ # status = doc.export('/Users/username/Desktop/pngs/page.png')
176
+ #
177
+ # # Export pages one through three at 300 dpi as JPGs.
178
+ # options = { start_page: 1,
179
+ # end_page: 3,
180
+ # dpi: 300 }
181
+ # status = doc.export('c:/page.jpg', options)
182
+ #
183
+ # @param [String] file_path
184
+ # The file or image set to create. The directory
185
+ # path must already exist. The path must include the file extension.
186
+ #
187
+ # @param [Hash, nil] options
188
+ # An optional hash of settings for the export.
189
+ #
190
+ # @raise [TypeError] if an options value is the wrong type
191
+ #
192
+ # @raise [RangeError] if an options value is out of range
193
+ #
194
+ # @raise [ArgumentError] if the full file path does not exist
195
+ #
196
+ # @raise [ArgumentError] if the specified file type is missing or not supported
197
+ #
198
+ # @version LayOut 2020.1
199
+ def export(file_path, options = nil)
200
+ end
201
+
146
202
  # The {#grid} method returns the {Layout::Grid} for a {Layout::Document}.
147
203
  #
148
204
  # @example
@@ -347,15 +403,15 @@ class Layout::Document
347
403
  # @example
348
404
  # doc = Layout::Document.open("C:/path/to/document.layout")
349
405
  # # Save the model using the current Layout format
350
- # filename = File.join(ENV['Home'], 'Desktop', 'mydoc.layout')
351
- # status = doc.save(filename)
406
+ # path = File.join(ENV['Home'], 'Desktop', 'mydoc.layout')
407
+ # status = doc.save(path)
352
408
  # # Save the document to the current file using the current LayOut format
353
409
  # status = doc.save
354
410
  # # Save the document to the current file in LayOut 3 format
355
411
  # status = doc.save(Layout::Document::VERSION_3)
356
412
  # # Save the document in LayOut 2013 format
357
- # filename = File.join(ENV['Home'], 'Desktop', 'mydoc_v2013.layout')
358
- # status = doc.save(filename, Layout::Document::VERSION_2013)
413
+ # path = File.join(ENV['Home'], 'Desktop', 'mydoc_v2013.layout')
414
+ # status = doc.save(path, Layout::Document::VERSION_2013)
359
415
  #
360
416
  # @overload save
361
417
  #
@@ -86,6 +86,11 @@ class Layout::Entities
86
86
  # puts entity
87
87
  # }
88
88
  #
89
+ # @note Don't remove content from this collection while iterating over it with
90
+ # {#each}. This would change the size of the collection and cause elements to
91
+ # be skipped as the indices change. Instead copy the current collection to an
92
+ # array using +to_a+ and then use +each+ on the array, when removing content.
93
+ #
89
94
  # @param [Hash{Symbol => Boolean}] flags
90
95
  # A hash that allows skipping of
91
96
  # {Layout::Entity}s on hidden or locked {Layout::Layers}
@@ -108,6 +113,7 @@ class Layout::Entities
108
113
  # @version LayOut 2018
109
114
  def length
110
115
  end
116
+ alias_method :size, :length
111
117
 
112
118
  # The {#reverse_each} method iterates through all of the {Layout::Entity}s in
113
119
  # reverse order. When iterating over a {Layout::LayerInstance}'s
@@ -139,17 +145,4 @@ class Layout::Entities
139
145
  def reverse_each(*args)
140
146
  end
141
147
 
142
- # The {#length} method returns the number of {Layout::Entity}s.
143
- #
144
- # @example
145
- # doc = Layout::Document.open("C:/path/to/document.layout")
146
- # entities = doc.shared_entities
147
- # num_entities = entities.length
148
- #
149
- # @return [Integer]
150
- #
151
- # @version LayOut 2018
152
- def size
153
- end
154
-
155
148
  end