sketchup-api-stubs 0.7.11 → 0.8.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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +6 -0
  3. data/lib/sketchup-api-stubs/stubs/Array.rb +4 -0
  4. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +35 -11
  5. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +1 -1
  6. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +9 -5
  7. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +5 -0
  8. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +10 -0
  9. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +5 -2
  10. data/lib/sketchup-api-stubs/stubs/Geom.rb +2 -0
  11. data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +4 -4
  12. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +53 -51
  13. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +2 -1
  14. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +1 -1
  15. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +6 -8
  16. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +50 -0
  17. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +8 -10
  18. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +1 -1
  19. data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +8 -10
  20. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +6 -9
  21. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1 -1
  22. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +17 -0
  23. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +109 -21
  24. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +17 -11
  25. data/lib/sketchup-api-stubs/stubs/Sketchup/CRSLocation.rb +402 -0
  26. data/lib/sketchup-api-stubs/stubs/Sketchup/CRSMapUnit.rb +83 -0
  27. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +220 -8
  28. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +85 -16
  29. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +11 -9
  30. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +5 -1
  31. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +6 -6
  32. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +19 -11
  33. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +8 -9
  34. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +181 -33
  35. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +0 -5
  36. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +8 -1
  37. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +0 -5
  38. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +14 -12
  39. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +100 -19
  40. data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPattern.rb +277 -0
  41. data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPatternData.rb +245 -0
  42. data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPatterns.rb +155 -0
  43. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +2 -2
  44. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +144 -0
  45. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +6 -0
  46. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +13 -1
  47. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +2 -4
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +66 -3
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +4 -4
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +112 -25
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +130 -4
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +0 -1
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +95 -83
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +11 -11
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/Procedure.rb +452 -0
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +29 -3
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +30 -0
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +15 -13
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +16 -0
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +74 -0
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +49 -8
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +25 -12
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +78 -22
  64. data/lib/sketchup-api-stubs/stubs/Sketchup.rb +55 -4
  65. data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +73 -59
  66. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +119 -164
  67. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +50 -9
  68. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +4 -1
  69. data/lib/sketchup-api-stubs/stubs/UI.rb +15 -8
  70. data/lib/sketchup-api-stubs/stubs/_top_level.rb +8 -0
  71. metadata +9 -7
@@ -57,6 +57,63 @@ class Sketchup::InstancePath
57
57
  def [](index)
58
58
  end
59
59
 
60
+ # Clears the instance path.
61
+ #
62
+ # This sets it to an empty state. After calling this, {#valid?} will return
63
+ # +false+ and {#empty?} will return +true+.
64
+ #
65
+ # @example
66
+ # model = Sketchup.active_model
67
+ # group = model.entities.add_group
68
+ # edge = group.entities.add_line([10, 10, 10], [20, 20, 20])
69
+ # path = Sketchup::InstancePath.new([group, edge])
70
+ # path.clear
71
+ #
72
+ # @raise [TypeError] if the instance path refer to deleted entities.
73
+ #
74
+ # @return [Sketchup::InstancePath] self
75
+ #
76
+ # @version SketchUp 2026.2
77
+ def clear
78
+ end
79
+
80
+ # Returns a new instance path with the same elements.
81
+ #
82
+ # @example
83
+ # model = Sketchup.active_model
84
+ # group = model.entities.add_group
85
+ # edge = group.entities.add_line([10, 10, 10], [20, 20, 20])
86
+ # path1 = Sketchup::InstancePath.new([group, edge])
87
+ # path2 = path1.clone
88
+ #
89
+ # @raise [TypeError] if the instance path refer to deleted entities.
90
+ #
91
+ # @return [Sketchup::InstancePath]
92
+ #
93
+ # @version SketchUp 2026.2
94
+ def clone
95
+ end
96
+
97
+ # Copies all elements from another instance path into this one.
98
+ #
99
+ # @example
100
+ # model = Sketchup.active_model
101
+ # group = model.entities.add_group
102
+ # edge = group.entities.add_line([10, 10, 10], [20, 20, 20])
103
+ # path1 = Sketchup::InstancePath.new([group, edge])
104
+ # path2 = Sketchup::InstancePath.new([])
105
+ # path2.copy(path1)
106
+ #
107
+ # @param [Sketchup::InstancePath] other
108
+ #
109
+ # @raise [TypeError] if the given instance path refer to deleted entities.
110
+ #
111
+ # @return [Sketchup::InstancePath] self
112
+ #
113
+ # @version SketchUp 2026.2
114
+ def copy(other)
115
+ end
116
+
60
117
  # The yielded entities will start with the root and end with the leaf.
