sketchup-api-stubs 0.7.9 → 0.7.11
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 +157 -151
- 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 +182 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +111 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +423 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +693 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +535 -509
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +500 -476
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +267 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +133 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +547 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +678 -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 +751 -747
- 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/Dictionary.rb +234 -0
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +683 -517
- 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 +464 -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 +614 -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 +282 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +458 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +346 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -82
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +714 -692
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1565 -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 +286 -278
- data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +196 -144
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +226 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +145 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +294 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +296 -302
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +473 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -121
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +673 -659
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +600 -593
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +252 -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 +443 -449
- 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 +167 -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 +403 -406
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -397
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1282 -1239
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +519 -545
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
- data/lib/sketchup-api-stubs/stubs/Sketchup/Environment.rb +406 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Environments.rb +185 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb +113 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +122 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +1006 -937
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +740 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +289 -282
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +64 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +405 -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 +432 -406
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +307 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +332 -326
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +380 -422
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +409 -427
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +241 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +55 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -114
- data/lib/sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb +70 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1115 -414
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +330 -317
- 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 +1714 -1652
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +372 -357
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +133 -130
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -271
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +463 -490
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +104 -116
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +939 -797
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +388 -361
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +501 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +385 -361
- 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 +451 -458
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +211 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +259 -255
- 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/Snap.rb +125 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +88 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +263 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +283 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +199 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +924 -834
- 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 +143 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1566 -1311
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +71 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1429 -1377
- 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 +399 -389
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +580 -494
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +280 -269
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +258 -241
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +636 -635
- data/lib/sketchup-api-stubs/stubs/UI.rb +791 -683
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -303
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +10 -24
|
@@ -1,490 +1,463 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
2
|
-
# License:: The MIT License (MIT)
|
|
3
|
-
|
|
4
|
-
# An Overlay provides contextual model information directly in the viewport.
|
|
5
|
-
# This can be presented in 2D and 3D.
|
|
6
|
-
#
|
|
7
|
-
# Examples can be annotations or analytical model information such as geometry
|
|
8
|
-
# analysis, energy analysis, etc.
|
|
9
|
-
#
|
|
10
|
-
# The overlay feature is not intended as a mechanism to provide custom entities
|
|
11
|
-
# to SketchUp. Whatever overlays draw is not pickable nor exportable.
|
|
12
|
-
#
|
|
13
|
-
# It is also not allowed to perform model changes from overlay events. Doing
|
|
14
|
-
# so will result in a +RuntimeError+ being thrown.
|
|
15
|
-
#
|
|
16
|
-
# @
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
# view.
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
#
|
|
64
|
-
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
#
|
|
69
|
-
#
|
|
70
|
-
#
|
|
71
|
-
#
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
#
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
#
|
|
81
|
-
#
|
|
82
|
-
#
|
|
83
|
-
#
|
|
84
|
-
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
#
|
|
91
|
-
#
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
#
|
|
97
|
-
#
|
|
98
|
-
#
|
|
99
|
-
#
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
#
|
|
104
|
-
#
|
|
105
|
-
#
|
|
106
|
-
#
|
|
107
|
-
#
|
|
108
|
-
#
|
|
109
|
-
#
|
|
110
|
-
# points
|
|
111
|
-
#
|
|
112
|
-
#
|
|
113
|
-
#
|
|
114
|
-
#
|
|
115
|
-
#
|
|
116
|
-
#
|
|
117
|
-
#
|
|
118
|
-
#
|
|
119
|
-
#
|
|
120
|
-
#
|
|
121
|
-
#
|
|
122
|
-
#
|
|
123
|
-
#
|
|
124
|
-
#
|
|
125
|
-
#
|
|
126
|
-
#
|
|
127
|
-
# @
|
|
128
|
-
#
|
|
129
|
-
#
|
|
130
|
-
#
|
|
131
|
-
#
|
|
132
|
-
#
|
|
133
|
-
#
|
|
134
|
-
#
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
#
|
|
139
|
-
#
|
|
140
|
-
#
|
|
141
|
-
#
|
|
142
|
-
#
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
#
|
|
147
|
-
# @
|
|
148
|
-
#
|
|
149
|
-
# @
|
|
150
|
-
|
|
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
|
-
#
|
|
181
|
-
#
|
|
182
|
-
#
|
|
183
|
-
#
|
|
184
|
-
#
|
|
185
|
-
#
|
|
186
|
-
#
|
|
187
|
-
#
|
|
188
|
-
#
|
|
189
|
-
#
|
|
190
|
-
#
|
|
191
|
-
#
|
|
192
|
-
#
|
|
193
|
-
#
|
|
194
|
-
#
|
|
195
|
-
#
|
|
196
|
-
#
|
|
197
|
-
#
|
|
198
|
-
#
|
|
199
|
-
#
|
|
200
|
-
#
|
|
201
|
-
#
|
|
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
|
-
#
|
|
232
|
-
#
|
|
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
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
#
|
|
318
|
-
#
|
|
319
|
-
#
|
|
320
|
-
# @
|
|
321
|
-
#
|
|
322
|
-
#
|
|
323
|
-
#
|
|
324
|
-
#
|
|
325
|
-
#
|
|
326
|
-
#
|
|
327
|
-
#
|
|
328
|
-
#
|
|
329
|
-
#
|
|
330
|
-
#
|
|
331
|
-
#
|
|
332
|
-
#
|
|
333
|
-
#
|
|
334
|
-
#
|
|
335
|
-
#
|
|
336
|
-
|
|
337
|
-
end
|
|
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
|
-
# @
|
|
364
|
-
#
|
|
365
|
-
#
|
|
366
|
-
#
|
|
367
|
-
#
|
|
368
|
-
#
|
|
369
|
-
#
|
|
370
|
-
#
|
|
371
|
-
#
|
|
372
|
-
#
|
|
373
|
-
#
|
|
374
|
-
#
|
|
375
|
-
#
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
#
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
#
|
|
384
|
-
#
|
|
385
|
-
#
|
|
386
|
-
#
|
|
387
|
-
#
|
|
388
|
-
#
|
|
389
|
-
#
|
|
390
|
-
#
|
|
391
|
-
# @
|
|
392
|
-
#
|
|
393
|
-
#
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
#
|
|
398
|
-
# @
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
#
|
|
403
|
-
#
|
|
404
|
-
#
|
|
405
|
-
#
|
|
406
|
-
#
|
|
407
|
-
#
|
|
408
|
-
#
|
|
409
|
-
#
|
|
410
|
-
#
|
|
411
|
-
#
|
|
412
|
-
#
|
|
413
|
-
#
|
|
414
|
-
# @version SketchUp 2023.0
|
|
415
|
-
def
|
|
416
|
-
end
|
|
417
|
-
|
|
418
|
-
#
|
|
419
|
-
# @abstract It can be used by implementing sub-classes to react when the overlay
|
|
420
|
-
# becomes
|
|
421
|
-
#
|
|
422
|
-
# @
|
|
423
|
-
#
|
|
424
|
-
#
|
|
425
|
-
#
|
|
426
|
-
#
|
|
427
|
-
#
|
|
428
|
-
#
|
|
429
|
-
#
|
|
430
|
-
#
|
|
431
|
-
#
|
|
432
|
-
#
|
|
433
|
-
#
|
|
434
|
-
#
|
|
435
|
-
#
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
#
|
|
442
|
-
# @
|
|
443
|
-
#
|
|
444
|
-
#
|
|
445
|
-
#
|
|
446
|
-
#
|
|
447
|
-
#
|
|
448
|
-
#
|
|
449
|
-
#
|
|
450
|
-
#
|
|
451
|
-
#
|
|
452
|
-
#
|
|
453
|
-
#
|
|
454
|
-
#
|
|
455
|
-
#
|
|
456
|
-
#
|
|
457
|
-
#
|
|
458
|
-
#
|
|
459
|
-
#
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
# Indicates whether the overlay is valid. An overlay becomes invalid after
|
|
465
|
-
# being removed from the model and cannot be reused.
|
|
466
|
-
#
|
|
467
|
-
# @api Overlays
|
|
468
|
-
#
|
|
469
|
-
# @example
|
|
470
|
-
# class ExampleOverlay < Sketchup::Overlay
|
|
471
|
-
# def initialize
|
|
472
|
-
# super('example_inc.my_overlay', 'Example Overlay')
|
|
473
|
-
# end
|
|
474
|
-
# end
|
|
475
|
-
#
|
|
476
|
-
# overlay = ExampleOverlay.new
|
|
477
|
-
# p overlay.valid? # => true
|
|
478
|
-
# Sketchup.active_model.overlays.add(overlay)
|
|
479
|
-
# p overlay.valid? # => true
|
|
480
|
-
#
|
|
481
|
-
# Sketchup.active_model.overlays.remove(overlay)
|
|
482
|
-
# p overlay.valid? # => false
|
|
483
|
-
#
|
|
484
|
-
# @return [Boolean]
|
|
485
|
-
#
|
|
486
|
-
# @version SketchUp 2023.0
|
|
487
|
-
def valid?
|
|
488
|
-
end
|
|
489
|
-
|
|
490
|
-
end
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
|
+
# License:: The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
# An Overlay provides contextual model information directly in the viewport.
|
|
5
|
+
# This can be presented in 2D and 3D.
|
|
6
|
+
#
|
|
7
|
+
# Examples can be annotations or analytical model information such as geometry
|
|
8
|
+
# analysis, energy analysis, etc.
|
|
9
|
+
#
|
|
10
|
+
# The overlay feature is not intended as a mechanism to provide custom entities
|
|
11
|
+
# to SketchUp. Whatever overlays draw is not pickable nor exportable.
|
|
12
|
+
#
|
|
13
|
+
# It is also not allowed to perform model changes from overlay events. Doing
|
|
14
|
+
# so will result in a +RuntimeError+ being thrown.
|
|
15
|
+
#
|
|
16
|
+
# @example
|
|
17
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
18
|
+
#
|
|
19
|
+
# def initialize
|
|
20
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
21
|
+
# end
|
|
22
|
+
#
|
|
23
|
+
# def draw(view)
|
|
24
|
+
# rectangle = [
|
|
25
|
+
# [100, 100, 0], [300, 100, 0], [300, 200, 0], [100, 200, 0]
|
|
26
|
+
# ]
|
|
27
|
+
# view.drawing_color = 'blue'
|
|
28
|
+
# view.draw2d(GL_QUADS, rectangle)
|
|
29
|
+
# point = Geom::Point3d.new(120, 120, 0)
|
|
30
|
+
# view.draw_text(point, "Hello Overlay", size: 20, bold: true, color: 'white')
|
|
31
|
+
# end
|
|
32
|
+
#
|
|
33
|
+
# end
|
|
34
|
+
#
|
|
35
|
+
# # Using an observer to create a new overlay per model.
|
|
36
|
+
# class ExampleAppObserver < Sketchup::AppObserver
|
|
37
|
+
#
|
|
38
|
+
# def expectsStartupModelNotifications
|
|
39
|
+
# true
|
|
40
|
+
# end
|
|
41
|
+
#
|
|
42
|
+
# def register_overlay(model)
|
|
43
|
+
# overlay = ExampleOverlay.new
|
|
44
|
+
# model.overlays.add(overlay)
|
|
45
|
+
# end
|
|
46
|
+
# alias_method :onNewModel, :register_overlay
|
|
47
|
+
# alias_method :onOpenModel, :register_overlay
|
|
48
|
+
#
|
|
49
|
+
# end
|
|
50
|
+
#
|
|
51
|
+
# observer = ExampleAppObserver.new
|
|
52
|
+
# Sketchup.add_observer(observer)
|
|
53
|
+
#
|
|
54
|
+
# # The following line is needed if you copy+paste in the Ruby Console or
|
|
55
|
+
# # at the moment the extension is installed:
|
|
56
|
+
# observer.register_overlay(Sketchup.active_model)
|
|
57
|
+
#
|
|
58
|
+
# @version SketchUp 2023.0
|
|
59
|
+
class Sketchup::Overlay
|
|
60
|
+
|
|
61
|
+
# Instance Methods
|
|
62
|
+
|
|
63
|
+
# This is a short user facing description of the overlay that will appear in the UI.
|
|
64
|
+
#
|
|
65
|
+
# @example
|
|
66
|
+
# Sketchup.active_model.overlays.each { |overlay|
|
|
67
|
+
# puts "#{overlay.name}: #{overlay.description}"
|
|
68
|
+
# }
|
|
69
|
+
#
|
|
70
|
+
# @return [String]
|
|
71
|
+
#
|
|
72
|
+
# @version SketchUp 2023.0
|
|
73
|
+
def description
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Sets a short user facing description of the overlay that will appear in the UI.
|
|
77
|
+
# Set this before adding to the {Sketchup::OverlaysManager}.
|
|
78
|
+
#
|
|
79
|
+
# @example
|
|
80
|
+
# Sketchup.active_model.overlays.each { |overlay|
|
|
81
|
+
# puts "#{overlay.name}: #{overlay.description}"
|
|
82
|
+
# }
|
|
83
|
+
#
|
|
84
|
+
# @return [String]
|
|
85
|
+
#
|
|
86
|
+
# @version SketchUp 2023.0
|
|
87
|
+
def description=(description)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
#
|
|
91
|
+
# @abstract It is called whenever the view updates.
|
|
92
|
+
#
|
|
93
|
+
# @example
|
|
94
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
95
|
+
#
|
|
96
|
+
# def initialize
|
|
97
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
98
|
+
# end
|
|
99
|
+
#
|
|
100
|
+
# def draw(view)
|
|
101
|
+
# # Draw a square.
|
|
102
|
+
# points = [
|
|
103
|
+
# Geom::Point3d.new(0, 0, 0),
|
|
104
|
+
# Geom::Point3d.new(9, 0, 0),
|
|
105
|
+
# Geom::Point3d.new(9, 9, 0),
|
|
106
|
+
# Geom::Point3d.new(0, 9, 0)
|
|
107
|
+
# ]
|
|
108
|
+
# # Fill
|
|
109
|
+
# view.drawing_color = Sketchup::Color.new(255, 128, 128)
|
|
110
|
+
# view.draw(GL_QUADS, points)
|
|
111
|
+
# # Outline
|
|
112
|
+
# view.line_stipple = '' # Solid line
|
|
113
|
+
# view.drawing_color = Sketchup::Color.new(64, 0, 0)
|
|
114
|
+
# view.draw(GL_LINE_LOOP, points)
|
|
115
|
+
# end
|
|
116
|
+
#
|
|
117
|
+
# end
|
|
118
|
+
#
|
|
119
|
+
# @note This is called very often. Perform minimal amount of computation in
|
|
120
|
+
# this event. Cache the data needed to draw what the overlay needs whenever
|
|
121
|
+
# possible.
|
|
122
|
+
#
|
|
123
|
+
# @note If you draw outside the model bounds you need to implement
|
|
124
|
+
# {Sketchup::Overlay#getExtents} which return a bounding box large enough to
|
|
125
|
+
# include the points you draw. Otherwise your drawing will be clipped.
|
|
126
|
+
#
|
|
127
|
+
# @param [Sketchup::View] view
|
|
128
|
+
# A View object where the method was invoked.
|
|
129
|
+
#
|
|
130
|
+
# @see getExtents
|
|
131
|
+
#
|
|
132
|
+
# @see Sketchup::View#draw
|
|
133
|
+
#
|
|
134
|
+
# @version SketchUp 2023.0
|
|
135
|
+
def draw(view)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
#
|
|
139
|
+
# @note In most cases, extensions doesn't need to expose any new UI for
|
|
140
|
+
# enabling them. This can be done from the Overlays panel. However, in some
|
|
141
|
+
# cases the extension might have additional UI related to the overlays and
|
|
142
|
+
# might want to offer a way to toggle its overlays along with the rest of
|
|
143
|
+
# the UI.
|
|
144
|
+
#
|
|
145
|
+
# @param [Boolean] enabled
|
|
146
|
+
#
|
|
147
|
+
# @raise [RuntimeError] if the overlay is not added to a model.
|
|
148
|
+
#
|
|
149
|
+
# @version SketchUp 2023.0
|
|
150
|
+
def enabled=(enabled)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
#
|
|
154
|
+
# @example
|
|
155
|
+
# Sketchup.active_model.overlays.each { |overlay|
|
|
156
|
+
# puts "#{overlay.name} (#{overlay.overlay_id}) Enabled: #{overlay.enabled?}"
|
|
157
|
+
# }
|
|
158
|
+
#
|
|
159
|
+
# @return [Boolean]
|
|
160
|
+
#
|
|
161
|
+
# @version SketchUp 2023.0
|
|
162
|
+
def enabled?
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# In order to accurately draw things, SketchUp needs to know the extents of
|
|
166
|
+
# what it is drawing. If the overlay is doing its own drawing, it may need to
|
|
167
|
+
# implement this method to tell SketchUp the extents of what it will be
|
|
168
|
+
# drawing. If you don't implement this method, you may find that part of what
|
|
169
|
+
# the overlay is drawing gets clipped to the extents of the rest of the
|
|
170
|
+
# model.
|
|
171
|
+
#
|
|
172
|
+
# This must return a {Geom::BoundingBox}. In a typical implementation, you
|
|
173
|
+
# will create a new {Geom::BoundingBox}, add points to set the extents of the
|
|
174
|
+
# drawing that the overlay will do and then return it.
|
|
175
|
+
#
|
|
176
|
+
# @abstract The method should be implementing sub-classes ensure what is drawn
|
|
177
|
+
# in 3D space doesn't appear clipped. If the overlay only draws in 2D this
|
|
178
|
+
# isn't needed.
|
|
179
|
+
#
|
|
180
|
+
# @example
|
|
181
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
182
|
+
#
|
|
183
|
+
# def initialize
|
|
184
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
185
|
+
# @points = [ [0, 0, 0], [9, 0, 0], [9, 9, 0], [0, 9, 0] ]
|
|
186
|
+
# end
|
|
187
|
+
#
|
|
188
|
+
# def getExtents
|
|
189
|
+
# bb = Sketchup.active_model.bounds
|
|
190
|
+
# bb.add(@points)
|
|
191
|
+
# return bb
|
|
192
|
+
# end
|
|
193
|
+
#
|
|
194
|
+
# def draw(view)
|
|
195
|
+
# view.draw(GL_QUADS, @points)
|
|
196
|
+
# end
|
|
197
|
+
#
|
|
198
|
+
# end
|
|
199
|
+
#
|
|
200
|
+
# @note This is called very often. Perform minimal amount of computation in
|
|
201
|
+
# this event. Cache the data needed to compute the bounds of what the overlay
|
|
202
|
+
# draws whenever possible.
|
|
203
|
+
#
|
|
204
|
+
# @return [Geom::BoundingBox]
|
|
205
|
+
#
|
|
206
|
+
# @version SketchUp 2023.0
|
|
207
|
+
def getExtents
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
#
|
|
211
|
+
# @example
|
|
212
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
213
|
+
#
|
|
214
|
+
# def initialize
|
|
215
|
+
# description = "A short sentence describing the overlay."
|
|
216
|
+
# super('example_inc.my_overlay', 'Example Overlay', description: description)
|
|
217
|
+
# end
|
|
218
|
+
#
|
|
219
|
+
# end
|
|
220
|
+
#
|
|
221
|
+
# overlay = ExampleOverlay.new
|
|
222
|
+
#
|
|
223
|
+
# @param [String] id
|
|
224
|
+
# The string should be unique per overlay subclass.
|
|
225
|
+
# A good pattern would be something like: +"company_name.extension_name.overlay_name"+.
|
|
226
|
+
#
|
|
227
|
+
# @param [String] name
|
|
228
|
+
# This is a user facing display name that will appear in the UI.
|
|
229
|
+
# Make it short and representative for what the overlay does.
|
|
230
|
+
#
|
|
231
|
+
# @param [String] description
|
|
232
|
+
# This is a user facing description that will appear in the UI.
|
|
233
|
+
# Make it short and representative for what the overlay does.
|
|
234
|
+
#
|
|
235
|
+
# @raise [ArgumentError] if +id+ or +name+ is an empty string
|
|
236
|
+
#
|
|
237
|
+
# @version SketchUp 2023.0
|
|
238
|
+
def initialize(id, name, description: "")
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# This is a user facing display name that will appear in the UI.
|
|
242
|
+
#
|
|
243
|
+
# @example
|
|
244
|
+
# Sketchup.active_model.overlays.each { |overlay|
|
|
245
|
+
# puts "#{overlay.name} (#{overlay.overlay_id}) Enabled: #{overlay.enabled?}"
|
|
246
|
+
# }
|
|
247
|
+
#
|
|
248
|
+
# @return [String]
|
|
249
|
+
#
|
|
250
|
+
# @version SketchUp 2023.0
|
|
251
|
+
def name
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# The {#onMouseEnter} method is called by SketchUp when the mouse enters the
|
|
255
|
+
# viewport.
|
|
256
|
+
#
|
|
257
|
+
# @abstract It can be used by implementing sub-classes to react to
|
|
258
|
+
# mouse movement in the viewport.
|
|
259
|
+
#
|
|
260
|
+
# @example
|
|
261
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
262
|
+
#
|
|
263
|
+
# def initialize
|
|
264
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
265
|
+
# end
|
|
266
|
+
#
|
|
267
|
+
# def onMouseEnter(flags, x, y, view)
|
|
268
|
+
# puts "onMouseEnter: flags = #{flags}"
|
|
269
|
+
# puts " x = #{x}"
|
|
270
|
+
# puts " y = #{y}"
|
|
271
|
+
# puts " view = #{view}"
|
|
272
|
+
# end
|
|
273
|
+
#
|
|
274
|
+
# end
|
|
275
|
+
#
|
|
276
|
+
# @param [Integer] flags
|
|
277
|
+
# A bit mask that tells the state of the modifier
|
|
278
|
+
# keys and other mouse buttons at the time.
|
|
279
|
+
#
|
|
280
|
+
# @param [Integer] x
|
|
281
|
+
# The X coordinate on the screen where the event occurred.
|
|
282
|
+
#
|
|
283
|
+
# @param [Integer] y
|
|
284
|
+
# The Y coordinate on the screen where the event occurred.
|
|
285
|
+
#
|
|
286
|
+
# @param [Sketchup::View] view
|
|
287
|
+
#
|
|
288
|
+
# @version SketchUp 2023.0
|
|
289
|
+
def onMouseEnter(flags, x, y, view)
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# The {#onMouseLeave} method is called by SketchUp when the mouse enters the
|
|
293
|
+
# viewport.
|
|
294
|
+
#
|
|
295
|
+
# @abstract It can be used by implementing sub-classes to react to
|
|
296
|
+
# mouse movement in the viewport.
|
|
297
|
+
#
|
|
298
|
+
# @example
|
|
299
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
300
|
+
#
|
|
301
|
+
# def initialize
|
|
302
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
303
|
+
# end
|
|
304
|
+
#
|
|
305
|
+
# def onMouseLeave(view)
|
|
306
|
+
# puts "onMouseLeave"
|
|
307
|
+
# end
|
|
308
|
+
#
|
|
309
|
+
# end
|
|
310
|
+
#
|
|
311
|
+
# @param [Sketchup::View] view
|
|
312
|
+
#
|
|
313
|
+
# @version SketchUp 2023.0
|
|
314
|
+
def onMouseLeave(view)
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
# Try to make this method as efficient as possible because this method is
|
|
318
|
+
# called often.
|
|
319
|
+
#
|
|
320
|
+
# @abstract It can be used by implementing sub-classes to react to
|
|
321
|
+
# mouse movement in the viewport.
|
|
322
|
+
#
|
|
323
|
+
# @example
|
|
324
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
325
|
+
#
|
|
326
|
+
# def initialize
|
|
327
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
328
|
+
# end
|
|
329
|
+
#
|
|
330
|
+
# def onMouseMove(flags, x, y, view)
|
|
331
|
+
# puts "onMouseMove: flags = #{flags}"
|
|
332
|
+
# puts " x = #{x}"
|
|
333
|
+
# puts " y = #{y}"
|
|
334
|
+
# puts " view = #{view}"
|
|
335
|
+
# end
|
|
336
|
+
#
|
|
337
|
+
# end
|
|
338
|
+
#
|
|
339
|
+
# @overload onMouseMove(flags, x, y, view)
|
|
340
|
+
#
|
|
341
|
+
# @note Signature for versions prior to SketchUp 2025.0
|
|
342
|
+
# @version SketchUp 2023.0
|
|
343
|
+
# @param [Integer] flags A bit mask that tells the state of the modifier
|
|
344
|
+
# keys and other mouse buttons at the time.
|
|
345
|
+
# @param [Integer] x Screen coordinate in physical pixels.
|
|
346
|
+
# @param [Integer] y Screen coordinate in physical pixels.
|
|
347
|
+
# @param [Sketchup::View] view
|
|
348
|
+
#
|
|
349
|
+
# @overload onMouseMove(flags, x, y, view)
|
|
350
|
+
#
|
|
351
|
+
# @version SketchUp 2025.0
|
|
352
|
+
# @param [Integer] flags A bit mask that tells the state of the modifier
|
|
353
|
+
# keys and other mouse buttons at the time.
|
|
354
|
+
# @param [Float] x Screen coordinate in logical pixels.
|
|
355
|
+
# @param [Float] y Screen coordinate in logical pixels.
|
|
356
|
+
# @param [Sketchup::View] view
|
|
357
|
+
#
|
|
358
|
+
# @version SketchUp 2023.0
|
|
359
|
+
def onMouseMove
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
#
|
|
363
|
+
# @example Implementing
|
|
364
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
365
|
+
#
|
|
366
|
+
# def initialize
|
|
367
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
368
|
+
# end
|
|
369
|
+
#
|
|
370
|
+
# end
|
|
371
|
+
#
|
|
372
|
+
# @example Accessing
|
|
373
|
+
# Sketchup.active_model.overlays.each { |overlay|
|
|
374
|
+
# puts "#{overlay.name} (#{overlay.overlay_id}) Enabled: #{overlay.enabled?}"
|
|
375
|
+
# }
|
|
376
|
+
#
|
|
377
|
+
# @return [String]
|
|
378
|
+
#
|
|
379
|
+
# @version SketchUp 2023.0
|
|
380
|
+
def overlay_id
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
# Describes the source associated with the overlay. This is automatically inferred
|
|
384
|
+
# when the overlay instance is initialized.
|
|
385
|
+
#
|
|
386
|
+
# @example
|
|
387
|
+
# Sketchup.active_model.overlays.each { |overlay|
|
|
388
|
+
# puts "#{overlay.name} (Extension: #{overlay.source})"
|
|
389
|
+
# }
|
|
390
|
+
#
|
|
391
|
+
# @return [String]
|
|
392
|
+
#
|
|
393
|
+
# @version SketchUp 2023.0
|
|
394
|
+
def source
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
#
|
|
398
|
+
# @abstract It can be used by implementing sub-classes to react when the overlay
|
|
399
|
+
# becomes active, for instance when the user turns it on.
|
|
400
|
+
#
|
|
401
|
+
# @example
|
|
402
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
403
|
+
#
|
|
404
|
+
# def initialize
|
|
405
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
406
|
+
# end
|
|
407
|
+
#
|
|
408
|
+
# def start
|
|
409
|
+
# puts "Overlay #{self} started"
|
|
410
|
+
# end
|
|
411
|
+
#
|
|
412
|
+
# end
|
|
413
|
+
#
|
|
414
|
+
# @version SketchUp 2023.0
|
|
415
|
+
def start
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
#
|
|
419
|
+
# @abstract It can be used by implementing sub-classes to react when the overlay
|
|
420
|
+
# becomes inactive, for instance when the user turns it off.
|
|
421
|
+
#
|
|
422
|
+
# @example
|
|
423
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
424
|
+
#
|
|
425
|
+
# def initialize
|
|
426
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
427
|
+
# end
|
|
428
|
+
#
|
|
429
|
+
# def stop(view)
|
|
430
|
+
# puts "Overlay #{self} stopped"
|
|
431
|
+
# end
|
|
432
|
+
#
|
|
433
|
+
# end
|
|
434
|
+
#
|
|
435
|
+
# @version SketchUp 2023.0
|
|
436
|
+
def stop
|
|
437
|
+
end
|
|
438
|
+
|
|
439
|
+
# Indicates whether the overlay is valid. An overlay becomes invalid after
|
|
440
|
+
# being removed from the model and cannot be reused.
|
|
441
|
+
#
|
|
442
|
+
# @example
|
|
443
|
+
# class ExampleOverlay < Sketchup::Overlay
|
|
444
|
+
# def initialize
|
|
445
|
+
# super('example_inc.my_overlay', 'Example Overlay')
|
|
446
|
+
# end
|
|
447
|
+
# end
|
|
448
|
+
#
|
|
449
|
+
# overlay = ExampleOverlay.new
|
|
450
|
+
# p overlay.valid? # => true
|
|
451
|
+
# Sketchup.active_model.overlays.add(overlay)
|
|
452
|
+
# p overlay.valid? # => true
|
|
453
|
+
#
|
|
454
|
+
# Sketchup.active_model.overlays.remove(overlay)
|
|
455
|
+
# p overlay.valid? # => false
|
|
456
|
+
#
|
|
457
|
+
# @return [Boolean]
|
|
458
|
+
#
|
|
459
|
+
# @version SketchUp 2023.0
|
|
460
|
+
def valid?
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
end
|