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.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +6 -0
- data/lib/sketchup-api-stubs/stubs/Array.rb +4 -0
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +35 -11
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +9 -5
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +5 -0
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +10 -0
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +5 -2
- data/lib/sketchup-api-stubs/stubs/Geom.rb +2 -0
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +4 -4
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +53 -51
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +2 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +6 -8
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +50 -0
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +8 -10
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +8 -10
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +6 -9
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +17 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +109 -21
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +17 -11
- data/lib/sketchup-api-stubs/stubs/Sketchup/CRSLocation.rb +402 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/CRSMapUnit.rb +83 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +220 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +85 -16
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +11 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +5 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +6 -6
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +19 -11
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +8 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +181 -33
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +0 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +8 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +0 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +14 -12
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +100 -19
- data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPattern.rb +277 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPatternData.rb +245 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/HatchPatterns.rb +155 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +144 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +6 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +13 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +2 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +66 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +4 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +112 -25
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +130 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +0 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +95 -83
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Sketchup/Procedure.rb +452 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +29 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +30 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +15 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +16 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +74 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +49 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +25 -12
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +78 -22
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +55 -4
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +73 -59
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +119 -164
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +50 -9
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +4 -1
- data/lib/sketchup-api-stubs/stubs/UI.rb +15 -8
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +8 -0
- metadata +9 -7
|
@@ -28,6 +28,101 @@
|
|
|
28
28
|
# # Attach the observer.
|
|
29
29
|
# Sketchup.active_model.add_observer(MyModelObserver.new)
|
|
30
30
|
#
|
|
31
|
+
# @example
|
|
32
|
+
# # This example demonstrates handling both empty and non-empty transactions,
|
|
33
|
+
# # while also showing how the observer event queuing works.
|
|
34
|
+
# # The key difference is that onTransactionCommit is called when the transaction
|
|
35
|
+
# # contains model changes, while onTransactionEmpty is called when no changes were made.
|
|
36
|
+
# #
|
|
37
|
+
# # IMPORTANT: Remember that ALL callbacks fire at commit time, not when operations occur.
|
|
38
|
+
#
|
|
39
|
+
# class TransactionObserver < Sketchup::ModelObserver
|
|
40
|
+
#
|
|
41
|
+
# # Called for any transaction, but remember this fires at commit time,
|
|
42
|
+
# # not when start_operation is actually called
|
|
43
|
+
# def onTransactionStart(model)
|
|
44
|
+
# puts "Transaction started callback fired: #{Time.now}"
|
|
45
|
+
# # We can't actually track when the transaction really started,
|
|
46
|
+
# # so we just record when the callback fired
|
|
47
|
+
# @callback_time = Time.now
|
|
48
|
+
# end
|
|
49
|
+
#
|
|
50
|
+
# # Called for transactions that modified the model
|
|
51
|
+
# # This fires immediately after onTransactionStart at commit time
|
|
52
|
+
# def onTransactionCommit(model)
|
|
53
|
+
# # We can only calculate time between callbacks, not actual operation time
|
|
54
|
+
# elapsed = Time.now - @callback_time
|
|
55
|
+
# puts "Transaction committed with changes (#{elapsed.round(3)}s after callback)"
|
|
56
|
+
# puts "Note: All callbacks fired at commit time, not during operations"
|
|
57
|
+
# handle_transaction_completion(model, :with_changes)
|
|
58
|
+
# end
|
|
59
|
+
#
|
|
60
|
+
# # Called for transactions that didn't modify the model
|
|
61
|
+
# # This fires immediately after onTransactionStart at commit time
|
|
62
|
+
# def onTransactionEmpty(model)
|
|
63
|
+
# # We can only calculate time between callbacks, not actual operation time
|
|
64
|
+
# elapsed = Time.now - @callback_time
|
|
65
|
+
# puts "Transaction committed with NO changes (#{elapsed.round(3)}s after callback)"
|
|
66
|
+
# puts "Note: All callbacks fired at commit time, not during operations"
|
|
67
|
+
# handle_transaction_completion(model, :empty)
|
|
68
|
+
# end
|
|
69
|
+
#
|
|
70
|
+
# # Common handler for both types of transaction completions
|
|
71
|
+
# def handle_transaction_completion(model, type)
|
|
72
|
+
# puts "Transaction complete (#{type}): #{Time.now}"
|
|
73
|
+
# # Perform actions needed for any completed transaction
|
|
74
|
+
# # (for example, updating UI, logging, etc.)
|
|
75
|
+
# end
|
|
76
|
+
#
|
|
77
|
+
# def onTransactionAbort(model)
|
|
78
|
+
# puts "Transaction aborted: #{Time.now}"
|
|
79
|
+
# end
|
|
80
|
+
# end
|
|
81
|
+
#
|
|
82
|
+
# # Attach the observer
|
|
83
|
+
# observer = TransactionObserver.new
|
|
84
|
+
# Sketchup.active_model.add_observer(observer)
|
|
85
|
+
#
|
|
86
|
+
# # Demonstration of the queuing behavior
|
|
87
|
+
# puts "DEMONSTRATION OF OBSERVER EVENT QUEUING:"
|
|
88
|
+
# puts "1. Starting transaction at: #{Time.now}"
|
|
89
|
+
# model = Sketchup.active_model
|
|
90
|
+
# model.start_operation("Transaction Test", true)
|
|
91
|
+
#
|
|
92
|
+
# # Notice that no observer callbacks fire at this point
|
|
93
|
+
# puts "2. After start_operation - no callbacks fired yet: #{Time.now}"
|
|
94
|
+
# puts "3. Now adding geometry..."
|
|
95
|
+
# model.entities.add_line([0,0,0], [100,0,0])
|
|
96
|
+
#
|
|
97
|
+
# # Still no observer callbacks
|
|
98
|
+
# puts "4. After adding geometry - still no callbacks: #{Time.now}"
|
|
99
|
+
# puts "5. Now committing transaction..."
|
|
100
|
+
#
|
|
101
|
+
# # All observer events will fire when we commit
|
|
102
|
+
# model.commit_operation
|
|
103
|
+
#
|
|
104
|
+
# # The callbacks have now fired in sequence at commit time
|
|
105
|
+
# puts "6. After commit_operation - ALL callbacks have now fired: #{Time.now}"
|
|
106
|
+
#
|
|
107
|
+
# # Try an empty transaction too
|
|
108
|
+
# puts "\nEMPTY TRANSACTION TEST:"
|
|
109
|
+
# puts "1. Starting empty transaction: #{Time.now}"
|
|
110
|
+
# model.start_operation("Empty Test", true)
|
|
111
|
+
# puts "2. Committing with no changes..."
|
|
112
|
+
# model.commit_operation
|
|
113
|
+
# puts "3. After commit - onTransactionStart and onTransactionEmpty fired: #{Time.now}"
|
|
114
|
+
#
|
|
115
|
+
# @note Since SketchUp 2016, all observer events within a transaction are queued and
|
|
116
|
+
# fired only after the operation is committed. This means callbacks like
|
|
117
|
+
# {#onTransactionStart} and other model events do not fire in real-time, but are
|
|
118
|
+
# delayed until the transaction completes. The callbacks fire in the correct sequence,
|
|
119
|
+
# but they all occur at commit time, not when the operations themselves happen.
|
|
120
|
+
# This behavior change was made to improve performance and stability.
|
|
121
|
+
#
|
|
122
|
+
# @note The API currently lacks a method to query the current operation state
|
|
123
|
+
# (e.g., whether a transaction is currently open). This limitation means
|
|
124
|
+
# observers cannot be used to monitor the real-time state of transactions.
|
|
125
|
+
#
|
|
31
126
|
# @version SketchUp 6.0
|
|
32
127
|
class Sketchup::ModelObserver
|
|
33
128
|
|
|
@@ -113,6 +208,9 @@ class Sketchup::ModelObserver
|
|
|
113
208
|
|
|
114
209
|
# The {#onDeleteModel} method is invoked when a model is deleted.
|
|
115
210
|
#
|
|
211
|
+
# @deprecated This callback is deprecated. To handle model close events, use
|
|
212
|
+
# {Sketchup::AppObserver#onCloseModel} instead.
|
|
213
|
+
#
|
|
116
214
|
# @example
|
|
117
215
|
# def onDeleteModel(model)
|
|
118
216
|
# puts "onDeleteModel: #{model}"
|
|
@@ -128,6 +226,9 @@ class Sketchup::ModelObserver
|
|
|
128
226
|
|
|
129
227
|
# The {#onEraseAll} method is invoked when everything in a model is erased.
|
|
130
228
|
#
|
|
229
|
+
# @deprecated This callback is deprecated. To handle model close events, use
|
|
230
|
+
# {Sketchup::AppObserver#onCloseModel} instead.
|
|
231
|
+
#
|
|
131
232
|
# @example
|
|
132
233
|
# def onEraseAll(model)
|
|
133
234
|
# puts "onEraseAll: #{model}"
|
|
@@ -281,7 +382,13 @@ class Sketchup::ModelObserver
|
|
|
281
382
|
def onTransactionAbort(model)
|
|
282
383
|
end
|
|
283
384
|
|
|
284
|
-
# The {#onTransactionCommit} method is invoked when a transaction
|
|
385
|
+
# The {#onTransactionCommit} method is invoked when a transaction containing
|
|
386
|
+
# model changes is completed. This callback is only triggered for transactions
|
|
387
|
+
# that actually modified the model.
|
|
388
|
+
#
|
|
389
|
+
# If a transaction is committed without any model changes, {#onTransactionEmpty} will be
|
|
390
|
+
# called instead of this method. This is important to understand when implementing
|
|
391
|
+
# transaction event handlers.
|
|
285
392
|
#
|
|
286
393
|
# @example
|
|
287
394
|
# def onTransactionCommit(model)
|
|
@@ -294,17 +401,27 @@ class Sketchup::ModelObserver
|
|
|
294
401
|
#
|
|
295
402
|
# @see Sketchup::Model#commit_operation
|
|
296
403
|
#
|
|
404
|
+
# @see #onTransactionEmpty
|
|
405
|
+
#
|
|
297
406
|
# @version SketchUp 6.0
|
|
298
407
|
def onTransactionCommit(model)
|
|
299
408
|
end
|
|
300
409
|
|
|
301
410
|
# The {#onTransactionEmpty} method is invoked when a transaction
|
|
302
411
|
# (aka an undoable operation) starts and then is committed without anything
|
|
303
|
-
# being altered in between.
|
|
412
|
+
# being altered in between. This callback is triggered instead of {#onTransactionCommit}
|
|
413
|
+
# when a transaction contains no model changes.
|
|
414
|
+
#
|
|
415
|
+
# This behavior is important to understand when implementing handlers for transaction events.
|
|
416
|
+
# If you need a unified handler for all committed transactions (both empty and non-empty),
|
|
417
|
+
# you'll need to implement both callbacks.
|
|
304
418
|
#
|
|
305
419
|
# @example
|
|
306
420
|
# def onTransactionEmpty(model)
|
|
307
421
|
# puts "onTransactionEmpty: #{model}"
|
|
422
|
+
# # If you need the same handling for both empty and non-empty transactions,
|
|
423
|
+
# # you can manually call your onTransactionCommit handler:
|
|
424
|
+
# # onTransactionCommit(model)
|
|
308
425
|
# end
|
|
309
426
|
#
|
|
310
427
|
# @param [Sketchup::Model] model
|
|
@@ -313,13 +430,15 @@ class Sketchup::ModelObserver
|
|
|
313
430
|
#
|
|
314
431
|
# @see Sketchup::Model#start_operation
|
|
315
432
|
#
|
|
433
|
+
# @see Sketchup::Model#commit_operation
|
|
434
|
+
#
|
|
316
435
|
# @version SketchUp 6.0
|
|
317
436
|
def onTransactionEmpty(model)
|
|
318
437
|
end
|
|
319
438
|
|
|
320
439
|
# The {#onTransactionRedo} method is invoked when the user "redoes" a
|
|
321
440
|
# transaction (aka undo operation.) You can programmatically fire a redo by
|
|
322
|
-
# calling
|
|
441
|
+
# calling <code>Sketchup.send_action('editRedo:')</code>.
|
|
323
442
|
#
|
|
324
443
|
# @example
|
|
325
444
|
# def onTransactionRedo(model)
|
|
@@ -339,9 +458,16 @@ class Sketchup::ModelObserver
|
|
|
339
458
|
#
|
|
340
459
|
# @example
|
|
341
460
|
# def onTransactionStart(model)
|
|
461
|
+
# # Remember: This is triggered at commit time, not when start_operation is called
|
|
342
462
|
# puts "onTransactionStart: #{model}"
|
|
343
463
|
# end
|
|
344
464
|
#
|
|
465
|
+
# @note This callback is not fired immediately when {Sketchup::Model#start_operation}
|
|
466
|
+
# is called. Instead, it is queued and triggered when the transaction is committed,
|
|
467
|
+
# firing just before {#onTransactionCommit} or {#onTransactionEmpty}. Since
|
|
468
|
+
# SketchUp 2016, all transaction-related events are queued and fired at commit time
|
|
469
|
+
# in the appropriate sequence, rather than in real-time when the operations occur.
|
|
470
|
+
#
|
|
345
471
|
# @param [Sketchup::Model] model
|
|
346
472
|
#
|
|
347
473
|
# @return [nil]
|
|
@@ -354,7 +480,7 @@ class Sketchup::ModelObserver
|
|
|
354
480
|
|
|
355
481
|
# The {#onTransactionUndo method} is invoked when the user "undoes" a
|
|
356
482
|
# transaction (aka undo operation.) You can programmatically fire an undo by
|
|
357
|
-
# calling
|
|
483
|
+
# calling <code>Sketchup.send_action('editUndo:')</code>.
|
|
358
484
|
#
|
|
359
485
|
# @example
|
|
360
486
|
# def onTransactionUndo(model)
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# - <code>"PrintOptions"</code>
|
|
11
11
|
# - <code>"PageOptions"</code>
|
|
12
12
|
# - <code>"SlideshowOptions"</code>
|
|
13
|
-
# - <code>"NamedOptions"</code>
|
|
14
13
|
#
|
|
15
14
|
# Each of these has a list of specific options that the user can set. See the
|
|
16
15
|
# {Sketchup::OptionsManager} and {Sketchup::OptionsProvider} classes for more
|
|
@@ -92,7 +92,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
92
92
|
# page = pages.add "My Page"
|
|
93
93
|
# time = page.delay_time
|
|
94
94
|
#
|
|
95
|
-
# @return
|
|
95
|
+
# @return [Float] the number of seconds of delay.
|
|
96
96
|
#
|
|
97
97
|
# @version SketchUp 6.0
|
|
98
98
|
def delay_time
|
|
@@ -111,11 +111,9 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
111
111
|
# page = pages.add "My Page"
|
|
112
112
|
# time = page.delay_time = 10
|
|
113
113
|
#
|
|
114
|
-
# @param seconds
|
|
114
|
+
# @param [Float] seconds
|
|
115
115
|
# The number of seconds to set as the delay time.
|
|
116
116
|
#
|
|
117
|
-
# @return time - the number of seconds of delay
|
|
118
|
-
#
|
|
119
117
|
# @version SketchUp 6.0
|
|
120
118
|
def delay_time=(seconds)
|
|
121
119
|
end
|
|
@@ -129,7 +127,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
129
127
|
# page = pages.add "My Page"
|
|
130
128
|
# description = page.description
|
|
131
129
|
#
|
|
132
|
-
# @return
|
|
130
|
+
# @return [String] a textual description for the page.
|
|
133
131
|
#
|
|
134
132
|
# @version SketchUp 6.0
|
|
135
133
|
def description
|
|
@@ -144,11 +142,9 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
144
142
|
# page = pages.add "My Page"
|
|
145
143
|
# description = page.description = "This is my first page"
|
|
146
144
|
#
|
|
147
|
-
# @param description
|
|
145
|
+
# @param [String] description
|
|
148
146
|
# A string description for the page.
|
|
149
147
|
#
|
|
150
|
-
# @return description - the new string description for the page
|
|
151
|
-
#
|
|
152
148
|
# @version SketchUp 6.0
|
|
153
149
|
def description=(description)
|
|
154
150
|
end
|
|
@@ -181,8 +177,6 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
181
177
|
#
|
|
182
178
|
# @param [Sketchup::Environment] environment
|
|
183
179
|
#
|
|
184
|
-
# @return [Sketchup::Environment]
|
|
185
|
-
#
|
|
186
180
|
# @version SketchUp 2025.0
|
|
187
181
|
def environment=(environment)
|
|
188
182
|
end
|
|
@@ -220,16 +214,35 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
220
214
|
def get_drawingelement_visibility(element)
|
|
221
215
|
end
|
|
222
216
|
|
|
223
|
-
#
|
|
217
|
+
# Returns the drawing elements whose visibility is overridden by this page.
|
|
218
|
+
#
|
|
219
|
+
# Only top-level Drawingelements are controlled by scene visibility. For nested
|
|
220
|
+
# content, only ComponentInstance, Group and Image instances are affected.
|
|
224
221
|
#
|
|
225
222
|
# @example
|
|
226
223
|
# model = Sketchup.active_model
|
|
227
|
-
#
|
|
228
|
-
#
|
|
229
|
-
#
|
|
224
|
+
# page = model.pages.add("My Page")
|
|
225
|
+
# hidden = page.hidden_entities
|
|
226
|
+
# if hidden
|
|
227
|
+
# puts "Hidden on page: #{hidden.size}"
|
|
228
|
+
# else
|
|
229
|
+
# puts "Page does not store hidden-entity visibility."
|
|
230
|
+
# end
|
|
230
231
|
#
|
|
231
|
-
# @
|
|
232
|
-
#
|
|
232
|
+
# @note Behavior depends on which hidden-visibility flags are used:
|
|
233
|
+
# - SketchUp 2020.1 and later:
|
|
234
|
+
# - If +page.use_hidden_geometry?+ && +page.use_hidden_objects?+ => returns
|
|
235
|
+
# all top-level drawing elements hidden by the page.
|
|
236
|
+
# - If +page.use_hidden_geometry?+ && !+page.use_hidden_objects?+ => returns
|
|
237
|
+
# only non-instance drawing elements (not +ComponentInstance+ or +Group+)
|
|
238
|
+
# hidden by the page.
|
|
239
|
+
# - If !+page.use_hidden_geometry?+ && +page.use_hidden_objects?+ => returns
|
|
240
|
+
# only +ComponentInstance+, +Group+ and +Image+ instances hidden by the page.
|
|
241
|
+
# - If both are +false+ => returns +nil+.
|
|
242
|
+
# - SketchUp 2019 and earlier:
|
|
243
|
+
# - Returns an array when +page.use_hidden?+ is +true+, otherwise +nil+.
|
|
244
|
+
#
|
|
245
|
+
# @return [Array<Sketchup::Drawingelement>, nil] Returns +nil+ when the page does not store hidden-entity visibility.
|
|
233
246
|
#
|
|
234
247
|
# @version SketchUp 6.0
|
|
235
248
|
def hidden_entities
|
|
@@ -246,8 +259,6 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
246
259
|
#
|
|
247
260
|
# @param [Boolean] include
|
|
248
261
|
#
|
|
249
|
-
# @return [Sketchup::Page]
|
|
250
|
-
#
|
|
251
262
|
# @version SketchUp 2018
|
|
252
263
|
def include_in_animation=(include)
|
|
253
264
|
end
|
|
@@ -273,7 +284,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
273
284
|
# page = pages.add "My Page"
|
|
274
285
|
# label = page.label
|
|
275
286
|
#
|
|
276
|
-
# @return
|
|
287
|
+
# @return [String] label for the page tab.
|
|
277
288
|
#
|
|
278
289
|
# @version SketchUp 6.0
|
|
279
290
|
def label
|
|
@@ -305,8 +316,10 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
305
316
|
# layers = page.layers
|
|
306
317
|
#
|
|
307
318
|
# @example Test layer visibility
|
|
308
|
-
# def
|
|
309
|
-
#
|
|
319
|
+
# def layer_visible_in_page?(layer, page)
|
|
320
|
+
# return layer.visible? if page.parent.selected_page == page
|
|
321
|
+
# return nil unless page.use_hidden_layers?
|
|
322
|
+
# page.layers.include?(layer) == hidden_by_default?(layer)
|
|
310
323
|
# end
|
|
311
324
|
#
|
|
312
325
|
# def hidden_by_default?(layer)
|
|
@@ -328,7 +341,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
328
341
|
# page = pages.add "My Page"
|
|
329
342
|
# name = page.name
|
|
330
343
|
#
|
|
331
|
-
# @return
|
|
344
|
+
# @return [String] name for the page tab.
|
|
332
345
|
#
|
|
333
346
|
# @version SketchUp 6.0
|
|
334
347
|
def name
|
|
@@ -345,11 +358,9 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
345
358
|
# page = pages.add "My Page"
|
|
346
359
|
# name = page.name = "Page Name"
|
|
347
360
|
#
|
|
348
|
-
# @param name
|
|
361
|
+
# @param [String] name
|
|
349
362
|
# The name of the page to be set.
|
|
350
363
|
#
|
|
351
|
-
# @return name - the name that you have set
|
|
352
|
-
#
|
|
353
364
|
# @version SketchUp 6.0
|
|
354
365
|
def name=(name)
|
|
355
366
|
end
|
|
@@ -372,6 +383,10 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
372
383
|
#
|
|
373
384
|
# @return [Sketchup::RenderingOptions]
|
|
374
385
|
#
|
|
386
|
+
# @see #use_rendering_options?
|
|
387
|
+
#
|
|
388
|
+
# @see #use_style?
|
|
389
|
+
#
|
|
375
390
|
# @version SketchUp 6.0
|
|
376
391
|
def rendering_options
|
|
377
392
|
end
|
|
@@ -455,7 +470,11 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
455
470
|
# page = pages.add "My Page"
|
|
456
471
|
# style = page.style
|
|
457
472
|
#
|
|
458
|
-
# @return
|
|
473
|
+
# @return [Sketchup::Style] the Style object if successful
|
|
474
|
+
#
|
|
475
|
+
# @see #use_style?
|
|
476
|
+
#
|
|
477
|
+
# @see #use_rendering_options?
|
|
459
478
|
#
|
|
460
479
|
# @version SketchUp 6.0
|
|
461
480
|
def style
|
|
@@ -471,7 +490,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
471
490
|
# page = pages.add "My Page"
|
|
472
491
|
# time = page.transition_time
|
|
473
492
|
#
|
|
474
|
-
# @return
|
|
493
|
+
# @return [Float] the amount of time it takes to
|
|
475
494
|
# transition to this page during a slideshow or animation
|
|
476
495
|
# export.
|
|
477
496
|
#
|
|
@@ -487,11 +506,9 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
487
506
|
# page = pages.add "My Page"
|
|
488
507
|
# time = page.transition_time=20
|
|
489
508
|
#
|
|
490
|
-
# @param trans_time
|
|
509
|
+
# @param [Float] trans_time
|
|
491
510
|
# The transition time in seconds.
|
|
492
511
|
#
|
|
493
|
-
# @return transitiontime - the new transition time
|
|
494
|
-
#
|
|
495
512
|
# @version SketchUp 6.0
|
|
496
513
|
def transition_time=(trans_time)
|
|
497
514
|
end
|
|
@@ -541,15 +558,12 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
541
558
|
# # Set use_axes to false
|
|
542
559
|
# status = page.use_axes=false
|
|
543
560
|
#
|
|
544
|
-
# @param
|
|
561
|
+
# @param [Boolean] setting
|
|
545
562
|
# true if you want your page to save this property, false
|
|
546
563
|
# if you do not want your page to save this property.
|
|
547
564
|
#
|
|
548
|
-
# @return status - true if you are saving the property, false if
|
|
549
|
-
# you are not saving the property.
|
|
550
|
-
#
|
|
551
565
|
# @version SketchUp 6.0
|
|
552
|
-
def use_axes=(
|
|
566
|
+
def use_axes=(setting)
|
|
553
567
|
end
|
|
554
568
|
|
|
555
569
|
# The use_axes? method determines whether you are storing the axes property
|
|
@@ -561,7 +575,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
561
575
|
# page = pages.add "My Page"
|
|
562
576
|
# status = page.use_axes?
|
|
563
577
|
#
|
|
564
|
-
# @return [Boolean]
|
|
578
|
+
# @return [Boolean] true if you are storing the this property with
|
|
565
579
|
# the page, false if you are not storing this property
|
|
566
580
|
# with the page.
|
|
567
581
|
#
|
|
@@ -577,13 +591,10 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
577
591
|
# page = pages.add "My Page"
|
|
578
592
|
# status = page.use_camera = true
|
|
579
593
|
#
|
|
580
|
-
# @param setting
|
|
594
|
+
# @param [Boolean] setting
|
|
581
595
|
# true if you want your page to save this property, false
|
|
582
596
|
# if you do not want your page to save this property.
|
|
583
597
|
#
|
|
584
|
-
# @return status - true if you are saving the property, false if
|
|
585
|
-
# you are not saving the property.
|
|
586
|
-
#
|
|
587
598
|
# @version SketchUp 6.0
|
|
588
599
|
def use_camera=(setting)
|
|
589
600
|
end
|
|
@@ -597,7 +608,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
597
608
|
# page = pages.add "My Page"
|
|
598
609
|
# status = page.use_camera?
|
|
599
610
|
#
|
|
600
|
-
# @return [Boolean]
|
|
611
|
+
# @return [Boolean] true if you are storing the this property with
|
|
601
612
|
# the page, false if you are not storing this property
|
|
602
613
|
# with the page.
|
|
603
614
|
#
|
|
@@ -620,8 +631,6 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
620
631
|
#
|
|
621
632
|
# @param [Boolean] use_environment
|
|
622
633
|
#
|
|
623
|
-
# @return [Boolean]
|
|
624
|
-
#
|
|
625
634
|
# @version SketchUp 2025.0
|
|
626
635
|
def use_environment=(use_environment)
|
|
627
636
|
end
|
|
@@ -656,13 +665,10 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
656
665
|
# page = pages.add "My Page"
|
|
657
666
|
# status = page.use_hidden = false
|
|
658
667
|
#
|
|
659
|
-
# @param setting
|
|
668
|
+
# @param [Boolean] setting
|
|
660
669
|
# true if you want your page to save this property, false
|
|
661
670
|
# if you do not want your page to save this property.
|
|
662
671
|
#
|
|
663
|
-
# @return status - true if you are saving the property, false if
|
|
664
|
-
# you are not saving the property.
|
|
665
|
-
#
|
|
666
672
|
# @see #use_hidden_geometry=
|
|
667
673
|
#
|
|
668
674
|
# @see #use_hidden_objects=
|
|
@@ -683,7 +689,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
683
689
|
# page = pages.add("My Page")
|
|
684
690
|
# status = page.use_hidden?
|
|
685
691
|
#
|
|
686
|
-
# @return [Boolean]
|
|
692
|
+
# @return [Boolean] true if you are storing the this property with
|
|
687
693
|
# the page, false if you are not storing this property
|
|
688
694
|
# with the page.
|
|
689
695
|
#
|
|
@@ -734,13 +740,10 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
734
740
|
# page = pages.add "My Page"
|
|
735
741
|
# status = page.use_hidden_layers = false
|
|
736
742
|
#
|
|
737
|
-
# @param setting
|
|
743
|
+
# @param [Boolean] setting
|
|
738
744
|
# true if you want your page to save this property, false
|
|
739
745
|
# if you do not want your page to save this property.
|
|
740
746
|
#
|
|
741
|
-
# @return status - true if you are saving the property, false if
|
|
742
|
-
# you are not saving the property.
|
|
743
|
-
#
|
|
744
747
|
# @version SketchUp 6.0
|
|
745
748
|
def use_hidden_layers=(setting)
|
|
746
749
|
end
|
|
@@ -754,7 +757,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
754
757
|
# page = pages.add "My Page"
|
|
755
758
|
# status = page.use_hidden_layers?
|
|
756
759
|
#
|
|
757
|
-
# @return [Boolean]
|
|
760
|
+
# @return [Boolean] true if you are storing the this property with
|
|
758
761
|
# the page, false if you are not storing this property
|
|
759
762
|
# with the page.
|
|
760
763
|
#
|
|
@@ -792,28 +795,31 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
792
795
|
def use_hidden_objects?
|
|
793
796
|
end
|
|
794
797
|
|
|
795
|
-
# The
|
|
796
|
-
#
|
|
798
|
+
# The use_rendering_options= method sets whether the page saves its own
|
|
799
|
+
# unique rendering options. In the UI, this corresponds to the "Style and Fog"
|
|
800
|
+
# checkbox in the Scenes panel.
|
|
797
801
|
#
|
|
798
802
|
# @example
|
|
799
803
|
# model = Sketchup.active_model
|
|
800
804
|
# pages = model.pages
|
|
801
805
|
# page = pages.add "My Page"
|
|
802
|
-
#
|
|
806
|
+
# # This will uncheck the "Style and Fog" property for the page.
|
|
807
|
+
# page.use_rendering_options = false
|
|
803
808
|
#
|
|
804
|
-
# @
|
|
805
|
-
#
|
|
806
|
-
# if you do not want your page to save this property.
|
|
809
|
+
# @note Setting this property will also affect the value of {#use_style?}.
|
|
810
|
+
# Setting it to `false` will also cause {#use_style?} to become `false`.
|
|
807
811
|
#
|
|
808
|
-
# @
|
|
809
|
-
#
|
|
812
|
+
# @param [Boolean] use_options
|
|
813
|
+
# `true` to have the page save Style and Fog
|
|
814
|
+
# properties, `false` otherwise.
|
|
810
815
|
#
|
|
811
816
|
# @version SketchUp 6.0
|
|
812
|
-
def use_rendering_options=(
|
|
817
|
+
def use_rendering_options=(use_options)
|
|
813
818
|
end
|
|
814
819
|
|
|
815
|
-
# The use_rendering_options? method determines
|
|
816
|
-
# rendering options
|
|
820
|
+
# The use_rendering_options? method determines if the page saves its own
|
|
821
|
+
# unique rendering options. In the UI, this corresponds to the "Style and Fog"
|
|
822
|
+
# checkbox in the Scenes panel.
|
|
817
823
|
#
|
|
818
824
|
# @example
|
|
819
825
|
# model = Sketchup.active_model
|
|
@@ -821,9 +827,11 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
821
827
|
# page = pages.add "My Page"
|
|
822
828
|
# status = page.use_rendering_options?
|
|
823
829
|
#
|
|
824
|
-
# @
|
|
825
|
-
#
|
|
826
|
-
#
|
|
830
|
+
# @note This method is linked to {#use_style?}. They both check the same
|
|
831
|
+
# property and will always return the same value. This is because a
|
|
832
|
+
# {Sketchup::Style} is the object that contains rendering options.
|
|
833
|
+
#
|
|
834
|
+
# @return [Boolean] true if the page saves Style and Fog properties.
|
|
827
835
|
#
|
|
828
836
|
# @version SketchUp 6.0
|
|
829
837
|
def use_rendering_options?
|
|
@@ -838,13 +846,10 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
838
846
|
# page = pages.add "My Page"
|
|
839
847
|
# status = page.use_section_planes=false
|
|
840
848
|
#
|
|
841
|
-
# @param setting
|
|
849
|
+
# @param [Boolean] setting
|
|
842
850
|
# true if you want your page to save this property, false
|
|
843
851
|
# if you do not want your page to save this property.
|
|
844
852
|
#
|
|
845
|
-
# @return status - true if you are saving the property, false if
|
|
846
|
-
# you are not saving the property.
|
|
847
|
-
#
|
|
848
853
|
# @version SketchUp 6.0
|
|
849
854
|
def use_section_planes=(setting)
|
|
850
855
|
end
|
|
@@ -858,7 +863,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
858
863
|
# page = pages.add "My Page"
|
|
859
864
|
# status = page.use_section_planes?
|
|
860
865
|
#
|
|
861
|
-
# @return [Boolean]
|
|
866
|
+
# @return [Boolean] true if you are storing the this property with
|
|
862
867
|
# the page, false if you are not storing this property
|
|
863
868
|
# with the page.
|
|
864
869
|
#
|
|
@@ -874,13 +879,10 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
874
879
|
# page = pages.add "My Page"
|
|
875
880
|
# status = page.use_shadow_info=false
|
|
876
881
|
#
|
|
877
|
-
# @param setting
|
|
882
|
+
# @param [Boolean] setting
|
|
878
883
|
# true if you want your page to save this property, false
|
|
879
884
|
# if you do not want your page to save this property.
|
|
880
885
|
#
|
|
881
|
-
# @return status - true if you are saving the property, false if
|
|
882
|
-
# you are not saving the property.
|
|
883
|
-
#
|
|
884
886
|
# @version SketchUp 6.0
|
|
885
887
|
def use_shadow_info=(setting)
|
|
886
888
|
end
|
|
@@ -894,7 +896,7 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
894
896
|
# page = pages.add "My Page"
|
|
895
897
|
# status = page.use_shadow_info?
|
|
896
898
|
#
|
|
897
|
-
# @return [Boolean]
|
|
899
|
+
# @return [Boolean] true if you are storing the this property with
|
|
898
900
|
# the page, false if you are not storing this property
|
|
899
901
|
# with the page.
|
|
900
902
|
#
|
|
@@ -909,18 +911,26 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
909
911
|
# pages = model.pages
|
|
910
912
|
# page = pages.add "My Page"
|
|
911
913
|
# style = model.styles[0]
|
|
914
|
+
# # This assigns the style AND sets page.use_rendering_options? to true.
|
|
912
915
|
# page.use_style = style
|
|
913
916
|
#
|
|
914
|
-
# @
|
|
917
|
+
# @note This method is inconsistent with other setters in the API as it does
|
|
918
|
+
# not accept a boolean. To enable style properties for a page, you must
|
|
919
|
+
# assign a {Sketchup::Style} object.
|
|
920
|
+
#
|
|
921
|
+
# @note Assigning a style to a page will automatically set
|
|
922
|
+
# {#use_rendering_options?} to `true`.
|
|
923
|
+
#
|
|
924
|
+
# @param [Sketchup::Style] style
|
|
915
925
|
# The Style object to use.
|
|
916
926
|
#
|
|
917
|
-
# @return
|
|
927
|
+
# @return The assigned {Sketchup::Style} object.
|
|
918
928
|
#
|
|
919
929
|
# @version SketchUp 6.0
|
|
920
930
|
def use_style=(style)
|
|
921
931
|
end
|
|
922
932
|
|
|
923
|
-
# The use_style? method determines
|
|
933
|
+
# The use_style? method determines if the page saves style properties.
|
|
924
934
|
#
|
|
925
935
|
# @example
|
|
926
936
|
# model = Sketchup.active_model
|
|
@@ -928,9 +938,11 @@ class Sketchup::Page < Sketchup::Entity
|
|
|
928
938
|
# page = pages.add "My Page"
|
|
929
939
|
# use_style = page.use_style?
|
|
930
940
|
#
|
|
931
|
-
# @
|
|
932
|
-
#
|
|
933
|
-
#
|
|
941
|
+
# @note This method is linked to {#use_rendering_options?}. They both check the
|
|
942
|
+
# same property and will always return the same value. This is because a
|
|
943
|
+
# {Sketchup::Style} is the object that contains rendering options.
|
|
944
|
+
#
|
|
945
|
+
# @return [Boolean] true if the page saves Style and Fog properties.
|
|
934
946
|
#
|
|
935
947
|
# @version SketchUp 6.0
|
|
936
948
|
def use_style?
|