61
118
  #
62
119
  # @example
@@ -159,6 +216,25 @@ class Sketchup::InstancePath
159
216
  def leaf
160
217
  end
161
218
 
219
+ # Sets the leaf entity of the instance path.
220
+ #
221
+ # @example
222
+ # model = Sketchup.active_model
223
+ # group = model.entities.add_group
224
+ # edge = group.entities.add_line([10, 10, 10], [20, 20, 20])
225
+ # path = Sketchup::InstancePath.new([group])
226
+ # path.leaf = edge
227
+ #
228
+ # @param [Sketchup::Entity, nil] entity
229
+ #
230
+ # @raise [TypeError] if the instance path refer to deleted entities.
231
+ #
232
+ # @raise [TypeError] if the given entity is deleted.
233
+ #
234
+ # @version SketchUp 2026.2
235
+ def leaf=(entity)
236
+ end
237
+
162
238
  # {#length} is an alias of {#size}.
163
239
  #
164
240
  # @example
@@ -200,6 +276,74 @@ class Sketchup::InstancePath
200
276
  def persistent_id_path
201
277
  end
202
278
 
279
+ # Removes items from the end in-place.
280
+ #
281
+ # This treats the path as a flat list and removes items from the end,
282
+ # whether they are instances or a leaf.
283
+ #
284
+ # @example
285
+ # model = Sketchup.active_model
286
+ # group = model.entities.add_group
287
+ # edge = group.entities.add_line([10, 10, 10], [20, 20, 20])
288
+ # path = Sketchup::InstancePath.new([group, edge])
289
+ # removed = path.pop # Returns edge
290
+ #
291
+ # @note If +num+ is +0+, no elements are removed. If +num+ is greater than the
292
+ # path length, all elements are removed.
293
+ #
294
+ # @overload pop
295
+ #
296
+ # @return [Sketchup::Entity, nil] the removed element or +nil+ if the path is empty.
297
+ #
298
+ # @overload pop(num)
299
+ #
300
+ # @param [Integer] num the number of items to remove from the end.
301
+ # @return [Array<Sketchup::Entity>] the removed elements.
302
+ #
303
+ # @raise [TypeError] if the instance path refer to deleted entities.
304
+ #
305
+ # @raise [TypeError] if the given +num+ is not an integer.
306
+ #
307
+ # @raise [ArgumentError] if +num+ is less than 0.
308
+ #
309
+ # @see #push
310
+ #
311
+ # @version SketchUp 2026.2
312
+ def pop(*args)
313
+ end
314
+
315
+ # Appends the given entity to the path in-place.
316
+ #
317
+ # This treats the path as a flat list and appends the entity to the end. The
318
+ # entity can be an instance (group, component instance, image) or a leaf entity.
319
+ #
320
+ # @example
321
+ # model = Sketchup.active_model
322
+ # group = model.entities.add_group
323
+ # edge = group.entities.add_line([10, 10, 10], [20, 20, 20])
324
+ # path = Sketchup::InstancePath.new([group])
325
+ # path.push(edge) # path is now [group, edge]
326
+ #
327
+ # @note This method modifies the path in-place. Use {#clone} if you want
328
+ # to keep the original path unchanged.
329
+ #
330
+ # @param [Sketchup::Entity] entity
331
+ #
332
+ # @raise [TypeError] if the instance path refer to deleted entities.
333
+ #
334
+ # @raise [TypeError] if the given entity is not a Sketchup::Entity.
335
+ #
336
+ # @raise [ArgumentError] if the resulting path would be invalid (e.g. adding
337
+ # an element after a leaf).
338
+ #
339
+ # @return [Sketchup::InstancePath] self
340
+ #
341
+ # @see #pop
342
+ #
343
+ # @version SketchUp 2026.2
344
+ def push(entity)
345
+ end
346
+
203
347
  # The root of an instance path is the element located closest to the model
