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,683 +1,791 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
2
|
-
# License:: The MIT License (MIT)
|
|
3
|
-
|
|
4
|
-
# The UI module contains a number of methods for creating simple UI elements
|
|
5
|
-
# from a SketchUp Ruby script.
|
|
6
|
-
#
|
|
7
|
-
# @version SketchUp 6.0
|
|
8
|
-
module UI
|
|
9
|
-
|
|
10
|
-
# Class Methods
|
|
11
|
-
|
|
12
|
-
# The add_context_menu_handler method is used to register a block of code with
|
|
13
|
-
# SketchUp that will be called when a context menu is to be displayed. The
|
|
14
|
-
# context menu handler can then display the context menu with the items that
|
|
15
|
-
# you have added.
|
|
16
|
-
#
|
|
17
|
-
# Be careful with what you do in a context menu handler. If you perform an
|
|
18
|
-
# operation takes take a long time, such as traversing the model or selection
|
|
19
|
-
# in a large model it will delay the menu.
|
|
20
|
-
#
|
|
21
|
-
# See the contextmenu.rb script in the Plugins/examples directory for an
|
|
22
|
-
# example.
|
|
23
|
-
#
|
|
24
|
-
# @example
|
|
25
|
-
# # Right click on anything to see a Hello World item.
|
|
26
|
-
# UI.add_context_menu_handler do |context_menu|
|
|
27
|
-
# context_menu.add_item("Hello World") {
|
|
28
|
-
# UI.messagebox("Hello world")
|
|
29
|
-
# }
|
|
30
|
-
# end
|
|
31
|
-
#
|
|
32
|
-
# @return [Integer] the number of context handlers that are
|
|
33
|
-
# registered
|
|
34
|
-
#
|
|
35
|
-
# @version SketchUp 6.0
|
|
36
|
-
#
|
|
37
|
-
# @yield [menu] A block of code that takes a menu as its only as its
|
|
38
|
-
# only argument.
|
|
39
|
-
def self.add_context_menu_handler
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# The beep method plays a system beep sound.
|
|
43
|
-
#
|
|
44
|
-
# The beep method does not accept any arguments nor return any values.
|
|
45
|
-
#
|
|
46
|
-
# @example
|
|
47
|
-
# UI.beep
|
|
48
|
-
#
|
|
49
|
-
# @return [nil]
|
|
50
|
-
#
|
|
51
|
-
# @version SketchUp 6.0
|
|
52
|
-
def self.beep
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
# The create_cursor method is used to create a cursor from an image file at
|
|
56
|
-
# the specified location. This must be called from within a custom
|
|
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
|
-
#
|
|
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
|
-
# @example
|
|
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
|
-
#
|
|
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
|
-
|
|
415
|
-
|
|
416
|
-
#
|
|
417
|
-
#
|
|
418
|
-
#
|
|
419
|
-
#
|
|
420
|
-
#
|
|
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
|
-
|
|
465
|
-
|
|
466
|
-
#
|
|
467
|
-
#
|
|
468
|
-
#
|
|
469
|
-
# @
|
|
470
|
-
#
|
|
471
|
-
#
|
|
472
|
-
#
|
|
473
|
-
#
|
|
474
|
-
#
|
|
475
|
-
#
|
|
476
|
-
#
|
|
477
|
-
#
|
|
478
|
-
#
|
|
479
|
-
#
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
#
|
|
484
|
-
#
|
|
485
|
-
#
|
|
486
|
-
#
|
|
487
|
-
#
|
|
488
|
-
#
|
|
489
|
-
#
|
|
490
|
-
#
|
|
491
|
-
#
|
|
492
|
-
#
|
|
493
|
-
#
|
|
494
|
-
#
|
|
495
|
-
#
|
|
496
|
-
#
|
|
497
|
-
#
|
|
498
|
-
#
|
|
499
|
-
#
|
|
500
|
-
#
|
|
501
|
-
#
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
#
|
|
506
|
-
#
|
|
507
|
-
#
|
|
508
|
-
#
|
|
509
|
-
#
|
|
510
|
-
# @
|
|
511
|
-
#
|
|
512
|
-
#
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
#
|
|
517
|
-
#
|
|
518
|
-
#
|
|
519
|
-
# @
|
|
520
|
-
#
|
|
521
|
-
#
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
#
|
|
526
|
-
#
|
|
527
|
-
#
|
|
528
|
-
#
|
|
529
|
-
#
|
|
530
|
-
#
|
|
531
|
-
#
|
|
532
|
-
#
|
|
533
|
-
#
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
#
|
|
538
|
-
#
|
|
539
|
-
#
|
|
540
|
-
# @
|
|
541
|
-
#
|
|
542
|
-
#
|
|
543
|
-
#
|
|
544
|
-
#
|
|
545
|
-
# @param [
|
|
546
|
-
# The
|
|
547
|
-
#
|
|
548
|
-
#
|
|
549
|
-
#
|
|
550
|
-
#
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
#
|
|
555
|
-
#
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
#
|
|
560
|
-
#
|
|
561
|
-
#
|
|
562
|
-
#
|
|
563
|
-
#
|
|
564
|
-
# @
|
|
565
|
-
#
|
|
566
|
-
#
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
#
|
|
571
|
-
#
|
|
572
|
-
#
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
#
|
|
577
|
-
#
|
|
578
|
-
#
|
|
579
|
-
#
|
|
580
|
-
#
|
|
581
|
-
#
|
|
582
|
-
#
|
|
583
|
-
#
|
|
584
|
-
#
|
|
585
|
-
#
|
|
586
|
-
#
|
|
587
|
-
#
|
|
588
|
-
#
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
#
|
|
594
|
-
#
|
|
595
|
-
#
|
|
596
|
-
#
|
|
597
|
-
#
|
|
598
|
-
#
|
|
599
|
-
#
|
|
600
|
-
#
|
|
601
|
-
#
|
|
602
|
-
#
|
|
603
|
-
#
|
|
604
|
-
#
|
|
605
|
-
#
|
|
606
|
-
# @
|
|
607
|
-
#
|
|
608
|
-
#
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
#
|
|
613
|
-
#
|
|
614
|
-
#
|
|
615
|
-
# @
|
|
616
|
-
#
|
|
617
|
-
#
|
|
618
|
-
#
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
#
|
|
625
|
-
#
|
|
626
|
-
#
|
|
627
|
-
#
|
|
628
|
-
#
|
|
629
|
-
#
|
|
630
|
-
#
|
|
631
|
-
#
|
|
632
|
-
# @
|
|
633
|
-
#
|
|
634
|
-
#
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
#
|
|
639
|
-
#
|
|
640
|
-
#
|
|
641
|
-
# @
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
#
|
|
646
|
-
#
|
|
647
|
-
#
|
|
648
|
-
#
|
|
649
|
-
#
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
#
|
|
654
|
-
#
|
|
655
|
-
#
|
|
656
|
-
#
|
|
657
|
-
#
|
|
658
|
-
#
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
#
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
#
|
|
667
|
-
#
|
|
668
|
-
#
|
|
669
|
-
#
|
|
670
|
-
#
|
|
671
|
-
#
|
|
672
|
-
#
|
|
673
|
-
#
|
|
674
|
-
#
|
|
675
|
-
#
|
|
676
|
-
#
|
|
677
|
-
#
|
|
678
|
-
#
|
|
679
|
-
#
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
|
+
# License:: The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
# The UI module contains a number of methods for creating simple UI elements
|
|
5
|
+
# from a SketchUp Ruby script.
|
|
6
|
+
#
|
|
7
|
+
# @version SketchUp 6.0
|
|
8
|
+
module UI
|
|
9
|
+
|
|
10
|
+
# Class Methods
|
|
11
|
+
|
|
12
|
+
# The add_context_menu_handler method is used to register a block of code with
|
|
13
|
+
# SketchUp that will be called when a context menu is to be displayed. The
|
|
14
|
+
# context menu handler can then display the context menu with the items that
|
|
15
|
+
# you have added.
|
|
16
|
+
#
|
|
17
|
+
# Be careful with what you do in a context menu handler. If you perform an
|
|
18
|
+
# operation takes take a long time, such as traversing the model or selection
|
|
19
|
+
# in a large model it will delay the menu.
|
|
20
|
+
#
|
|
21
|
+
# See the contextmenu.rb script in the Plugins/examples directory for an
|
|
22
|
+
# example.
|
|
23
|
+
#
|
|
24
|
+
# @example
|
|
25
|
+
# # Right click on anything to see a Hello World item.
|
|
26
|
+
# UI.add_context_menu_handler do |context_menu|
|
|
27
|
+
# context_menu.add_item("Hello World") {
|
|
28
|
+
# UI.messagebox("Hello world")
|
|
29
|
+
# }
|
|
30
|
+
# end
|
|
31
|
+
#
|
|
32
|
+
# @return [Integer] the number of context handlers that are
|
|
33
|
+
# registered
|
|
34
|
+
#
|
|
35
|
+
# @version SketchUp 6.0
|
|
36
|
+
#
|
|
37
|
+
# @yield [menu] A block of code that takes a menu as its only as its
|
|
38
|
+
# only argument.
|
|
39
|
+
def self.add_context_menu_handler
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# The beep method plays a system beep sound.
|
|
43
|
+
#
|
|
44
|
+
# The beep method does not accept any arguments nor return any values.
|
|
45
|
+
#
|
|
46
|
+
# @example
|
|
47
|
+
# UI.beep
|
|
48
|
+
#
|
|
49
|
+
# @return [nil]
|
|
50
|
+
#
|
|
51
|
+
# @version SketchUp 6.0
|
|
52
|
+
def self.beep
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# The {.create_cursor} method is used to create a cursor from an image file at
|
|
56
|
+
# the specified location. This must be called from within a custom
|
|
57
|
+
# tool. See the {Sketchup::Tool} documentation for a complete example.
|
|
58
|
+
#
|
|
59
|
+
# The size of the cursor images should be 32x32 pixels. Any size different
|
|
60
|
+
# from that will be scaled using the shrink-to-fit policy.
|
|
61
|
+
#
|
|
62
|
+
# The coordinates for the cursor's hotspot are based from it's top left corner, starting at (0, 0).
|
|
63
|
+
# For example, a value of (hot_x, hot_y) = (5, 10) would identify the hotpoint
|
|
64
|
+
# of the cursor at 5 pixels from the left edge of your cursor image and 10
|
|
65
|
+
# pixels from the top edge of your cursor image.
|
|
66
|
+
#
|
|
67
|
+
# @bug On macOS raster cursors are always displayed at 24x24.
|
|
68
|
+
#
|
|
69
|
+
# @bug In SketchUp 2023.1 on Mac provided an incorrect hotspot location. The hotspot was scaled by
|
|
70
|
+
# a factor of 32.0/24.0. If a hotspot position was greater than 24, the cursor would not display.
|
|
71
|
+
#
|
|
72
|
+
# @example
|
|
73
|
+
# class ExampleTool
|
|
74
|
+
# def initialize
|
|
75
|
+
# @cursor_id = nil
|
|
76
|
+
# # Load vector cursor format depending on platform.
|
|
77
|
+
# ext = Sketchup.platform == :platform_win ? 'svg' : 'pdf'
|
|
78
|
+
# cursor_path = File.join(__dir__, "cursor.#{ext}")
|
|
79
|
+
# @cursor_id = UI.create_cursor(cursor_path, 4, 6)
|
|
80
|
+
# end
|
|
81
|
+
#
|
|
82
|
+
# def onSetCursor
|
|
83
|
+
# UI.set_cursor(@cursor_id)
|
|
84
|
+
# end
|
|
85
|
+
# end
|
|
86
|
+
#
|
|
87
|
+
# @note Since SketchUp 2016 it is possible to provide vector images for the cursors.
|
|
88
|
+
# SVG format for Windows and PDF format for macOS. This is the recommended format
|
|
89
|
+
# to use since it will scale well with different DPI scaling.
|
|
90
|
+
#
|
|
91
|
+
# @note Because the image is never released, avoid creating new cursors for the same image for any
|
|
92
|
+
# given tool. Cache it and reuse it.
|
|
93
|
+
#
|
|
94
|
+
# @param [String] path
|
|
95
|
+
# File path to an image.
|
|
96
|
+
#
|
|
97
|
+
# @param [Integer] hot_x
|
|
98
|
+
# The x-coordinate of the "hotpoint" of the cursor, computed from the left edge of your cursor
|
|
99
|
+
# image.
|
|
100
|
+
#
|
|
101
|
+
# @param [Integer] hot_y
|
|
102
|
+
# The y-coordinate of the "hotpoint" of the cursor, computed from the top edge of your cursor
|
|
103
|
+
# image.
|
|
104
|
+
#
|
|
105
|
+
# @raise [RangeError] if @param hot_x or @param hot_y are negative or larger than the max value of
|
|
106
|
+
# an Integer.
|
|
107
|
+
#
|
|
108
|
+
# @return [Integer] Id associated with the cursor.
|
|
109
|
+
# Use this with {UI.set_cursor} in {Sketchup::Tool#onSetCursor}.
|
|
110
|
+
#
|
|
111
|
+
# @see UI.set_cursor
|
|
112
|
+
#
|
|
113
|
+
# @see Sketchup::Tool#onSetCursor
|
|
114
|
+
#
|
|
115
|
+
# @version SketchUp 6.0
|
|
116
|
+
def self.create_cursor(path, hot_x, hot_y)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Returns the plain text available on the clipboard, if there is any.
|
|
120
|
+
#
|
|
121
|
+
# @example
|
|
122
|
+
# text = UI.get_clipboard_data
|
|
123
|
+
#
|
|
124
|
+
# @return [String, nil]
|
|
125
|
+
#
|
|
126
|
+
# @version SketchUp 2023.1
|
|
127
|
+
def self.get_clipboard_data
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Creates a dialog box for inputting user information. The dialog box contains
|
|
131
|
+
# input fields with static text prompts, optional default values, optional
|
|
132
|
+
# drop down selections, and optional title.
|
|
133
|
+
#
|
|
134
|
+
# You can also use this method to display drop down lists of options, by
|
|
135
|
+
# passing an optional param.
|
|
136
|
+
#
|
|
137
|
+
# @example
|
|
138
|
+
# # With three params, it shows all text boxes:
|
|
139
|
+
# prompts = ["What is your Name?", "What is your Age?", "Gender"]
|
|
140
|
+
# defaults = ["Enter name", "", "Male"]
|
|
141
|
+
# input = UI.inputbox(prompts, defaults, "Tell me about yourself.")
|
|
142
|
+
#
|
|
143
|
+
# # With four params, it shows a drop down box for prompts that have
|
|
144
|
+
# # pipe-delimited lists of options. In this case, the Gender prompt
|
|
145
|
+
# # is a drop down instead of a text box.
|
|
146
|
+
# prompts = ["What is your Name?", "What is your Age?", "Gender"]
|
|
147
|
+
# defaults = ["Enter name", "", "Male"]
|
|
148
|
+
# list = ["", "", "Male|Female"]
|
|
149
|
+
# input = UI.inputbox(prompts, defaults, list, "Tell me about yourself.")
|
|
150
|
+
#
|
|
151
|
+
# @note The method intelligently handles various types for default values and lists, automatically
|
|
152
|
+
# attempting to convert provided inputs to match the type of the default value. This ensures
|
|
153
|
+
# consistency in data types throughout the operation.
|
|
154
|
+
#
|
|
155
|
+
# @overload inputbox(prompts, defaults, title)
|
|
156
|
+
#
|
|
157
|
+
# @param [Array<String>] prompts
|
|
158
|
+
# An array of prompt names appearing in the input box
|
|
159
|
+
# adjacent to input fields.
|
|
160
|
+
# @param [Array<String>] defaults
|
|
161
|
+
# An array of default values for the input
|
|
162
|
+
# fields.
|
|
163
|
+
# @param [String] title
|
|
164
|
+
# The title for the input box.
|
|
165
|
+
#
|
|
166
|
+
# @overload inputbox(prompts, defaults, list, title)
|
|
167
|
+
#
|
|
168
|
+
# @param [Array<String>] prompts
|
|
169
|
+
# An array of prompt names appearing in the input box
|
|
170
|
+
# adjacent to input fields.
|
|
171
|
+
# @param [Array<String>] defaults
|
|
172
|
+
# An array of default values for the input
|
|
173
|
+
# fields.
|
|
174
|
+
# @param [String, Array<String>] list
|
|
175
|
+
# An array containing pipe-separated strings of options.
|
|
176
|
+
# @param [String] title
|
|
177
|
+
# The title for the input box.
|
|
178
|
+
#
|
|
179
|
+
# @return [Array<String>, false] An array of returned values if the user did
|
|
180
|
+
# not cancel the dialog. If the user canceled the
|
|
181
|
+
# dialog, false is returned. The returned values in the
|
|
182
|
+
# array will be in the same order as the input fields.
|
|
183
|
+
#
|
|
184
|
+
# @version SketchUp 6.0
|
|
185
|
+
def self.inputbox(*args)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# The {.inspector_names} method is used to returns the names of all the
|
|
189
|
+
# inspectors. Inspectors are another name for the various floating dialog
|
|
190
|
+
# windows that you can activate from withing SketchUp, such as the Materials
|
|
191
|
+
# window.
|
|
192
|
+
#
|
|
193
|
+
# @bug Prior to SketchUp 2022.0 "EntityInfo" was not listed.
|
|
194
|
+
#
|
|
195
|
+
# @example
|
|
196
|
+
# inspectors = UI.inspector_names
|
|
197
|
+
#
|
|
198
|
+
# @return [Array<String>] an array of strings containing the names
|
|
199
|
+
# of inspectors.
|
|
200
|
+
#
|
|
201
|
+
# @version SketchUp 6.0
|
|
202
|
+
def self.inspector_names
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# The {.menu} method retrieves a SketchUp's menu object with a given name. This
|
|
206
|
+
# is the first step toward adding your own custom items to the bottom
|
|
207
|
+
# of SketchUp's menus.
|
|
208
|
+
#
|
|
209
|
+
# Valid menu names are: +'File'+, +'Edit'+, +'View'+, +'Camera'+, +'Draw'+,
|
|
210
|
+
# +'Tools'+, +'Window'+, +'Extensions'+, +'Help'+ and +'Developer'+.
|
|
211
|
+
#
|
|
212
|
+
# @bug In versions prior to SketchUp 2018 this would crash if you passed an
|
|
213
|
+
# empty string.
|
|
214
|
+
#
|
|
215
|
+
# @example
|
|
216
|
+
# tool_menu = UI.menu("Tools")
|
|
217
|
+
# tool_menu.add_item("Cheese Tool") {
|
|
218
|
+
# UI.messagebox("Cheese activated.")
|
|
219
|
+
# }
|
|
220
|
+
#
|
|
221
|
+
# @note The +'Extensions'+ menu was named +'Plugins'+ prior to SketchUp 2015.
|
|
222
|
+
# For backward compatibility +'Plugins'+ still works.
|
|
223
|
+
#
|
|
224
|
+
# @note +'Developer'+ menu was added with SketchUp 2021.1.
|
|
225
|
+
#
|
|
226
|
+
# @param [String] menu_name
|
|
227
|
+
# The name of a supported menu.
|
|
228
|
+
#
|
|
229
|
+
# @return [Sketchup::Menu]
|
|
230
|
+
#
|
|
231
|
+
# @version SketchUp 6.0
|
|
232
|
+
def self.menu(menu_name = "Extensions")
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Creates a dialog box containing static text with a series of buttons for
|
|
236
|
+
# the user to choose from.
|
|
237
|
+
#
|
|
238
|
+
# Valid message box types are:
|
|
239
|
+
# - +MB_OK+ - Contains an OK button.
|
|
240
|
+
# - +MB_OKCANCEL+ - Contains OK and Cancel buttons.
|
|
241
|
+
# - +MB_ABORTRETRYIGNORE+ - Contains Abort, Retry, and Ignore buttons.
|
|
242
|
+
# - +MB_YESNOCANCEL+ - Contains Yes, No, and Cancel buttons.
|
|
243
|
+
# - +MB_YESNO+ - Contains Yes and No buttons.
|
|
244
|
+
# - +MB_RETRYCANCEL+ - Contains Retry and Cancel buttons.
|
|
245
|
+
# - +MB_MULTILINE+ - Contains and OK button.
|
|
246
|
+
#
|
|
247
|
+
# Return values can be any of following:
|
|
248
|
+
# - +IDOK+
|
|
249
|
+
# - +IDCANCEL+
|
|
250
|
+
# - +IDABORT+
|
|
251
|
+
# - +IDRETRY+
|
|
252
|
+
# - +IDIGNORE+
|
|
253
|
+
# - +IDYES+
|
|
254
|
+
# - +IDNO+
|
|
255
|
+
#
|
|
256
|
+
# In an +MB_MULTILINE+ message box, the message is displayed as a multi-line
|
|
257
|
+
# message with scrollbars (as needed). +MB_MULTILNE+ also allows a third string
|
|
258
|
+
# argument that will be used as the title for the messagebox.
|
|
259
|
+
#
|
|
260
|
+
# @example
|
|
261
|
+
# result = UI.messagebox('Do you like cheese?', MB_YESNO)
|
|
262
|
+
# if result == IDYES
|
|
263
|
+
# puts 'SketchUp likes cheese too!'
|
|
264
|
+
# end
|
|
265
|
+
#
|
|
266
|
+
# @param [String] message
|
|
267
|
+
# The message that you want to display.
|
|
268
|
+
#
|
|
269
|
+
# @param [Integer] type
|
|
270
|
+
# The message box type, which will be a constant from
|
|
271
|
+
# the list in the method comments.
|
|
272
|
+
#
|
|
273
|
+
# @return [Integer] A number corresponding to what the user selected.
|
|
274
|
+
#
|
|
275
|
+
# @version SketchUp 6.0
|
|
276
|
+
def self.messagebox(message, type = MB_OK)
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# The model_info_pages method is used to returns the names of all the
|
|
280
|
+
# available model info pages. These include UI windows such as Components,
|
|
281
|
+
# Credits, and Units.
|
|
282
|
+
#
|
|
283
|
+
# @example
|
|
284
|
+
# mypages = UI.model_info_pages
|
|
285
|
+
#
|
|
286
|
+
# @return [Array<String>] an array of strings containing the names of
|
|
287
|
+
# model info pages.
|
|
288
|
+
#
|
|
289
|
+
# @version SketchUp 6.0
|
|
290
|
+
def self.model_info_pages
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# The {.openURL} method is used to open the default browser to a URL.
|
|
294
|
+
#
|
|
295
|
+
# @bug Before SketchUp 2019.3 the mac version would URL encode the given URL.
|
|
296
|
+
# This could inadvertently mangle some URLs, if for example if they had
|
|
297
|
+
# URL fragments (# character).
|
|
298
|
+
# The Windows version would not. As of SketchUp 2019.3 both platforms do
|
|
299
|
+
# not perform URL encoding and the API user is expected to provide a valid
|
|
300
|
+
# URL.
|
|
301
|
+
#
|
|
302
|
+
# @example Open plain(non-encoded) URL
|
|
303
|
+
# status = UI.openURL("https://www.sketchup.com")
|
|
304
|
+
#
|
|
305
|
+
# @example Open encoded URL
|
|
306
|
+
# status = UI.openURL("https://example.com/api?query=test&test=test")
|
|
307
|
+
#
|
|
308
|
+
# @example Open a local URL
|
|
309
|
+
# # To open a local file one must add file:/// in front of the path of the file to make it an
|
|
310
|
+
# # URL.
|
|
311
|
+
# status = UI.openURL("file:///path/to/the/file/file.skp")
|
|
312
|
+
#
|
|
313
|
+
# @param [String] url
|
|
314
|
+
#
|
|
315
|
+
# @return [Boolean]
|
|
316
|
+
#
|
|
317
|
+
# @version SketchUp 6.0
|
|
318
|
+
def self.openURL(url)
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# The {.openpanel} method is used to display the Open dialog box. The path that
|
|
322
|
+
# is returned can then be used inside code to open a text or image file.
|
|
323
|
+
# See the standard Ruby class File for examples of reading and writing from
|
|
324
|
+
# disk.
|
|
325
|
+
#
|
|
326
|
+
# @bug Fixed in SketchUp 2014: Wildcards were not working properly from SU7 to
|
|
327
|
+
# SU2013. Wildcard filters did not populate the file type dropdown. The filter
|
|
328
|
+
# string would be shown in the file name field with '*' characters converted to
|
|
329
|
+
# '_' characters. Note, the format of a wildcard filter string has been changed.
|
|
330
|
+
# See the description of the filename parameter below for details.
|
|
331
|
+
#
|
|
332
|
+
# @example
|
|
333
|
+
# chosen_image = UI.openpanel("Open SKP File", "c:/", "model.skp")
|
|
334
|
+
# chosen_image = UI.openpanel("Open Image File", "c:/", "Image Files|*.jpg;*.png;||")
|
|
335
|
+
# chosen_image = UI.openpanel("Open CAD File", "c:/", "DXF|*.dxf|DWG|*.dwg||")
|
|
336
|
+
#
|
|
337
|
+
# @param [String] title
|
|
338
|
+
# The title to apply to the open dialog box.
|
|
339
|
+
#
|
|
340
|
+
# @param [String] directory
|
|
341
|
+
# The default directory for the open panel.
|
|
342
|
+
#
|
|
343
|
+
# @param [String] filename
|
|
344
|
+
# The default filename for the open panel. On Windows, you
|
|
345
|
+
# can alternatively pass a wildcard filter using this
|
|
346
|
+
# format: UIname|wildcard||. Additional filter dropdown
|
|
347
|
+
# list items can be added by adding additional pairs of
|
|
348
|
+
# filter name and filter like this:
|
|
349
|
+
# UIname1|wildcard1|UIname2|wildcard2||.
|
|
350
|
+
# Also multiple wildcard filters can be combined into a
|
|
351
|
+
# single line using a semicolon-separated list in the
|
|
352
|
+
# filter field: ui_name|wildcard1;wildcard2||.
|
|
353
|
+
#
|
|
354
|
+
# @return [String] the full path and name of the file selected, or
|
|
355
|
+
# nil if the dialog was canceled.
|
|
356
|
+
#
|
|
357
|
+
# @see UI.savepanel
|
|
358
|
+
#
|
|
359
|
+
# @version SketchUp 6.0
|
|
360
|
+
def self.openpanel(title, directory, filename)
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# The play_sound method is used to play a sound file. Valid sound files include
|
|
364
|
+
# .wav and .mp3 files on the Mac and .wav files on the PC.
|
|
365
|
+
#
|
|
366
|
+
# @example
|
|
367
|
+
# UI.play_sound "Plugins/mediadiscussion.wav"
|
|
368
|
+
#
|
|
369
|
+
# @param [String] filename
|
|
370
|
+
# the relative path to the filename from the SketchUp
|
|
371
|
+
# install directory, or an absolute path to the file. (See
|
|
372
|
+
# Sketchup.find_support_file for a way to search for a
|
|
373
|
+
# specific file.)
|
|
374
|
+
#
|
|
375
|
+
# @return [nil]
|
|
376
|
+
#
|
|
377
|
+
# @version SketchUp 6.0
|
|
378
|
+
def self.play_sound(filename)
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
# The preferences_pages method is used to returns the names of all the
|
|
382
|
+
# preferences pages. These include windows like Templates.
|
|
383
|
+
#
|
|
384
|
+
# [SketchUp 2017] <code>"Extensions"</code> page was removed.
|
|
385
|
+
#
|
|
386
|
+
# @example
|
|
387
|
+
# prefs = UI.preferences_pages
|
|
388
|
+
#
|
|
389
|
+
# @return [Array<String>] an array of strings containing the names
|
|
390
|
+
# of preference pages.
|
|
391
|
+
#
|
|
392
|
+
# @version SketchUp 6.0
|
|
393
|
+
def self.preferences_pages
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
# Tells SketchUp to refresh all inspectors such as the Component Browser and
|
|
397
|
+
# the Outliner. This is useful when you need to manually force a refresh after
|
|
398
|
+
# you've made a change to the document via Ruby. Generally, SketchUp will keep
|
|
399
|
+
# these in sync for you, but occasionally it does not, such as when
|
|
400
|
+
# model.start_operation has disabled UI updates.
|
|
401
|
+
#
|
|
402
|
+
# @example
|
|
403
|
+
# UI.refresh_inspectors
|
|
404
|
+
#
|
|
405
|
+
# @return [nil]
|
|
406
|
+
#
|
|
407
|
+
# @version SketchUp 7.0
|
|
408
|
+
def self.refresh_inspectors
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# Tells SketchUp to refresh all floating toolbars. This is useful when you need
|
|
412
|
+
# to manually force a refresh after you've made a change to the document via
|
|
413
|
+
# Ruby. Generally, SketchUp will keep these in sync for you, but occasionally
|
|
414
|
+
# it does not, such as when {Sketchup::Model#start_operation} has disabled UI
|
|
415
|
+
# updates.
|
|
416
|
+
# This only affects macOS, on Windows the toolbars are always refreshing.
|
|
417
|
+
#
|
|
418
|
+
# @example
|
|
419
|
+
# UI.refresh_toolbars
|
|
420
|
+
#
|
|
421
|
+
# @return [nil]
|
|
422
|
+
#
|
|
423
|
+
# @version SketchUp 2018
|
|
424
|
+
def self.refresh_toolbars
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
# The {.savepanel} method is used to display the Save dialog box. The path that
|
|
428
|
+
# is returned can then be used inside code to save out a text or image file.
|
|
429
|
+
# See the standard Ruby class File for examples of reading and writing from
|
|
430
|
+
# disk.
|
|
431
|
+
#
|
|
432
|
+
# @bug Fixed in SketchUp 2014: Wildcards were not working properly from SU7 to
|
|
433
|
+
# SU2013. Semicolon-separated lists of wildcards did not populate the file type
|
|
434
|
+
# dropdown. The filter string would be shown in the file name field with '*'
|
|
435
|
+
# characters converted to '_' characters.
|
|
436
|
+
#
|
|
437
|
+
# @bug Fixed in SketchUp 2022.0: if +filename+ begins with a +*+ it crashes
|
|
438
|
+
# on macOS.
|
|
439
|
+
#
|
|
440
|
+
# @example
|
|
441
|
+
# path_to_save_to = UI.savepanel("Save Image File", "c:\\", "Shapes.jpg")
|
|
442
|
+
#
|
|
443
|
+
# @param [String] title
|
|
444
|
+
# The title to apply to the save dialog box.
|
|
445
|
+
#
|
|
446
|
+
# @param [String] directory
|
|
447
|
+
# The default directory for the save panel.
|
|
448
|
+
#
|
|
449
|
+
# @param [String] filename
|
|
450
|
+
# The default filename for the save panel. On Windows, you
|
|
451
|
+
# can alternatively pass a mask, like "*.txt", to have all
|
|
452
|
+
# the .txt files display. If you want multiple file types
|
|
453
|
+
# to display, you can supply multiple masks for the
|
|
454
|
+
# filename and separate them with a semicolon, like this:
|
|
455
|
+
# "*.txt;*.doc".
|
|
456
|
+
#
|
|
457
|
+
# @return [String] the full path and name of the file
|
|
458
|
+
# selected or nil if the dialog was canceled.
|
|
459
|
+
#
|
|
460
|
+
# @see UI.openpanel
|
|
461
|
+
#
|
|
462
|
+
# @version SketchUp 6.0
|
|
463
|
+
def self.savepanel(title, directory, filename)
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
# Returns the scaling factor SketchUp uses on high DPI monitors. Useful for
|
|
467
|
+
# things like {Sketchup::View#draw2d}.
|
|
468
|
+
#
|
|
469
|
+
# @example Per Monitor DPI
|
|
470
|
+
# # Scale a set of points representing 2d screen points to account for high
|
|
471
|
+
# # DPI monitors.
|
|
472
|
+
# points2d = [
|
|
473
|
+
# Geom::Point3d.new(0, 0, 0),
|
|
474
|
+
# Geom::Point3d.new(8, 0, 0),
|
|
475
|
+
# Geom::Point3d.new(8, 4, 0),
|
|
476
|
+
# Geom::Point3d.new(0, 4, 0),
|
|
477
|
+
# ]
|
|
478
|
+
# scale = UI.scale_factor(Sketchup.active_model.active_view)
|
|
479
|
+
# tr = Geom::Transformation.scaling(UI.scale_factor)
|
|
480
|
+
# points2d.each { |point| point.transform!(tr) }
|
|
481
|
+
#
|
|
482
|
+
# @example Deprecated legacy API
|
|
483
|
+
# # Scale a set of points representing 2d screen points to account for high
|
|
484
|
+
# # DPI monitors.
|
|
485
|
+
# points2d = [
|
|
486
|
+
# Geom::Point3d.new(0, 0, 0),
|
|
487
|
+
# Geom::Point3d.new(8, 0, 0),
|
|
488
|
+
# Geom::Point3d.new(8, 4, 0),
|
|
489
|
+
# Geom::Point3d.new(0, 4, 0)
|
|
490
|
+
# ]
|
|
491
|
+
# tr = Geom::Transformation.scaling(UI.scale_factor)
|
|
492
|
+
# points2d.each { |point| point.transform!(tr) }
|
|
493
|
+
#
|
|
494
|
+
# @note SU2017M0 will automatically scale up line width and text size, but will
|
|
495
|
+
# not scale up the points provided to {Sketchup::View#draw2d}.
|
|
496
|
+
#
|
|
497
|
+
# @overload scale_factor
|
|
498
|
+
#
|
|
499
|
+
# @version SketchUp 2017
|
|
500
|
+
# @deprecated Use the overload that takes a {Sketchup::View} instead.
|
|
501
|
+
# This returns a scale factor determined when SketchUp starts from the
|
|
502
|
+
# monitor it started on. It does not change for the duration of the
|
|
503
|
+
# application session.
|
|
504
|
+
#
|
|
505
|
+
# @overload scale_factor(view)
|
|
506
|
+
#
|
|
507
|
+
# @version SketchUp 2025.0
|
|
508
|
+
# @param [Sketchup::View] view
|
|
509
|
+
#
|
|
510
|
+
# @return [Float]
|
|
511
|
+
#
|
|
512
|
+
# @version SketchUp 2017
|
|
513
|
+
def self.scale_factor(*args)
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
# The {.select_directory} method is used to display the OS dialog for selecting
|
|
517
|
+
# one or several directories from the file system.
|
|
518
|
+
#
|
|
519
|
+
# @example
|
|
520
|
+
# # Default title and folder:
|
|
521
|
+
# chosen_folder = UI.select_directory
|
|
522
|
+
#
|
|
523
|
+
# # Custom dialog title:
|
|
524
|
+
# chosen_folder = UI.select_directory(title: "Select Image Directory")
|
|
525
|
+
#
|
|
526
|
+
# # Force a start folder:
|
|
527
|
+
# chosen_folder = UI.select_directory(directory: "C:/images")
|
|
528
|
+
#
|
|
529
|
+
# # Allow multiple items to the selected:
|
|
530
|
+
# chosen_folder = UI.select_directory(select_multiple: true)
|
|
531
|
+
#
|
|
532
|
+
# # Custom dialog title and force a start folder:
|
|
533
|
+
# chosen_folder = UI.select_directory(
|
|
534
|
+
# title: "Select Image Directory",
|
|
535
|
+
# directory: "C:/images"
|
|
536
|
+
# )
|
|
537
|
+
#
|
|
538
|
+
# @option options [String] :title (nil) The title for the dialog.
|
|
539
|
+
#
|
|
540
|
+
# @option options [String] :directory (nil) Force the starting directory for the dialog. If not specified the last
|
|
541
|
+
# chosen directory will be used.
|
|
542
|
+
#
|
|
543
|
+
# @option options [Boolean] :select_multiple (false) Set to true to allow multiple items to be selected.
|
|
544
|
+
#
|
|
545
|
+
# @param [Hash] options
|
|
546
|
+
# The dialog can be customized by providing a hash or named arguments of
|
|
547
|
+
# options.
|
|
548
|
+
#
|
|
549
|
+
# @return [String, Array<String>, nil] A string with the full path of the
|
|
550
|
+
# directory selected when
|
|
551
|
+
# :select_multiple option is set to
|
|
552
|
+
# false otherwise an array of strings
|
|
553
|
+
# or nil if the user cancelled.
|
|
554
|
+
#
|
|
555
|
+
# @version SketchUp 2015
|
|
556
|
+
def self.select_directory(options = {})
|
|
557
|
+
end
|
|
558
|
+
|
|
559
|
+
# Copies plain text to the clipboard.
|
|
560
|
+
#
|
|
561
|
+
# @example
|
|
562
|
+
# UI.set_clipboard_data('Hello World')
|
|
563
|
+
#
|
|
564
|
+
# @return [Boolean]
|
|
565
|
+
#
|
|
566
|
+
# @version SketchUp 2023.1
|
|
567
|
+
def self.set_clipboard_data(data)
|
|
568
|
+
end
|
|
569
|
+
|
|
570
|
+
# The {.set_cursor} method is used to change the cursor to a new cursor with a
|
|
571
|
+
# given cursor id. See UI.create_cursor and the Tool class for details
|
|
572
|
+
# on creating your own tools with arbitrary cursors.
|
|
573
|
+
#
|
|
574
|
+
# If you call this while a standard SketchUp tool is active, you will not
|
|
575
|
+
# see your custom cursor, as these tools are constantly setting their
|
|
576
|
+
# own cursors to indicate SketchUp's state.
|
|
577
|
+
#
|
|
578
|
+
# @example
|
|
579
|
+
# def onSetCursor
|
|
580
|
+
# UI.set_cursor(cursor_id)
|
|
581
|
+
# end
|
|
582
|
+
#
|
|
583
|
+
# @param [Integer] cursor_id
|
|
584
|
+
# The id of the cursor you want to display.
|
|
585
|
+
#
|
|
586
|
+
# @return [Boolean]
|
|
587
|
+
#
|
|
588
|
+
# @version SketchUp 6.0
|
|
589
|
+
def self.set_cursor(cursor_id)
|
|
590
|
+
end
|
|
591
|
+
|
|
592
|
+
# The set_toolbar_visible method is used to set whether a given toolbar is
|
|
593
|
+
# visible. Note that the toolbars and their names are different on the
|
|
594
|
+
# Mac vs. PC, so be careful and be sure to test when using this method in a
|
|
595
|
+
# cross-platform script.
|
|
596
|
+
#
|
|
597
|
+
# @example
|
|
598
|
+
# status = UI.set_toolbar_visible("Camera", true)
|
|
599
|
+
#
|
|
600
|
+
# @param [String] name
|
|
601
|
+
# The name of a Ruby toolbar.
|
|
602
|
+
#
|
|
603
|
+
# @param [Boolean] visible
|
|
604
|
+
# True to make the toolbar visible, false to hide it.
|
|
605
|
+
#
|
|
606
|
+
# @return [Boolean] true if successful, false if not.
|
|
607
|
+
#
|
|
608
|
+
# @version SketchUp 6.0
|
|
609
|
+
def self.set_toolbar_visible(name, visible)
|
|
610
|
+
end
|
|
611
|
+
|
|
612
|
+
# The +show_extension_manager+ method is used to display the Extension Manager
|
|
613
|
+
# dialog.
|
|
614
|
+
#
|
|
615
|
+
# @example
|
|
616
|
+
# UI.show_extension_manager
|
|
617
|
+
#
|
|
618
|
+
# @return [nil]
|
|
619
|
+
#
|
|
620
|
+
# @version SketchUp 2017
|
|
621
|
+
def self.show_extension_manager
|
|
622
|
+
end
|
|
623
|
+
|
|
624
|
+
# Show the Extension Warehouse dialog inside SketchUp. If an extension UUID is provided
|
|
625
|
+
# the dialog navigates directly to that extension's page. If no UUID is provided it opens
|
|
626
|
+
# the Extension Warehouse home page.
|
|
627
|
+
#
|
|
628
|
+
# @example
|
|
629
|
+
# # Open EW home
|
|
630
|
+
# UI.show_extension_warehouse
|
|
631
|
+
#
|
|
632
|
+
# @example
|
|
633
|
+
# # Open a specific extension by UUID (taken from the EW URL)
|
|
634
|
+
# UI.show_extension_warehouse("a97d22f8-5968-4f43-bcf9-4f322fa7a8cb")
|
|
635
|
+
#
|
|
636
|
+
# @param [String, nil] extension_id
|
|
637
|
+
# Optional Extension Warehouse UUID. If nil or omitted the EW home page is shown.
|
|
638
|
+
#
|
|
639
|
+
# @return [nil]
|
|
640
|
+
#
|
|
641
|
+
# @version SketchUp 2026.1
|
|
642
|
+
def self.show_extension_warehouse(extension_id = nil)
|
|
643
|
+
end
|
|
644
|
+
|
|
645
|
+
# The {.show_inspector} method is used to display the inspector with the given
|
|
646
|
+
# name. You can get the list of valid inspectors with UI.inspector_names.
|
|
647
|
+
#
|
|
648
|
+
# @bug Prior to SketchUp 2022.0 "EntityInfo" was not a supported parameter.
|
|
649
|
+
#
|
|
650
|
+
# @example
|
|
651
|
+
# status = UI.show_inspector("Components")
|
|
652
|
+
#
|
|
653
|
+
# @param [String] name
|
|
654
|
+
# The name of inspector that you want to display.
|
|
655
|
+
#
|
|
656
|
+
# @return [Boolean] true if successful, false if unsuccessful
|
|
657
|
+
#
|
|
658
|
+
# @version SketchUp 6.0
|
|
659
|
+
def self.show_inspector(name)
|
|
660
|
+
end
|
|
661
|
+
|
|
662
|
+
# The {.show_model_info} method is used to display the model info dialog for a
|
|
663
|
+
# specific page. You can get the list of valid page names with {UI.model_info_pages}.
|
|
664
|
+
#
|
|
665
|
+
# [SketchUp 2014] <code>"Classifications"</code> page was added.
|
|
666
|
+
#
|
|
667
|
+
# @bug Until SketchUp 2021.1 SketchUp on Mac didn't display the desired page in,
|
|
668
|
+
# but only selected it in the navigation.
|
|
669
|
+
#
|
|
670
|
+
# @bug Until SketchUp 2021.1 SketchUp on Mac didn't accept English page names on localized builds.
|
|
671
|
+
#
|
|
672
|
+
# @example
|
|
673
|
+
# UI.show_model_info('Credits')
|
|
674
|
+
#
|
|
675
|
+
# @param [String] page_name
|
|
676
|
+
# The name of the model info dialog you want to display.
|
|
677
|
+
#
|
|
678
|
+
# @return [Boolean]
|
|
679
|
+
#
|
|
680
|
+
# @version SketchUp 6.0
|
|
681
|
+
def self.show_model_info(page_name)
|
|
682
|
+
end
|
|
683
|
+
|
|
684
|
+
# The show_preferences method is used to display a SketchUp preferences dialog.
|
|
685
|
+
# You can get the list of valid dialogs with {UI.preferences_pages}.
|
|
686
|
+
#
|
|
687
|
+
# @bug Under OSX this method doesn't currently work.
|
|
688
|
+
#
|
|
689
|
+
# @example
|
|
690
|
+
# status = UI.show_preferences('GraphicsCard')
|
|
691
|
+
#
|
|
692
|
+
# @param [String] page_name
|
|
693
|
+
# The name of the preferences dialog you want to display.
|
|
694
|
+
#
|
|
695
|
+
# @return [Boolean] true
|
|
696
|
+
#
|
|
697
|
+
# @version SketchUp 6.0
|
|
698
|
+
def self.show_preferences(page_name)
|
|
699
|
+
end
|
|
700
|
+
|
|
701
|
+
# The start_timer method is used to start a timer. This is an effective method
|
|
702
|
+
# to create a repeating snippet of code for arbitrary animation.
|
|
703
|
+
#
|
|
704
|
+
# See this blog post for an detailed example of custom animation using timers:
|
|
705
|
+
# http://sketchupapi.blogspot.com/2008/10/animate-yo-cheese.html
|
|
706
|
+
#
|
|
707
|
+
# Note that there is a bug that if you open a modal window in a non-repeating
|
|
708
|
+
# timer the timer will repeat until the window is closed.
|
|
709
|
+
#
|
|
710
|
+
# @example
|
|
711
|
+
# # Beep once after 10 seconds.
|
|
712
|
+
# id = UI.start_timer(10, false) { UI.beep }
|
|
713
|
+
#
|
|
714
|
+
# @param [Numeric] seconds
|
|
715
|
+
# The time in seconds before your code should be called.
|
|
716
|
+
#
|
|
717
|
+
# @param [Boolean] repeat
|
|
718
|
+
# true if you want the timer to repeat, false
|
|
719
|
+
# (or omit) if you do not want it to repeat.
|
|
720
|
+
#
|
|
721
|
+
# @return [Integer] a timer ID
|
|
722
|
+
#
|
|
723
|
+
# @version SketchUp 6.0
|
|
724
|
+
#
|
|
725
|
+
# @yield [procedure] The procedure you want to execute after seconds has
|
|
726
|
+
# expired.
|
|
727
|
+
def self.start_timer(seconds, repeat = false)
|
|
728
|
+
end
|
|
729
|
+
|
|
730
|
+
# The stop_timer method is used to stop a timer based on its id.
|
|
731
|
+
#
|
|
732
|
+
# @example
|
|
733
|
+
# # Stop timer before it triggers.
|
|
734
|
+
# id = UI.start_timer(10) { UI.beep }
|
|
735
|
+
# UI.stop_timer(id)
|
|
736
|
+
#
|
|
737
|
+
# @param [Integer] id
|
|
738
|
+
# The timer id for the timer that you want to stop.
|
|
739
|
+
#
|
|
740
|
+
# @return [nil]
|
|
741
|
+
#
|
|
742
|
+
# @version SketchUp 6.0
|
|
743
|
+
def self.stop_timer(id)
|
|
744
|
+
end
|
|
745
|
+
|
|
746
|
+
# The toolbar method is used to get a Ruby toolbar by name. If the toolbar
|
|
747
|
+
# doesn't exist a new one will be created.
|
|
748
|
+
#
|
|
749
|
+
# @example
|
|
750
|
+
# toolbar = UI.toolbar('Test')
|
|
751
|
+
#
|
|
752
|
+
# @param [String] name
|
|
753
|
+
# The name of the Ruby toolbar.
|
|
754
|
+
#
|
|
755
|
+
# @return [UI::Toolbar] a Toolbar object
|
|
756
|
+
#
|
|
757
|
+
# @version SketchUp 6.0
|
|
758
|
+
def self.toolbar(name)
|
|
759
|
+
end
|
|
760
|
+
|
|
761
|
+
# The toolbar_names method is used to return the name of all the available
|
|
762
|
+
# native toolbars (this differs between PC and Mac). These toolbar names
|
|
763
|
+
# do not include Ruby toolbars.
|
|
764
|
+
#
|
|
765
|
+
# @example
|
|
766
|
+
# names = UI.toolbar_names
|
|
767
|
+
#
|
|
768
|
+
# @return [Array<String>] Array of strings representing toolbar names.
|
|
769
|
+
#
|
|
770
|
+
# @version SketchUp 6.0
|
|
771
|
+
def self.toolbar_names
|
|
772
|
+
end
|
|
773
|
+
|
|
774
|
+
# The toolbar_visible? method is used to determine whether a given toolbar is
|
|
775
|
+
# visible. Note that the toolbars and their names are different on the
|
|
776
|
+
# Mac vs. PC, so be careful and be sure to test when using this method in a
|
|
777
|
+
# cross-platform script.
|
|
778
|
+
#
|
|
779
|
+
# @example
|
|
780
|
+
# status = UI.toolbar_visible?("Camera")
|
|
781
|
+
#
|
|
782
|
+
# @param [String] name
|
|
783
|
+
# The name of a native toolbar.
|
|
784
|
+
#
|
|
785
|
+
# @return [Boolean]
|
|
786
|
+
#
|
|
787
|
+
# @version SketchUp 6.0
|
|
788
|
+
def self.toolbar_visible?(name)
|
|
789
|
+
end
|
|
790
|
+
|
|
791
|
+
end
|