sketchup-api-stubs 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +151 -148
- data/lib/sketchup-api-stubs/stubs/Array.rb +741 -741
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -322
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +509 -523
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +476 -478
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +693 -693
- data/lib/sketchup-api-stubs/stubs/Geom.rb +351 -351
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -595
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +747 -698
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +517 -516
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -370
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -0
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +692 -692
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
- data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/Length.rb +278 -278
- data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -144
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +150 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -286
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -302
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +659 -619
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +449 -426
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +406 -396
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -502
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1239 -1205
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -272
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -545
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -126
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -937
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +282 -292
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +468 -468
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +406 -407
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -326
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -422
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -427
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -414
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +317 -318
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1652 -1651
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -357
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +130 -131
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +490 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +116 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -797
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +361 -363
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -477
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +361 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +458 -459
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +255 -260
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +834 -837
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1311 -1317
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1377 -1360
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +389 -389
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +494 -496
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -269
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +241 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -635
- data/lib/sketchup-api-stubs/stubs/UI.rb +683 -683
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -311
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +10 -7
@@ -1,363 +1,361 @@
|
|
1
|
-
# Copyright:: Copyright
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The Pages class contains methods for manipulating a collection of Pages
|
5
|
-
# (Named "scenes" in the UI.) in a model.
|
6
|
-
#
|
7
|
-
# You get a handle to this collection by calling Model.pages.
|
8
|
-
#
|
9
|
-
# @example
|
10
|
-
# model = Sketchup.active_model
|
11
|
-
# pages = model.pages
|
12
|
-
#
|
13
|
-
# @version SketchUp 6.0
|
14
|
-
class Sketchup::Pages < Sketchup::Entity
|
15
|
-
|
16
|
-
# Includes
|
17
|
-
|
18
|
-
include Enumerable
|
19
|
-
|
20
|
-
# Constants
|
21
|
-
|
22
|
-
ImageEmbedded = nil # Stub value.
|
23
|
-
ImageEmbeddedAndLinked = nil # Stub value.
|
24
|
-
ImageLinked = nil # Stub value.
|
25
|
-
|
26
|
-
UnitsNormalizedX = nil # Stub value.
|
27
|
-
UnitsNormalizedY = nil # Stub value.
|
28
|
-
UnitsPixels = nil # Stub value.
|
29
|
-
|
30
|
-
# Class Methods
|
31
|
-
|
32
|
-
# The {.add_frame_change_observer} method is used to add a new frame change
|
33
|
-
# observer that is called with each frame of an animation, meaning the
|
34
|
-
# end user has clicked on a Scene tab (aka Page) inside SketchUp and
|
35
|
-
# the camera is animating to that scene.
|
36
|
-
#
|
37
|
-
# The method returns an integer id that can be stored and later used to remove
|
38
|
-
# the observer with the {Sketchup::Pages.remove_frame_change_observer} method.
|
39
|
-
#
|
40
|
-
# @example
|
41
|
-
# class MyFrameChangeObserver
|
42
|
-
# def frameChange(from_page, to_page, percent_done)
|
43
|
-
# puts "From page #{from_page.name} to #{to_page.name} (#{percent_done * 100}%)"
|
44
|
-
# end
|
45
|
-
# end
|
46
|
-
# id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
|
47
|
-
#
|
48
|
-
# @param [#frameChange] object
|
49
|
-
# An object that implements the
|
50
|
-
# {Sketchup::FrameChangeObserver#frameChange} method.
|
51
|
-
#
|
52
|
-
# @return [Integer] A unique id of the observer
|
53
|
-
#
|
54
|
-
# @see Sketchup::FrameChangeObserver#frameChange
|
55
|
-
#
|
56
|
-
# @version SketchUp 6.0
|
57
|
-
def self.add_frame_change_observer(object)
|
58
|
-
end
|
59
|
-
|
60
|
-
# The {.remove_frame_change_observer} method is used to remove a frame change
|
61
|
-
# observer
|
62
|
-
#
|
63
|
-
# @example
|
64
|
-
# Sketchup::Pages.remove_frame_change_observer(id)
|
65
|
-
#
|
66
|
-
# @param [Integer] observer_id
|
67
|
-
# The unique id returned by {.add_frame_change_observer}
|
68
|
-
#
|
69
|
-
# @return [Boolean]
|
70
|
-
#
|
71
|
-
# @version SketchUp 6.0
|
72
|
-
def self.remove_frame_change_observer(observer_id)
|
73
|
-
end
|
74
|
-
|
75
|
-
# Instance Methods
|
76
|
-
|
77
|
-
# The [] method retrieves a page by either name or index.
|
78
|
-
#
|
79
|
-
# @example
|
80
|
-
# model = Sketchup.active_model
|
81
|
-
# pages = model.pages
|
82
|
-
# status = pages.add "Page 1"
|
83
|
-
# status = pages.add "Page 2"
|
84
|
-
# page = pages["Page 2"]
|
85
|
-
# if (page)
|
86
|
-
# UI.messagebox page
|
87
|
-
# else
|
88
|
-
# UI.messagebox "Failure"
|
89
|
-
# end
|
90
|
-
#
|
91
|
-
# @param index_or_name
|
92
|
-
# The index or the string name of the specific page.
|
93
|
-
#
|
94
|
-
# @return page - a Page object if successful
|
95
|
-
#
|
96
|
-
# @version SketchUp 6.0
|
97
|
-
def [](index_or_name)
|
98
|
-
end
|
99
|
-
|
100
|
-
# The {#add} method is used to add a new Page object to the collection.
|
101
|
-
#
|
102
|
-
# If no name is given, then a new name is generated using the default name for
|
103
|
-
# new Pages. If a name is given, then a new Page with that name is
|
104
|
-
# added.
|
105
|
-
#
|
106
|
-
# If the flags parameter is given, it controls which properties are saved with
|
107
|
-
# the Page. See the {Page#update} method for a description of the flags that
|
108
|
-
# can be set.
|
109
|
-
#
|
110
|
-
# If index is given, it specifies the position in the page list that the new
|
111
|
-
# page is added. Otherwise the new page is added to the end.
|
112
|
-
#
|
113
|
-
# @example
|
114
|
-
# model = Sketchup.active_model
|
115
|
-
# pages = model.pages
|
116
|
-
# status = pages.add "Page 1"
|
117
|
-
# status = pages.add "Page 2"
|
118
|
-
# if (status)
|
119
|
-
# UI.messagebox status
|
120
|
-
# else
|
121
|
-
# UI.messagebox "Failure"
|
122
|
-
# end
|
123
|
-
#
|
124
|
-
# @param [String] name
|
125
|
-
# The name of the specific page.
|
126
|
-
#
|
127
|
-
# @param [Integer] flags
|
128
|
-
# Bit flags in integer form.
|
129
|
-
#
|
130
|
-
# @param [Integer] index
|
131
|
-
# Index of where to inset.
|
132
|
-
#
|
133
|
-
# @return [Sketchup::Page]
|
134
|
-
#
|
135
|
-
# @version SketchUp 6.0
|
136
|
-
def add(name = nil, flags = PAGE_USE_ALL, index = self.size)
|
137
|
-
end
|
138
|
-
|
139
|
-
# The add_matchphoto_page method is used to add a photomatch page to the
|
140
|
-
# model. This is an advanced feature that was added to support internal
|
141
|
-
# SketchUp work, so it is unlikely to be useful to you.
|
142
|
-
#
|
143
|
-
# @example
|
144
|
-
# pages = Sketchup.active_model.pages
|
145
|
-
# page = pages.add_matchphoto_page
|
146
|
-
#
|
147
|
-
# @param
|
148
|
-
#
|
149
|
-
#
|
150
|
-
# @param [
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
# @
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
# @
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
#
|
179
|
-
#
|
180
|
-
# pages
|
181
|
-
# pages.
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
# @
|
190
|
-
#
|
191
|
-
# @
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
#
|
198
|
-
#
|
199
|
-
#
|
200
|
-
#
|
201
|
-
# pages
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
#
|
206
|
-
# @
|
207
|
-
#
|
208
|
-
# @
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
#
|
215
|
-
#
|
216
|
-
#
|
217
|
-
#
|
218
|
-
#
|
219
|
-
#
|
220
|
-
# @
|
221
|
-
#
|
222
|
-
# @
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
#
|
229
|
-
#
|
230
|
-
#
|
231
|
-
# pages
|
232
|
-
# pages.
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
236
|
-
# @
|
237
|
-
#
|
238
|
-
# @
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
#
|
245
|
-
#
|
246
|
-
#
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
#
|
252
|
-
#
|
253
|
-
# @
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
#
|
260
|
-
#
|
261
|
-
#
|
262
|
-
#
|
263
|
-
#
|
264
|
-
#
|
265
|
-
#
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
269
|
-
# @
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
#
|
283
|
-
#
|
284
|
-
# @
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
#
|
291
|
-
#
|
292
|
-
#
|
293
|
-
#
|
294
|
-
#
|
295
|
-
#
|
296
|
-
#
|
297
|
-
#
|
298
|
-
#
|
299
|
-
#
|
300
|
-
#
|
301
|
-
# @
|
302
|
-
#
|
303
|
-
# @
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
#
|
310
|
-
#
|
311
|
-
#
|
312
|
-
#
|
313
|
-
#
|
314
|
-
# pages
|
315
|
-
# pages.
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
#
|
320
|
-
#
|
321
|
-
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
#
|
325
|
-
#
|
326
|
-
#
|
327
|
-
#
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
#
|
334
|
-
#
|
335
|
-
#
|
336
|
-
# pages
|
337
|
-
# pages.
|
338
|
-
#
|
339
|
-
#
|
340
|
-
#
|
341
|
-
# @
|
342
|
-
#
|
343
|
-
# @
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
#
|
350
|
-
#
|
351
|
-
#
|
352
|
-
#
|
353
|
-
#
|
354
|
-
#
|
355
|
-
#
|
356
|
-
#
|
357
|
-
# @
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
end
|
1
|
+
# Copyright:: Copyright 2023 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The Pages class contains methods for manipulating a collection of Pages
|
5
|
+
# (Named "scenes" in the UI.) in a model.
|
6
|
+
#
|
7
|
+
# You get a handle to this collection by calling Model.pages.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# model = Sketchup.active_model
|
11
|
+
# pages = model.pages
|
12
|
+
#
|
13
|
+
# @version SketchUp 6.0
|
14
|
+
class Sketchup::Pages < Sketchup::Entity
|
15
|
+
|
16
|
+
# Includes
|
17
|
+
|
18
|
+
include Enumerable
|
19
|
+
|
20
|
+
# Constants
|
21
|
+
|
22
|
+
ImageEmbedded = nil # Stub value.
|
23
|
+
ImageEmbeddedAndLinked = nil # Stub value.
|
24
|
+
ImageLinked = nil # Stub value.
|
25
|
+
|
26
|
+
UnitsNormalizedX = nil # Stub value.
|
27
|
+
UnitsNormalizedY = nil # Stub value.
|
28
|
+
UnitsPixels = nil # Stub value.
|
29
|
+
|
30
|
+
# Class Methods
|
31
|
+
|
32
|
+
# The {.add_frame_change_observer} method is used to add a new frame change
|
33
|
+
# observer that is called with each frame of an animation, meaning the
|
34
|
+
# end user has clicked on a Scene tab (aka Page) inside SketchUp and
|
35
|
+
# the camera is animating to that scene.
|
36
|
+
#
|
37
|
+
# The method returns an integer id that can be stored and later used to remove
|
38
|
+
# the observer with the {Sketchup::Pages.remove_frame_change_observer} method.
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# class MyFrameChangeObserver
|
42
|
+
# def frameChange(from_page, to_page, percent_done)
|
43
|
+
# puts "From page #{from_page.name} to #{to_page.name} (#{percent_done * 100}%)"
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
# id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
|
47
|
+
#
|
48
|
+
# @param [#frameChange] object
|
49
|
+
# An object that implements the
|
50
|
+
# {Sketchup::FrameChangeObserver#frameChange} method.
|
51
|
+
#
|
52
|
+
# @return [Integer] A unique id of the observer
|
53
|
+
#
|
54
|
+
# @see Sketchup::FrameChangeObserver#frameChange
|
55
|
+
#
|
56
|
+
# @version SketchUp 6.0
|
57
|
+
def self.add_frame_change_observer(object)
|
58
|
+
end
|
59
|
+
|
60
|
+
# The {.remove_frame_change_observer} method is used to remove a frame change
|
61
|
+
# observer
|
62
|
+
#
|
63
|
+
# @example
|
64
|
+
# Sketchup::Pages.remove_frame_change_observer(id)
|
65
|
+
#
|
66
|
+
# @param [Integer] observer_id
|
67
|
+
# The unique id returned by {.add_frame_change_observer}
|
68
|
+
#
|
69
|
+
# @return [Boolean]
|
70
|
+
#
|
71
|
+
# @version SketchUp 6.0
|
72
|
+
def self.remove_frame_change_observer(observer_id)
|
73
|
+
end
|
74
|
+
|
75
|
+
# Instance Methods
|
76
|
+
|
77
|
+
# The [] method retrieves a page by either name or index.
|
78
|
+
#
|
79
|
+
# @example
|
80
|
+
# model = Sketchup.active_model
|
81
|
+
# pages = model.pages
|
82
|
+
# status = pages.add "Page 1"
|
83
|
+
# status = pages.add "Page 2"
|
84
|
+
# page = pages["Page 2"]
|
85
|
+
# if (page)
|
86
|
+
# UI.messagebox page
|
87
|
+
# else
|
88
|
+
# UI.messagebox "Failure"
|
89
|
+
# end
|
90
|
+
#
|
91
|
+
# @param index_or_name
|
92
|
+
# The index or the string name of the specific page.
|
93
|
+
#
|
94
|
+
# @return page - a Page object if successful
|
95
|
+
#
|
96
|
+
# @version SketchUp 6.0
|
97
|
+
def [](index_or_name)
|
98
|
+
end
|
99
|
+
|
100
|
+
# The {#add} method is used to add a new Page object to the collection.
|
101
|
+
#
|
102
|
+
# If no name is given, then a new name is generated using the default name for
|
103
|
+
# new Pages. If a name is given, then a new Page with that name is
|
104
|
+
# added.
|
105
|
+
#
|
106
|
+
# If the flags parameter is given, it controls which properties are saved with
|
107
|
+
# the Page. See the {Page#update} method for a description of the flags that
|
108
|
+
# can be set.
|
109
|
+
#
|
110
|
+
# If index is given, it specifies the position in the page list that the new
|
111
|
+
# page is added. Otherwise the new page is added to the end.
|
112
|
+
#
|
113
|
+
# @example
|
114
|
+
# model = Sketchup.active_model
|
115
|
+
# pages = model.pages
|
116
|
+
# status = pages.add "Page 1"
|
117
|
+
# status = pages.add "Page 2"
|
118
|
+
# if (status)
|
119
|
+
# UI.messagebox status
|
120
|
+
# else
|
121
|
+
# UI.messagebox "Failure"
|
122
|
+
# end
|
123
|
+
#
|
124
|
+
# @param [String] name
|
125
|
+
# The name of the specific page.
|
126
|
+
#
|
127
|
+
# @param [Integer] flags
|
128
|
+
# Bit flags in integer form.
|
129
|
+
#
|
130
|
+
# @param [Integer] index
|
131
|
+
# Index of where to inset.
|
132
|
+
#
|
133
|
+
# @return [Sketchup::Page]
|
134
|
+
#
|
135
|
+
# @version SketchUp 6.0
|
136
|
+
def add(name = nil, flags = PAGE_USE_ALL, index = self.size)
|
137
|
+
end
|
138
|
+
|
139
|
+
# The {#add_matchphoto_page} method is used to add a photomatch page to the
|
140
|
+
# model. This is an advanced feature that was added to support internal
|
141
|
+
# SketchUp work, so it is unlikely to be useful to you.
|
142
|
+
#
|
143
|
+
# @example
|
144
|
+
# pages = Sketchup.active_model.pages
|
145
|
+
# page = pages.add_matchphoto_page("/path/to/image.png")
|
146
|
+
#
|
147
|
+
# @param [String] image_filename
|
148
|
+
# The image file to use as the background.
|
149
|
+
#
|
150
|
+
# @param [Sketchup::Camera] camera
|
151
|
+
#
|
152
|
+
# @param [String] page_name
|
153
|
+
#
|
154
|
+
# @return [Sketchup::Page]
|
155
|
+
#
|
156
|
+
# @version SketchUp 7.0
|
157
|
+
def add_matchphoto_page(image_filename, camera = nil, page_name = nil)
|
158
|
+
end
|
159
|
+
|
160
|
+
# The add_observer method is used to add an observer to the Pages object.
|
161
|
+
# See the PagesObserver interface for more details.
|
162
|
+
#
|
163
|
+
# @example
|
164
|
+
# pages = Sketchup.active_model.pages
|
165
|
+
# status = pages.add_observer observer
|
166
|
+
#
|
167
|
+
# @param observer
|
168
|
+
# An observer.
|
169
|
+
#
|
170
|
+
# @return true if successful, false if unsuccessful.
|
171
|
+
#
|
172
|
+
# @version SketchUp 6.0
|
173
|
+
def add_observer(observer)
|
174
|
+
end
|
175
|
+
|
176
|
+
#
|
177
|
+
# @example
|
178
|
+
# pages = Sketchup.active_model.pages
|
179
|
+
# pages.add('Page 1')
|
180
|
+
# pages.add('Page 2')
|
181
|
+
# number = pages.count
|
182
|
+
#
|
183
|
+
# @note Since SketchUp 2014 the count method is inherited from Ruby's
|
184
|
+
# +Enumerable+ mix-in module. Prior to that the {#count} method is an alias
|
185
|
+
# for {#length}.
|
186
|
+
#
|
187
|
+
# @return [Integer]
|
188
|
+
#
|
189
|
+
# @see #length
|
190
|
+
#
|
191
|
+
# @version SketchUp 6.0
|
192
|
+
def count
|
193
|
+
end
|
194
|
+
|
195
|
+
# The {#each} method is used to iterate through pages in the model.
|
196
|
+
#
|
197
|
+
# @example
|
198
|
+
# model = Sketchup.active_model
|
199
|
+
# pages = model.pages
|
200
|
+
# pages.add("Page 1")
|
201
|
+
# pages.add("Page 2")
|
202
|
+
# pages.each { |page| puts page.name }
|
203
|
+
#
|
204
|
+
# @return [nil]
|
205
|
+
#
|
206
|
+
# @version SketchUp 6.0
|
207
|
+
#
|
208
|
+
# @yieldparam [Sketchup::Page] page
|
209
|
+
def each
|
210
|
+
end
|
211
|
+
|
212
|
+
# The {#erase} method is used to remove a page from the collection.
|
213
|
+
#
|
214
|
+
# @example
|
215
|
+
# page = Sketchup.active_model.pages.add('Hello World')
|
216
|
+
# Sketchup.active_model.pages.erase(page)
|
217
|
+
#
|
218
|
+
# @param [Sketchup::Page] page
|
219
|
+
#
|
220
|
+
# @return [Boolean]
|
221
|
+
#
|
222
|
+
# @version SketchUp 6.0
|
223
|
+
def erase(page)
|
224
|
+
end
|
225
|
+
|
226
|
+
# The {#length} method is an alias for {#size}.
|
227
|
+
#
|
228
|
+
# @example
|
229
|
+
# pages = Sketchup.active_model.pages
|
230
|
+
# pages.add('Page 1')
|
231
|
+
# pages.add('Page 2')
|
232
|
+
# number = pages.length
|
233
|
+
#
|
234
|
+
# @return [Integer]
|
235
|
+
#
|
236
|
+
# @see #size
|
237
|
+
#
|
238
|
+
# @version SketchUp 2014
|
239
|
+
def length
|
240
|
+
end
|
241
|
+
|
242
|
+
# The parent method is used to determine the model for the Pages collection.
|
243
|
+
#
|
244
|
+
# @example
|
245
|
+
# model = Sketchup.active_model
|
246
|
+
# pages = model.pages
|
247
|
+
# status = pages.add "Page 1"
|
248
|
+
# status = pages.add "Page 2"
|
249
|
+
# model = pages.parent
|
250
|
+
#
|
251
|
+
# @return model - the model that contains the pages if successful
|
252
|
+
#
|
253
|
+
# @version SketchUp 6.0
|
254
|
+
def parent
|
255
|
+
end
|
256
|
+
|
257
|
+
# The remove_observer method is used to remove an observer from the current
|
258
|
+
# object. See the PagesObserver interface for more details.
|
259
|
+
#
|
260
|
+
# @example
|
261
|
+
# pages = Sketchup.active_model.pages
|
262
|
+
# status = pages.remove_observer observer
|
263
|
+
#
|
264
|
+
# @param observer
|
265
|
+
# An observer.
|
266
|
+
#
|
267
|
+
# @return true if successful, false if unsuccessful.
|
268
|
+
#
|
269
|
+
# @version SketchUp 6.0
|
270
|
+
def remove_observer(observer)
|
271
|
+
end
|
272
|
+
|
273
|
+
# The selected_page method is used to retrieve the currently selected page.
|
274
|
+
#
|
275
|
+
# @example
|
276
|
+
# model = Sketchup.active_model
|
277
|
+
# pages = model.pages
|
278
|
+
# status = pages.add "Page 1"
|
279
|
+
# status = pages.add "Page 2"
|
280
|
+
# page = pages.selected_page
|
281
|
+
#
|
282
|
+
# @return page - the currently selected Page object if successful
|
283
|
+
#
|
284
|
+
# @version SketchUp 6.0
|
285
|
+
def selected_page
|
286
|
+
end
|
287
|
+
|
288
|
+
# The selected_page method is used to set the currently selected page. Once
|
289
|
+
# you set this, SketchUp will animate to that page as if the user had clicked
|
290
|
+
# on its scene tab.
|
291
|
+
#
|
292
|
+
# @example
|
293
|
+
# model = Sketchup.active_model
|
294
|
+
# pages = model.pages
|
295
|
+
# status = pages.add "Page 1"
|
296
|
+
# status = pages.add "Page 2"
|
297
|
+
# pages.selected_page = model.pages[1]
|
298
|
+
#
|
299
|
+
# @param [Sketchup::Page] page
|
300
|
+
#
|
301
|
+
# @return status - true if successful
|
302
|
+
#
|
303
|
+
# @version SketchUp 6.0
|
304
|
+
def selected_page=(page)
|
305
|
+
end
|
306
|
+
|
307
|
+
# The {#show_frame_at} method is used to show a frame in animation (of the
|
308
|
+
# slide show) at a given time in seconds.
|
309
|
+
#
|
310
|
+
# @example
|
311
|
+
# model = Sketchup.active_model
|
312
|
+
# pages = model.pages
|
313
|
+
# pages.add("Page 1")
|
314
|
+
# pages.add("Page 2")
|
315
|
+
# page, ratio = pages.show_frame_at(1.8)
|
316
|
+
#
|
317
|
+
# @note In versions prior to SketchUp 2019 this method will crash if called
|
318
|
+
# when there are no pages in the model.
|
319
|
+
#
|
320
|
+
# @param [Float] seconds
|
321
|
+
# The time in seconds.
|
322
|
+
#
|
323
|
+
# @return [Array(Sketchup::Page, Float), nil] Upon success it returns the
|
324
|
+
# page that is displayed and a parameter between +0.0+ and +1.0+ that is
|
325
|
+
# tells how far along the transition to next page you are at.
|
326
|
+
#
|
327
|
+
# @version SketchUp 6.0
|
328
|
+
def show_frame_at(seconds)
|
329
|
+
end
|
330
|
+
|
331
|
+
# The {#size} method is used to retrieve the number of pages.
|
332
|
+
#
|
333
|
+
# @example
|
334
|
+
# pages = Sketchup.active_model.pages
|
335
|
+
# pages.add('Page 1')
|
336
|
+
# pages.add('Page 2')
|
337
|
+
# number = pages.size
|
338
|
+
#
|
339
|
+
# @return [Integer]
|
340
|
+
#
|
341
|
+
# @see #length
|
342
|
+
#
|
343
|
+
# @version SketchUp 6.0
|
344
|
+
def size
|
345
|
+
end
|
346
|
+
|
347
|
+
# The slideshow_time method is used to get the amount of time that a slideshow
|
348
|
+
# of all of the pages will take. This takes into account the transition time
|
349
|
+
# for each Page and the amount of time that each Page is displayed.
|
350
|
+
#
|
351
|
+
# @example
|
352
|
+
# pages = Sketchup.active_model.pages
|
353
|
+
# time = pages.slideshow_time
|
354
|
+
#
|
355
|
+
# @return status - true if successful
|
356
|
+
#
|
357
|
+
# @version SketchUp 6.0
|
358
|
+
def slideshow_time
|
359
|
+
end
|
360
|
+
|
361
|
+
end
|