204
348
  # root. This will be a group or component instance. If you have a non-instance
205
349
  # as a leaf with no other parent component this will return `nil`.
@@ -309,8 +309,14 @@ class Sketchup::Layer < Sketchup::Entity
309
309
  # layer = layers.add('Hello World')
310
310
  # layer.visible = false
311
311
  #
312
+ # @note The behavior of +layer.visible = false+ differs from the UI when the layer is active.
313
+ # If the active layer is hidden via the API, another layer will become active automatically.
314
+ # Check active layer after hiding to ensure the desired layer is active.
315
+ #
312
316
  # @param [Boolean] visible
313
317
  #
318
+ # @see LayerFolder#visible=
319
+ #
314
320
  # @version SketchUp 6.0
315
321
  def visible=(visible)
316
322
  end
@@ -319,14 +319,26 @@ class Sketchup::LayerFolder < Sketchup::Entity
319
319
 
320
320
  # The {#visible=} method is used to set if the layer folder is visible.
321
321
  #
322
+ # The method does not raise exceptions, but hiding a folder containing an
323
+ # active tag (layer) will not change the folder's visibility.
324
+ #
322
325
  # @example
323
326
  # model = Sketchup.active_model
324
327
  # layers = model.layers
325
- # folder = layers.add('Hello')
328
+ # folder = layers.add_folder('Hello')
329
+ #
330
+ # # Attempt to hide the folder
331
+ # # This will not hide if the folder contains an active tag.
326
332
  # folder.visible = false
327
333
  #
334
+ # @note If the folder contains an active tag (layer), trying to hide said
335
+ # folder will fail silently. Make sure that the folder does not contain
336
+ # an active tag before attempting to hide it.
337
+ #
328
338
  # @param [Boolean] visible
329
339
  #
340
+ # @see Layer#visible=
341
+ #
330
342
  # @version SketchUp 2021.0
331
343
  def visible=(visible)
332
344
  end
@@ -293,11 +293,9 @@ class Sketchup::Layers < Sketchup::Entity
293
293
  # folder = manager.add_folder('Windows')
294
294
  # manager.purge_unused_folders
295
295
  #
296
- # @version SketchUp 2021.0
297
- #
298
- # @yield [folder]
296
+ # @return [Integer] The number of unused folders that were purged.
299
297
  #
300
- # @yieldparam [Sketchup::LayerFolder] folder
298
+ # @version SketchUp 2021.0
301
299
  def purge_unused_folders
302
300
  end
303
301
 
@@ -197,7 +197,7 @@ class Sketchup::Material < Sketchup::Entity
197
197
  # material.ao_texture = 'path/to/ao_texture.png'
198
198
  # material.ao_strength = 1.0
199
199
  #
200
- # @param [Float] strenght
200
+ # @param [Float] strength
201
201
  # A value between +0.0+ and +1.0+.
202
202
  #
203
203
  # @see #ao_enabled?
@@ -207,7 +207,7 @@ class Sketchup::Material < Sketchup::Entity
207
207
  # @see #ao_texture=
208
208
  #
209
209
  # @version SketchUp 2025.0
210
- def ao_strength=(strenght)
210
+ def ao_strength=(strength)
211
211
  end
212
212
 
213
213
  #
@@ -266,7 +266,7 @@ class Sketchup::Material < Sketchup::Entity
266
266
  # color of the texture.
267
267
  #
268
268
  # @example
269
- # materials = Sketchup.active_model.materials.add('Example')
269
+ # material = Sketchup.active_model.materials.add('Example')
270
270
  # material.color = 'red'
271
271
  # color = material.color
272
272
  #
@@ -399,6 +399,69 @@ class Sketchup::Material < Sketchup::Entity
399
399
  def display_name
400
400
  end
401
401
 
402
+ # The {#duplicate} method creates a copy of the material with all its properties.
403
+ #
404
+ # The duplicated material will have a unique name based on the original material's name.
405
+ #
406
+ # @example
407
+ # materials = Sketchup.active_model.materials
408
+ # original = materials.add('Joe')
409
+ # original.color = 'red'
410
+ # duplicate = original.duplicate
411
+ # puts duplicate.name # Outputs: "Joe1"
412
+ # puts duplicate.color # Outputs: Color(255, 0, 0, 255)
413
+ #
414
+ # @raise [RuntimeError] if the material is used by a layer or image.
415
+ #
416
+ # @return [Sketchup::Material] the newly created material
417
+ #
418
+ # @version SketchUp 2026.2
419
+ def duplicate
420
+ end
421
+
422
+ # Retrieves the hatch pattern assigned to the material.
423
+ #
424
+ # The pattern fills the section cut of groups and components painted with this material,
425
+ # including nested content that inherits the material. A pattern assigned to the group or
426
+ # component itself takes precedence over its material's pattern, which in turn takes precedence
427
+ # over the section plane's pattern.
428
+ #
429
+ # @example
430
+ # material = Sketchup.active_model.materials["Concrete"]
431
+ # hatch_pattern = material.hatch_pattern
432
+ # puts hatch_pattern.name if hatch_pattern
433
+ #
434
+ # @return [Sketchup::HatchPattern, nil]
435
+ #
436
+ # @version SketchUp 2027.0
437
+ def hatch_pattern
438
+ end
439
+
440
+ # Assigns a hatch pattern to the material.
441
+ #
442
+ # The pattern fills the section cut of groups and components painted with this material,
443
+ # including nested content that inherits the material. A pattern assigned to the group or
444
+ # component itself takes precedence over its material's pattern, which in turn takes precedence
445
+ # over the section plane's pattern.
446
+ #
447
+ # @example
448
+ # model = Sketchup.active_model
449
+ # hatch_patterns = model.hatch_patterns
450
+ # material = model.materials.add("Concrete")
451
+ # material.hatch_pattern = hatch_patterns['Pattern1']
452
+ #
453
+ # @param [Sketchup::HatchPattern, nil] pattern
454
+ # the pattern to assign, or +nil+ to clear the assignment.
455
+ #
456
+ # @raise [ArgumentError] if the pattern does not belong to the material's model.
457
+ #
458
+ # @raise [ArgumentError] if a pattern is given and the material belongs to a {Sketchup::Layer} or
459
+ # a {Sketchup::Image}. Clearing with +nil+ is always allowed.
460
+ #
461
+ # @version SketchUp 2027.0
462
+ def hatch_pattern=(pattern)
463
+ end
464
+
402
465
  # The {#materialType} method retrieves the type of the material.
403
466
  #
404
467
  # {Material Types}[#material_type_constant_summary]:
@@ -30,8 +30,8 @@ class Sketchup::Materials < Sketchup::Entity
30
30
  # @overload [](index)
31
31
  #
32
32
  # @param [Integer] index
33
- # A number representing the material's index in an array of Material
34
- # objects.
33
+ # A number representing the material's index in an array of Material
34
+ # objects.
35
35
  # @return [Sketchup::Material, nil] a Material object on success, Nil on failure
36
36
  #
37
37
  # @overload [](name)
@@ -91,8 +91,8 @@ class Sketchup::Materials < Sketchup::Entity
91
91
  # @overload [](index)
92
92
  #
93
93
  # @param [Integer] index
94
- # A number representing the material's index in an array of Material
95
- # objects.
94
+ # A number representing the material's index in an array of Material
95
+ # objects.
96
96
  # @return [Sketchup::Material, nil] a Material object on success, Nil on failure
97
97
  #
98
98
  # @overload [](name)
@@ -90,6 +90,9 @@ class Sketchup::Model
90
90
  # then this is the method to use. Entities selected by the user will be a
91
91
  # subset of the active entities.
92
92
  #
93
+ # SketchUp 2027.0 and later: For a Procedural Component, this will return the control
94
+ # (input) elements.
95
+ #
93
96
  # @example
94
97
  # model = Sketchup.active_model
95
98
  # entities = model.active_entities
@@ -461,6 +464,59 @@ class Sketchup::Model
461
464
  def commit_operation
462
465
  end
463
466
 
467
+ # The {#crs_location} method returns a copy of the CRSLocation defined for the model (if any).
468
+ #
469
+ # When the CRS location is defined and the model is georeferenced,
470
+ # this CRS overrides the default UTM zone calculated from the shadow info latitude/longitude.
471
+ #
472
+ # @example
473
+ # model = Sketchup.active_model
474
+ # crs_location = model.crs_location
475
+ #
476
+ # @return [Sketchup::CRSLocation, nil]
477
+ #
478
+ # @version SketchUp 2027.0
479
+ def crs_location
480
+ end
481
+
482
+ # The {#crs_location=} method sets the CRS Location for model.
483
+ #
484
+ # @example
485
+ # model = Sketchup.active_model
486
+ # crs_location = Sketchup::CRSLocation.new
487
+ # crs_location.name = "EPSG:27700"
488
+ # crs_location.eastings = 505050
489
+ # crs_location.northings = 181818
490
+ # crs_location.height = 29
491
+ # crs_location.tgl_id =
492
+ # "HC1G000ZHC400000000000WXA90PP4T133YR4DRF7P4S97764G4R57EX4TK3312DPHRS19GVS5Q6PBS29DVB4V" \
493
+ # "69SS5B4BC448M1XF7S1W2EQGCZT11KVN43T11T39TYF99C8PRFTTDS87KW7D5RA2M9T20PBQNWXYYZEZ9KNHNV" \
494
+ # "FP83WZ8ZTYDXDRTNCN4R92FJV19AY3HPHBHKYJATEYMJ74DW6K9S4VN3HK7PJ8R5DQM0H5GYHCT2RXRPTVGPMY" \
495
+ # "B2DBAW1TV7YPR837XK42BVNGNZQK0SHW91JCD3QB0BB8ZHT5EPQQQYJTZZ3HATDD78N7CS6B5DXJXQGMFMYKXC" \
496
+ # "XAXYX1W7BYVZFD31ZQVYEV4ZDMKBQKRE7YEZZD5JMH9PQWQGJK1T9J2E3EJBE5YBVHJ8BJRFH23F2A48Q1WJE2" \
497
+ # "7TVA9H5282641E3BFF3YZKME5HKVQY8KVFQTCPT76X3CYA3TXZNKHFEMQYYQCQPAX7TYTHAMGMA9194Z32PG2A" \
498
+ # "RA00HRMT4EFAT085H4C7NW3GT8W76V06T0Q3758QFG6SN0KQ1HJT74027809ENH42TTWD0W9JN5WMA3ZWEW9R0" \
499
+ # "F468BND87ZABKGBZNWCD6J6Y670CN8985W9BSR8ZB2BATYX2S28GEBBAAVN9NXX7JKYXQBP79TN6WN1BKKA6X8" \
500
+ # "ABHEBPGBT1PX3AMQR3BXN2XDZBEH920B8VY6A5PXQB4GVT5QV8PQHEAH9QRJMWPA73A5C89C3DD40ZR0MGDFFF" \
501
+ # "CB0C000"
502
+ # model.crs_location = crs_location
503
+ #
504
+ # @example
505
+ # model = Sketchup.active_model
506
+ # model.crs_location = nil
507
+ #
508
+ # @note This method does not geolocate the model.
509
+ #
510
+ # @note This method does not lookup tgl_id for the crs
511
+ #
512
+ # @param [Sketchup::CRSLocation, nil] crs_location
513
+ #
514
+ # @raise [ArgumentError] If the +crs_location+ is invalid
515
+ #
516
+ # @version SketchUp 2027.0
517
+ def crs_location=(crs_location)
518
+ end
519
+
464
520
  # The {#definitions} method retrieves a definition list containing all of the
465
521
  # component definitions in the model.
466
522
  #
@@ -892,6 +948,19 @@ class Sketchup::Model
892
948
  def guid
893
949
  end
894
950
 
951
+ # The {#hatch_patterns} method is used to retrieve the {Sketchup::HatchPatterns} object for
952
+ # this model.
953
+ #
954
+ # @example
955
+ # model = Sketchup.active_model
956
+ # hatch_patterns = model.hatch_patterns
957
+ #
958
+ # @return [Sketchup::HatchPatterns]
959
+ #
960
+ # @version SketchUp 2027.0
961
+ def hatch_patterns
962
+ end
963
+
895
964
  # The import method is used to load a file by recognizing the file extension
896
965
  # and calling appropriate importer.
897
966
  #
@@ -962,10 +1031,9 @@ class Sketchup::Model
962
1031
  def instance_path_from_pid_path(pid_path)
963
1032
  end
964
1033
 
965
- # The latlong_to_point method converts a latitude and longitude to a Point3d
966
- # object in the model. It does not actually work with a LatLong object, but
967
- # operates on a 2-element array. The returned point will always be on the
968
- # ground (z=0).
1034
+ # The latlong_to_point method converts geographic coordinates to a model
1035
+ # {Geom::Point3d}. It does not take a {Geom::LatLong} object; pass numeric
1036
+ # values instead.
969
1037
  #
970
1038
  # @example
971
1039
  # # Draw a point in Boulder, Colorado (40.0170N, 105.2830W)
@@ -974,17 +1042,26 @@ class Sketchup::Model
974
1042
  # local_point = model.latlong_to_point(lnglat_array)
975
1043
  # model.entities.add_cpoint(local_point)
976
1044
  #
977
- # @param [Array(Numeric, Numeric)] lnglat_array
978
- # A 2-element array containing first the longitude then
979
- # the latitude.
1045
+ # @example With altitude
1046
+ # local_point = model.latlong_to_point([-105.28300, 40.01700, 1655.0])
980
1047
  #
981
- # @return [Geom::Point3d] A Point3d in model coordinates.
1048
+ # @note This method does not account for the model's North Angle (solar north).
982
1049
  #
983
- # @return [Geom::Point3d] a point3d object if successful, false if
984
- # unsuccessful.
1050
+ # @overload latlong_to_point(lnglat_array)
1051
+ #
1052
+ # @param [Array(Numeric, Numeric)] lnglat_array
1053
+ # A 2-element array: [longitude_deg, latitude_deg]
1054
+ #
1055
+ # @overload latlong_to_point(lnglat_array)
1056
+ #
1057
+ # @param [Array(Numeric, Numeric, Numeric)] lnglat_array
1058
+ # A 3-element array: [longitude_deg, latitude_deg, altitude_m]
1059
+ # where altitude is in meters and defaults to 0 if omitted.
1060
+ #
1061
+ # @return [Geom::Point3d] A Point3d in model coordinates.
985
1062
  #
986
1063
  # @version SketchUp 6.0
987
- def latlong_to_point(lnglat_array)
1064
+ def latlong_to_point(arg)
988
1065
  end
989
1066
 
990
1067
  # The {#layers} method retrieves a collection of all {Sketchup::Layers} objects
@@ -1209,28 +1286,33 @@ class Sketchup::Model
1209
1286
  def place_component(componentdef, repeat = false)
1210
1287
  end
1211
1288
 
1212
- # The point_to_latlong method converts a point in the model to a LatLong so
1213
- # that you can get its latitude and longitude.
1289
+ # The point_to_latlong method converts a point in the model to geographic
1290
+ # longitude/latitude.
1214
1291
  #
1215
1292
  # This method uses the location information set in ShadowInfo.
1216
1293
  #
1217
- # NOTE: SketchUp 6.0 and higher has a change where this method returns a
1218
- # Point3d instead of a LatLong, where the x and y values contain the LatLong
1219
- # coordinates.
1220
- #
1221
1294
  # @example
1222
1295
  # model = Sketchup.active_model
1223
1296
  # local_point = Geom::Point3d.new(10, 10, 10)
1224
- # world_point = model.point_to_latlong(local_point)
1297
+ # lonlat = model.point_to_latlong(local_point) # Point3d[lon, lat, meters]
1298
+ # puts "lon=#{lonlat.x}, lat=#{lonlat.y}, z=#{lonlat.z}m"
1299
+ #
1300
+ # @example Get a Geom::LatLong object
1301
+ # latlong = model.point_to_utm(local_point).to_latlong
1302
+ #
1303
+ # @note Return value is a {Geom::Point3d}, not a {Geom::LatLong}. Components:
1304
+ # - +x+: longitude in degrees (east-positive)
1305
+ # - +y+: latitude in degrees (north-positive)
1306
+ # - +z+: altitude in meters
1307
+ #
1308
+ # @note This method does not account for the model's North Angle (solar north).
1309
+ # The result is in the unrotated georeference frame.
1225
1310
  #
1226
1311
  # @param [Geom::Point3d] point
1227
- # A Point3d object.
1312
+ # A point in model coordinates.
1228
1313
  #
1229
1314
  # @return [Geom::Point3d] Point3d[longitude_deg, latitude_deg, altitude_m]
1230
1315
  #
1231
- # @return [Geom::Point3d, Geom::LatLong] a LatLong or Point3d object. See
1232
- # details for information.
1233
- #
1234
1316
  # @version SketchUp 6.0
1235
1317
  def point_to_latlong(point)
1236
1318
  end
@@ -1349,6 +1431,11 @@ class Sketchup::Model
1349
1431
  # @note A bug in SketchUp 2016 and older caused the +.skb+ backup file
1350
1432
  # written during save to be empty. The +.skp+ file was however valid.
1351
1433
  #
1434
+ # @note Silently saving a model can cause data loss, if the user has
1435
+ # previously made changes they did not intend to be saved. If you need
1436
+ # to save a model to disk to use for an external action, first ask the
1437
+ # user if they want to save, similarly to how Send to LayOut functions.
1438
+ #
1352
1439
  # @note Starting with SketchUp 2021, SketchUp is using a the same file format across versions.
1353
1440
  # For instance, SketchUp 2021 can open a file made in SketchUp 2022.
1354
1441
  #
@@ -1409,15 +1496,15 @@ class Sketchup::Model
1409
1496
  # @overload save_copy(path)
1410
1497
  #
1411
1498
  # @param [String] path
1412
- # The path of the file to save the model copy to.
1499
+ # The path of the file to save the model copy to.
1413
1500
  #
1414
1501
  # @overload save_copy(path, version)
1415
1502
  #
1416
1503
  # @param [String] path
1417
- # The path of the file to save the model copy to.
1504
+ # The path of the file to save the model copy to.
1418
1505
  #
1419
1506
  # @param [Integer] version
1420
- # See {Sketchup::Model#save} for supported values.
1507
+ # See {Sketchup::Model#save} for supported values.
1421
1508
  #
1422
1509
  # @return [Boolean] true if successful, false if unsuccessful
1423
1510
  #