sketchup-api-stubs 0.7.4 → 0.7.8
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 +148 -145
- data/lib/sketchup-api-stubs/stubs/{array.rb → Array.rb} +741 -741
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -318
- 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 +523 -492
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -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 -691
- data/lib/sketchup-api-stubs/stubs/{geom.rb → Geom.rb} +351 -348
- data/lib/sketchup-api-stubs/stubs/{languagehandler.rb → LanguageHandler.rb} +93 -92
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -573
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +698 -411
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +516 -514
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -143
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -349
- 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 -371
- 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 -220
- 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 -204
- 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/SketchUpModel.rb +692 -694
- 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 → Length.rb} +278 -278
- data/lib/sketchup-api-stubs/stubs/{numeric.rb → Numeric.rb} +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -140
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -157
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +286 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -328
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -577
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +619 -562
- 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 -194
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +426 -329
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -72
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -102
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -312
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -38
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +396 -390
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +502 -508
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1205 -1119
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +272 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -544
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +126 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -697
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +292 -285
- 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 -409
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -226
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -190
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +407 -393
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -82
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -303
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -244
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -136
- 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 +112 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -416
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +318 -311
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -141
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -95
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1651 -1638
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -356
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +131 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -770
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +363 -353
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +477 -456
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -44
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +459 -454
- 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 +260 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -57
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -225
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +837 -829
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -154
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -61
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1317 -1301
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
- data/lib/sketchup-api-stubs/stubs/{sketchup.rb → Sketchup.rb} +1360 -1310
- data/lib/sketchup-api-stubs/stubs/{sketchupextension.rb → SketchupExtension.rb} +353 -353
- data/lib/sketchup-api-stubs/stubs/{string.rb → String.rb} +24 -24
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +389 -310
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +496 -356
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -229
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -633
- data/lib/sketchup-api-stubs/stubs/{ui.rb → UI.rb} +683 -667
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +15 -12
@@ -1,1119 +1,1205 @@
|
|
1
|
-
# Copyright:: Copyright
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The Entities class is a
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
# the
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
# entities.
|
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
|
-
# @param [
|
137
|
-
# @param [
|
138
|
-
# @param [
|
139
|
-
# @
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
# @param [
|
147
|
-
# @param [
|
148
|
-
# @param [
|
149
|
-
# @param [
|
150
|
-
# @
|
151
|
-
#
|
152
|
-
#
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
# @param [Geom::
|
171
|
-
# A
|
172
|
-
#
|
173
|
-
# @param [
|
174
|
-
#
|
175
|
-
#
|
176
|
-
# @param [
|
177
|
-
# The
|
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
|
-
# # From
|
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
|
-
# the
|
313
|
-
#
|
314
|
-
#
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
318
|
-
# @
|
319
|
-
#
|
320
|
-
#
|
321
|
-
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
#
|
325
|
-
#
|
326
|
-
#
|
327
|
-
#
|
328
|
-
#
|
329
|
-
#
|
330
|
-
# @param [
|
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
|
-
#
|
546
|
-
#
|
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
|
-
# entities =
|
631
|
-
#
|
632
|
-
#
|
633
|
-
#
|
634
|
-
#
|
635
|
-
#
|
636
|
-
#
|
637
|
-
#
|
638
|
-
#
|
639
|
-
#
|
640
|
-
# @param [Geom::
|
641
|
-
#
|
642
|
-
#
|
643
|
-
# @param [
|
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
|
-
#
|
684
|
-
#
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
#
|
689
|
-
#
|
690
|
-
# @
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
#
|
695
|
-
#
|
696
|
-
#
|
697
|
-
#
|
698
|
-
#
|
699
|
-
#
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
#
|
704
|
-
#
|
705
|
-
#
|
706
|
-
#
|
707
|
-
#
|
708
|
-
#
|
709
|
-
#
|
710
|
-
#
|
711
|
-
#
|
712
|
-
#
|
713
|
-
#
|
714
|
-
#
|
715
|
-
#
|
716
|
-
#
|
717
|
-
#
|
718
|
-
#
|
719
|
-
# @
|
720
|
-
#
|
721
|
-
#
|
722
|
-
#
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
#
|
727
|
-
#
|
728
|
-
#
|
729
|
-
#
|
730
|
-
#
|
731
|
-
#
|
732
|
-
#
|
733
|
-
#
|
734
|
-
#
|
735
|
-
#
|
736
|
-
#
|
737
|
-
#
|
738
|
-
#
|
739
|
-
#
|
740
|
-
#
|
741
|
-
#
|
742
|
-
#
|
743
|
-
#
|
744
|
-
#
|
745
|
-
#
|
746
|
-
#
|
747
|
-
#
|
748
|
-
#
|
749
|
-
#
|
750
|
-
#
|
751
|
-
# @
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
#
|
756
|
-
#
|
757
|
-
#
|
758
|
-
#
|
759
|
-
#
|
760
|
-
#
|
761
|
-
# @
|
762
|
-
#
|
763
|
-
#
|
764
|
-
#
|
765
|
-
#
|
766
|
-
#
|
767
|
-
#
|
768
|
-
#
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
#
|
773
|
-
#
|
774
|
-
#
|
775
|
-
#
|
776
|
-
#
|
777
|
-
#
|
778
|
-
#
|
779
|
-
#
|
780
|
-
#
|
781
|
-
#
|
782
|
-
#
|
783
|
-
#
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
#
|
791
|
-
#
|
792
|
-
#
|
793
|
-
#
|
794
|
-
#
|
795
|
-
#
|
796
|
-
#
|
797
|
-
#
|
798
|
-
#
|
799
|
-
#
|
800
|
-
#
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
#
|
805
|
-
#
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
# The
|
810
|
-
#
|
811
|
-
#
|
812
|
-
#
|
813
|
-
#
|
814
|
-
#
|
815
|
-
#
|
816
|
-
#
|
817
|
-
#
|
818
|
-
#
|
819
|
-
#
|
820
|
-
#
|
821
|
-
#
|
822
|
-
#
|
823
|
-
#
|
824
|
-
#
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
#
|
829
|
-
#
|
830
|
-
#
|
831
|
-
#
|
832
|
-
#
|
833
|
-
#
|
834
|
-
#
|
835
|
-
#
|
836
|
-
#
|
837
|
-
#
|
838
|
-
#
|
839
|
-
#
|
840
|
-
#
|
841
|
-
#
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
#
|
846
|
-
#
|
847
|
-
#
|
848
|
-
#
|
849
|
-
#
|
850
|
-
#
|
851
|
-
#
|
852
|
-
#
|
853
|
-
#
|
854
|
-
#
|
855
|
-
#
|
856
|
-
#
|
857
|
-
#
|
858
|
-
#
|
859
|
-
# @
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
#
|
866
|
-
#
|
867
|
-
#
|
868
|
-
#
|
869
|
-
#
|
870
|
-
#
|
871
|
-
#
|
872
|
-
#
|
873
|
-
#
|
874
|
-
#
|
875
|
-
#
|
876
|
-
#
|
877
|
-
#
|
878
|
-
#
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
#
|
883
|
-
#
|
884
|
-
#
|
885
|
-
#
|
886
|
-
#
|
887
|
-
#
|
888
|
-
#
|
889
|
-
#
|
890
|
-
#
|
891
|
-
#
|
892
|
-
#
|
893
|
-
#
|
894
|
-
#
|
895
|
-
#
|
896
|
-
#
|
897
|
-
#
|
898
|
-
#
|
899
|
-
#
|
900
|
-
#
|
901
|
-
#
|
902
|
-
#
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
#
|
907
|
-
#
|
908
|
-
#
|
909
|
-
#
|
910
|
-
#
|
911
|
-
#
|
912
|
-
#
|
913
|
-
#
|
914
|
-
#
|
915
|
-
#
|
916
|
-
#
|
917
|
-
#
|
918
|
-
#
|
919
|
-
#
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
#
|
924
|
-
#
|
925
|
-
#
|
926
|
-
#
|
927
|
-
#
|
928
|
-
#
|
929
|
-
#
|
930
|
-
#
|
931
|
-
#
|
932
|
-
#
|
933
|
-
#
|
934
|
-
#
|
935
|
-
#
|
936
|
-
#
|
937
|
-
#
|
938
|
-
#
|
939
|
-
#
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
#
|
944
|
-
#
|
945
|
-
#
|
946
|
-
#
|
947
|
-
#
|
948
|
-
#
|
949
|
-
#
|
950
|
-
#
|
951
|
-
#
|
952
|
-
#
|
953
|
-
#
|
954
|
-
#
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
#
|
959
|
-
#
|
960
|
-
#
|
961
|
-
#
|
962
|
-
#
|
963
|
-
#
|
964
|
-
#
|
965
|
-
#
|
966
|
-
#
|
967
|
-
#
|
968
|
-
#
|
969
|
-
#
|
970
|
-
#
|
971
|
-
#
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
#
|
976
|
-
#
|
977
|
-
#
|
978
|
-
#
|
979
|
-
#
|
980
|
-
#
|
981
|
-
#
|
982
|
-
#
|
983
|
-
#
|
984
|
-
#
|
985
|
-
#
|
986
|
-
# @
|
987
|
-
#
|
988
|
-
#
|
989
|
-
# @
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
#
|
994
|
-
#
|
995
|
-
#
|
996
|
-
#
|
997
|
-
# @
|
998
|
-
#
|
999
|
-
#
|
1000
|
-
#
|
1001
|
-
#
|
1002
|
-
#
|
1003
|
-
#
|
1004
|
-
#
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
#
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
#
|
1013
|
-
#
|
1014
|
-
#
|
1015
|
-
# @
|
1016
|
-
# entities
|
1017
|
-
#
|
1018
|
-
#
|
1019
|
-
#
|
1020
|
-
#
|
1021
|
-
#
|
1022
|
-
#
|
1023
|
-
#
|
1024
|
-
#
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
#
|
1029
|
-
#
|
1030
|
-
# @
|
1031
|
-
#
|
1032
|
-
#
|
1033
|
-
#
|
1034
|
-
#
|
1035
|
-
#
|
1036
|
-
#
|
1037
|
-
#
|
1038
|
-
#
|
1039
|
-
#
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
#
|
1045
|
-
#
|
1046
|
-
#
|
1047
|
-
#
|
1048
|
-
#
|
1049
|
-
# entities
|
1050
|
-
#
|
1051
|
-
#
|
1052
|
-
#
|
1053
|
-
#
|
1054
|
-
# @
|
1055
|
-
#
|
1056
|
-
#
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
#
|
1064
|
-
#
|
1065
|
-
#
|
1066
|
-
#
|
1067
|
-
#
|
1068
|
-
#
|
1069
|
-
#
|
1070
|
-
#
|
1071
|
-
#
|
1072
|
-
#
|
1073
|
-
#
|
1074
|
-
#
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
#
|
1079
|
-
#
|
1080
|
-
#
|
1081
|
-
#
|
1082
|
-
#
|
1083
|
-
#
|
1084
|
-
#
|
1085
|
-
#
|
1086
|
-
#
|
1087
|
-
#
|
1088
|
-
#
|
1089
|
-
#
|
1090
|
-
#
|
1091
|
-
#
|
1092
|
-
#
|
1093
|
-
# @version SketchUp 6.0
|
1094
|
-
def
|
1095
|
-
end
|
1096
|
-
|
1097
|
-
# The
|
1098
|
-
#
|
1099
|
-
#
|
1100
|
-
#
|
1101
|
-
#
|
1102
|
-
#
|
1103
|
-
#
|
1104
|
-
#
|
1105
|
-
#
|
1106
|
-
#
|
1107
|
-
#
|
1108
|
-
#
|
1109
|
-
#
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
#
|
1114
|
-
#
|
1115
|
-
# @
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The {Sketchup::Entities} class is a collection of Entity objects, either in a
|
5
|
+
# {Sketchup::ComponentDefinition} or directly in the {Sketchup::Model}. A
|
6
|
+
# {Sketchup::Entities} object corresponds to a drawing context in the GUI.
|
7
|
+
#
|
8
|
+
# @version SketchUp 6.0
|
9
|
+
class Sketchup::Entities
|
10
|
+
|
11
|
+
# Includes
|
12
|
+
|
13
|
+
include Enumerable
|
14
|
+
|
15
|
+
# Instance Methods
|
16
|
+
|
17
|
+
# The {#[]} method is used to retrieve an entity by its index in an array of
|
18
|
+
# entities. The index is a number between +0+ and entities.length - 1. In
|
19
|
+
# general, it is preferable to use the {#each} method to iterate though all
|
20
|
+
# of the entities in the collection as it will be much more efficient.
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# entities = Sketchup.active_model.entities
|
24
|
+
# entity = entities[0]
|
25
|
+
#
|
26
|
+
# @param [Integer] entity_index
|
27
|
+
# The index for a specific entity.
|
28
|
+
#
|
29
|
+
# @return [Sketchup::Entity, nil] an {Sketchup::Entity} object if successful,
|
30
|
+
# +nil+ if not found
|
31
|
+
#
|
32
|
+
# @see #at
|
33
|
+
#
|
34
|
+
# @version SketchUp 6.0
|
35
|
+
def [](entity_index)
|
36
|
+
end
|
37
|
+
|
38
|
+
# The active_section_plane method is used to access the currently active
|
39
|
+
# section plane in the Entities object.
|
40
|
+
#
|
41
|
+
# @example
|
42
|
+
# sp = Sketchup.active_model.entities.active_section_plane
|
43
|
+
# puts "Active section plane is #{sp}" if !sp.nil?
|
44
|
+
#
|
45
|
+
# @return [Sketchup::SectionPlane, nil] the active SectionPlane or nil if none is active.
|
46
|
+
#
|
47
|
+
# @version SketchUp 2014
|
48
|
+
def active_section_plane
|
49
|
+
end
|
50
|
+
|
51
|
+
# The active_section_plane= method is used to set the active section plane in
|
52
|
+
# the Entities object.
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
# entities = Sketchup.active_model.entities
|
56
|
+
# sp = entities.add_section_plane([50, 50, 0], [1.0, 1.0, 0])
|
57
|
+
# entities.active_section_plane = sp
|
58
|
+
#
|
59
|
+
# @param [Sketchup::SectionPlane, nil] sec_plane
|
60
|
+
# the SectionPlane object to be set active. Pass nil to
|
61
|
+
# deactivate any active section plane.
|
62
|
+
#
|
63
|
+
# @return [Sketchup::SectionPlane, nil] the SectionPlane object that was set active.
|
64
|
+
#
|
65
|
+
# @version SketchUp 2014
|
66
|
+
def active_section_plane=(sec_plane)
|
67
|
+
end
|
68
|
+
|
69
|
+
# The add_3d_text is used to create 3D text. It will be added as edges and
|
70
|
+
# faces drawn at the origin.
|
71
|
+
#
|
72
|
+
# = 1.0, tolerance = 0.0, z = 0.0, is_filled = true, extrusion = 0.0)
|
73
|
+
#
|
74
|
+
# @param [String] string
|
75
|
+
# The text to create.
|
76
|
+
#
|
77
|
+
# @param [Integer] alignment
|
78
|
+
# Number that defines the alignment. There are constants
|
79
|
+
# called TextAlignLeft, TextAlignRight, and
|
80
|
+
# TextAlignCenter that can be passed.
|
81
|
+
#
|
82
|
+
# @param [String] font
|
83
|
+
# font name.
|
84
|
+
#
|
85
|
+
# @param [Boolean] is_bold
|
86
|
+
# true for bold.
|
87
|
+
#
|
88
|
+
# @param [Boolean] is_italic
|
89
|
+
# true for italic.
|
90
|
+
#
|
91
|
+
# @param [Numeric] letter_height
|
92
|
+
# Height of the text in inches.
|
93
|
+
#
|
94
|
+
# @param [Numeric] tolerance
|
95
|
+
# Tolerance of the curve creation. Defaults to
|
96
|
+
# 0.0, which creates the highest possible curve quality.
|
97
|
+
#
|
98
|
+
# @param [Numeric] z
|
99
|
+
# z position in inches.
|
100
|
+
#
|
101
|
+
# @param [Boolean] is_filled
|
102
|
+
# true for filled, which will put a face between the edges of the letters.
|
103
|
+
#
|
104
|
+
# @param [Numeric] extrusion
|
105
|
+
# Extrusion depth in inches.
|
106
|
+
#
|
107
|
+
# @example
|
108
|
+
# # Draw the word "test" at the origin of the model, aligned left, in
|
109
|
+
# # Arial Bold, not italics, 1" in size, best tolerance quality, filled,
|
110
|
+
# # with an extrusion size of 5".
|
111
|
+
# entities = Sketchup.active_model.entities
|
112
|
+
# success = entities.add_3d_text('test', TextAlignLeft, "Arial",
|
113
|
+
# true, false, 1.0, 0.0, 0.5, true, 5.0)
|
114
|
+
#
|
115
|
+
# @return [Boolean] true if successful
|
116
|
+
#
|
117
|
+
# @version SketchUp 6.0
|
118
|
+
def add_3d_text(string, alignment, font, is_bold = false, is_italic = false, letter_height)
|
119
|
+
end
|
120
|
+
|
121
|
+
# The add_arc method is used to create an arc curve segment.
|
122
|
+
#
|
123
|
+
# @example
|
124
|
+
# centerpoint = Geom::Point3d.new
|
125
|
+
# # Create a circle perpendicular to the normal or Z axis
|
126
|
+
# vector = Geom::Vector3d.new 0,0,1
|
127
|
+
# vector2 = Geom::Vector3d.new 1,0,0
|
128
|
+
# vector3 = vector.normalize!
|
129
|
+
# model = Sketchup.active_model
|
130
|
+
# entities = model.active_entities
|
131
|
+
# edges = entities.add_arc centerpoint, vector2, vector3, 10, 15.degrees, 135.degrees
|
132
|
+
# arccurve = edges.first.curve
|
133
|
+
#
|
134
|
+
# @overload add_arc(center, xaxis, normal, radius, start_angle, end_angle)
|
135
|
+
#
|
136
|
+
# @param [Geom::Point3d] center A Point3d object representing the center .
|
137
|
+
# @param [Geom::Vector3d] xaxis A Vector3d object representing xaxis for the arc.
|
138
|
+
# @param [Geom::Vector3d] normal A Vector3d object representing normal for the arc.
|
139
|
+
# @param [Numeric] radius The radius of the arc.
|
140
|
+
# @param [Numeric] start_angle Start angle for the arc, in radians.
|
141
|
+
# @param [Numeric] end_angle End angle for the arc, in radians.
|
142
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects that define the arc.
|
143
|
+
#
|
144
|
+
# @overload add_arc(center, xaxis, normal, radius, start_angle, end_angle, num_segments)
|
145
|
+
#
|
146
|
+
# @param [Geom::Point3d] center A Point3d object representing the center .
|
147
|
+
# @param [Geom::Vector3d] xaxis A Vector3d object representing xaxis for the arc.
|
148
|
+
# @param [Geom::Vector3d] normal A Vector3d object representing normal for the arc.
|
149
|
+
# @param [Numeric] radius The radius of the arc.
|
150
|
+
# @param [Numeric] start_angle Start angle for the arc, in radians.
|
151
|
+
# @param [Numeric] end_angle End angle for the arc, in radians.
|
152
|
+
# @param [Integer] num_segments How many segments to draw.
|
153
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects that define the arc.
|
154
|
+
#
|
155
|
+
# @version SketchUp 6.0
|
156
|
+
def add_arc(*args)
|
157
|
+
end
|
158
|
+
|
159
|
+
# The add_circle method is used to create a circle.
|
160
|
+
#
|
161
|
+
# @example
|
162
|
+
# centerpoint = Geom::Point3d.new
|
163
|
+
# # Create a circle perpendicular to the normal or Z axis
|
164
|
+
# vector = Geom::Vector3d.new 0,0,1
|
165
|
+
# vector2 = vector.normalize!
|
166
|
+
# model = Sketchup.active_model
|
167
|
+
# entities = model.active_entities
|
168
|
+
# edges = entities.add_circle centerpoint, vector2, 10
|
169
|
+
#
|
170
|
+
# @param [Geom::Point3d] center
|
171
|
+
# A Point3d object representing the center.
|
172
|
+
#
|
173
|
+
# @param [Geom::Vector3d] normal
|
174
|
+
# A Vector3d object representing normal for the arc.
|
175
|
+
#
|
176
|
+
# @param [Numeric] radius
|
177
|
+
# The radius of the arc.
|
178
|
+
#
|
179
|
+
# @param [Integer] numsegs
|
180
|
+
# The number of segments.
|
181
|
+
#
|
182
|
+
# @return [Array<Sketchup::Edge>] an Array object containing edges if successful
|
183
|
+
#
|
184
|
+
# @version SketchUp 6.0
|
185
|
+
def add_circle(center, normal, radius, numsegs = 24)
|
186
|
+
end
|
187
|
+
|
188
|
+
# The {#add_cline} method is used to create a construction line. This can be
|
189
|
+
# finite or infinite.
|
190
|
+
#
|
191
|
+
# @example
|
192
|
+
# model = Sketchup.active_model
|
193
|
+
# entities = model.active_entities
|
194
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
195
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
196
|
+
# cline = entities.add_cline(point1, point2)
|
197
|
+
#
|
198
|
+
# @overload add_cline(start_point, end_point, stipple = '-')
|
199
|
+
#
|
200
|
+
# Creates a finite construction line.
|
201
|
+
# @param [Geom::Point3d] start_point
|
202
|
+
# @param [Geom::Point3d] end_point
|
203
|
+
# @param [String] stipple See {ConstructionLine#stipple=} for acceptable
|
204
|
+
# patterns.
|
205
|
+
#
|
206
|
+
# @overload add_cline(point, vector, stipple = '-')
|
207
|
+
#
|
208
|
+
# Creates an infinite construction line.
|
209
|
+
# @param [Geom::Point3d] point
|
210
|
+
# @param [Geom::Point3d] vector
|
211
|
+
# @param [String] stipple See {ConstructionLine#stipple=} for acceptable
|
212
|
+
# patterns.
|
213
|
+
#
|
214
|
+
# @return [Sketchup::ConstructionLine]
|
215
|
+
#
|
216
|
+
# @version SketchUp 6.0
|
217
|
+
def add_cline(*args)
|
218
|
+
end
|
219
|
+
|
220
|
+
# The add_cpoint method is used to create a construction point.
|
221
|
+
#
|
222
|
+
# @example
|
223
|
+
# model = Sketchup.active_model
|
224
|
+
# entities = model.active_entities
|
225
|
+
# point1 = Geom::Point3d.new(100,200,300)
|
226
|
+
# constpoint = entities.add_cpoint point1
|
227
|
+
# if (constpoint)
|
228
|
+
# UI.messagebox constpoint
|
229
|
+
# else
|
230
|
+
# UI.messagebox "Failure"
|
231
|
+
# end
|
232
|
+
#
|
233
|
+
# @param [Geom::Point3d] point
|
234
|
+
# A Point3d object.
|
235
|
+
#
|
236
|
+
# @return [Sketchup::ConstructionPoint] a ConstructionPoint object if
|
237
|
+
# successful
|
238
|
+
#
|
239
|
+
# @version SketchUp 6.0
|
240
|
+
def add_cpoint(point)
|
241
|
+
end
|
242
|
+
|
243
|
+
# The add_curve method is used to create a curve from a collection of edges.
|
244
|
+
#
|
245
|
+
# The arguments are either Points or an Array of Points. At least 2 points are
|
246
|
+
# required.
|
247
|
+
#
|
248
|
+
# @example
|
249
|
+
# entities = Sketchup.active_model.entities
|
250
|
+
# curve = entities.add_curve [0,0,0], [0,10,0], [1,20,0]
|
251
|
+
#
|
252
|
+
# @overload add_curve(points)
|
253
|
+
#
|
254
|
+
# @param [Array<Geom::Point3d>] points
|
255
|
+
#
|
256
|
+
# @overload add_curve(*points)
|
257
|
+
#
|
258
|
+
# @param [Array<Geom::Point3d>] points
|
259
|
+
#
|
260
|
+
# @return [Array<Sketchup::Edge>]
|
261
|
+
#
|
262
|
+
# @version SketchUp 6.0
|
263
|
+
def add_curve(*args)
|
264
|
+
end
|
265
|
+
|
266
|
+
# The {#add_dimension_linear} method adds a linear dimension to the entities.
|
267
|
+
#
|
268
|
+
# [instance_path, end_point], vector)
|
269
|
+
#
|
270
|
+
# vector)
|
271
|
+
#
|
272
|
+
# @example
|
273
|
+
# entities = Sketchup.active_model.entities
|
274
|
+
# # From point to point
|
275
|
+
# dim = entities.add_dimension_linear [50, 10, 0], [100, 10, 0], [0, 20, 0]
|
276
|
+
# # Between edge vertices
|
277
|
+
# edge = entities.add_edges([50,50,0], [40,10,0])[0]
|
278
|
+
# v0 = edge.start
|
279
|
+
# v1 = edge.end
|
280
|
+
# dim = entities.add_dimension_linear v0, v1, [0, 0, 20]
|
281
|
+
# # From an edge's midpoint to a construction point
|
282
|
+
# p0 = edge.start.position
|
283
|
+
# p1 = edge.end.position
|
284
|
+
# mp = Geom::Point3d.new((p0.x+p1.x)/2.0, (p0.y+p1.y)/2.0, (p0.z+p1.z)/2.0)
|
285
|
+
# cp = entities.add_cpoint [50, 10, 0]
|
286
|
+
# dim = entities.add_dimension_linear [edge, mp], cp, [20, 0, 0]
|
287
|
+
# # alternatively, the start params could be passed in separately
|
288
|
+
# dim = entities.add_dimension_linear edge, mp, cp, [20, 0, 0]
|
289
|
+
#
|
290
|
+
# @example Instance path
|
291
|
+
# instance = Sketchup.active_model.active_entities.grep(Sketchup::ComponentInstance).first
|
292
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
293
|
+
# instance_path = Sketchup::InstancePath.new([instance, edge])
|
294
|
+
# start_point = edge.start.position
|
295
|
+
# end_point = edge.end.position
|
296
|
+
# vector = Geom::Vector3d.new(30, 30, 0)
|
297
|
+
# Sketchup.active_model.entities.add_dimension_linear([instance_path, start_point],
|
298
|
+
#
|
299
|
+
# @example Instance path as an array
|
300
|
+
# instance = Sketchup.active_model.active_entities.grep(Sketchup::ComponentInstance).first
|
301
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
302
|
+
# path = [instance, edge]
|
303
|
+
# start_point = edge.start.position
|
304
|
+
# end_point = edge.end.position
|
305
|
+
# vector = Geom::Vector3d.new(30, 30, 0)
|
306
|
+
# Sketchup.active_model.entities.add_dimension_linear([path, start_point], [path, end_point],
|
307
|
+
#
|
308
|
+
# @overload add_dimension_linear(start_pt_or_entity, end_pt_or_entity, offset_vector)
|
309
|
+
#
|
310
|
+
# @param [Geom::Point3d, Sketchup::Entity] start_pt_or_entity
|
311
|
+
# the reference point and/or entity at the start of
|
312
|
+
# the dimension. This parameter can take several
|
313
|
+
# forms:
|
314
|
+
# @param [Geom::Point3d, Sketchup::Entity] end_pt_or_entity
|
315
|
+
# the reference point and/or entity at the end
|
316
|
+
# of the dimension. This parameter takes the exact
|
317
|
+
# same forms as 'start_pt_or_entity'.
|
318
|
+
# @param [Geom::Vector3d] offset_vector
|
319
|
+
# the parallel offset vector from the reference line
|
320
|
+
# to the dimension line measured from the 'start'
|
321
|
+
# reference point.
|
322
|
+
#
|
323
|
+
# @overload add_dimension_linear(start_instance_path, end_instance_path, offset_vector)
|
324
|
+
#
|
325
|
+
# @note Added in SketchUp 2019.
|
326
|
+
# @param [Array<Sketchup::InstancePath, Geom::Point3d>] start_instance_path An array
|
327
|
+
# containing a {Sketchup::InstancePath} and a {Geom::Point3d}.
|
328
|
+
# @param [Array<Sketchup::InstancePath, Geom::Point3d>] end_instance_path An array
|
329
|
+
# containing a {Sketchup::InstancePath} and a {Geom::Point3d}.
|
330
|
+
# @param [Geom::Vector3d] offset_vector The parallel offset vector from the
|
331
|
+
# reference line to the dimension line measured from the start reference
|
332
|
+
# point.
|
333
|
+
#
|
334
|
+
# @overload add_dimension_linear(start_array, end_array, offset_vector)
|
335
|
+
#
|
336
|
+
# @note Added in SketchUp 2019.
|
337
|
+
# @param [Array(Array<Entity>, Geom::Point3d)] start_array
|
338
|
+
# The {Array<Entity>} must contain one or more {Sketchup::ComponentInstance}'s
|
339
|
+
# and a leaf entity. The leaf entity can be a {Sketchup::Vertex},
|
340
|
+
# {Sketchup::ConstructionPoint}, {Sketchup::ConstructionLine}, or
|
341
|
+
# {Sketchup::Edge}. The {Geom::Point3d} is the point associated with the leaf entity.
|
342
|
+
# @param [Array(Array<Entity>, Geom::Point3d)] end_array
|
343
|
+
# The {Array<Entity>} must contain one or more {Sketchup::ComponentInstance}'s
|
344
|
+
# and a leaf entity. The leaf entity can be a {Sketchup::Vertex},
|
345
|
+
# {Sketchup::ConstructionPoint}, {Sketchup::ConstructionLine}, or
|
346
|
+
# {Sketchup::Edge}. The {Geom::Point3d} is the point associated with the leaf entity.
|
347
|
+
# @param [Geom::Vector3d] offset_vector The parallel offset vector from the
|
348
|
+
# reference line to the dimension line measured form the start reference
|
349
|
+
# point.
|
350
|
+
#
|
351
|
+
# @return [Sketchup::DimensionLinear] the created dimension
|
352
|
+
#
|
353
|
+
# @version SketchUp 2014
|
354
|
+
def add_dimension_linear(*args)
|
355
|
+
end
|
356
|
+
|
357
|
+
# The add_dimension_radial method adds a radial dimension (i.e arc/circle
|
358
|
+
# radius/diameter dimension) to the entities.
|
359
|
+
#
|
360
|
+
# @example
|
361
|
+
# entities = Sketchup.active_model.entities
|
362
|
+
# # Create a circle
|
363
|
+
# centerpoint = Geom::Point3d.new(10, 10, 0)
|
364
|
+
# vector = Geom::Vector3d.new(0, 0, 1)
|
365
|
+
# edges = entities.add_circle centerpoint, vector, 10
|
366
|
+
# circle = edges[0].curve
|
367
|
+
# dim = entities.add_dimension_radial circle, [30, 30, 0]
|
368
|
+
#
|
369
|
+
# @param [Sketchup::ArcCurve] arc_curve
|
370
|
+
# an ArcCurve object to which the dimension is to be
|
371
|
+
# attached.
|
372
|
+
#
|
373
|
+
# @param [Geom::Point3d] leader_break_pt
|
374
|
+
# a Point3d for the break point on the leader where the
|
375
|
+
# dimension text is attached.
|
376
|
+
#
|
377
|
+
# @return [Sketchup::DimensionRadial] the created dimension
|
378
|
+
#
|
379
|
+
# @version SketchUp 2014
|
380
|
+
def add_dimension_radial(arc_curve, leader_break_pt)
|
381
|
+
end
|
382
|
+
|
383
|
+
# The {#add_edges} method is used to add a set of connected edges to the
|
384
|
+
# {Sketchup::Entities} collection.
|
385
|
+
#
|
386
|
+
# @example
|
387
|
+
# model = Sketchup.active_model
|
388
|
+
# entities = model.active_entities
|
389
|
+
# point1 = Geom::Point3d.new(0,0,0)
|
390
|
+
# point2 = Geom::Point3d.new(20,20,20)
|
391
|
+
# edges = entities.add_edges point1, point2
|
392
|
+
#
|
393
|
+
# @note If the points form a closed loop, the first and last vertex will not
|
394
|
+
# merge. If you intend to create a face from the edges, use {#add_face}
|
395
|
+
# directly.
|
396
|
+
#
|
397
|
+
# @overload add_edges(points)
|
398
|
+
#
|
399
|
+
# @param [Array<Geom::Point3d>] points At least two points required.
|
400
|
+
# @return [Array<Sketchup::Edge>]
|
401
|
+
#
|
402
|
+
# @overload add_edges(*points)
|
403
|
+
#
|
404
|
+
# @param [Array<Geom::Point3d>] points At least two points required.
|
405
|
+
# @return [Array<Sketchup::Edge>]
|
406
|
+
#
|
407
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects if successful
|
408
|
+
#
|
409
|
+
# @see Sketchup::EntitiesBuilder#add_edges
|
410
|
+
# EntitiesBuilder#add_edges, alternative
|
411
|
+
# for generating bulk geometry with performance in mind.
|
412
|
+
#
|
413
|
+
# @version SketchUp 6.0
|
414
|
+
def add_edges(*args)
|
415
|
+
end
|
416
|
+
|
417
|
+
# The add_face method is used to create a face. You can call this method a
|
418
|
+
# number of ways:
|
419
|
+
#
|
420
|
+
# - entities.add_face(edge1, edge2, edge3, ...)
|
421
|
+
# - entities.add_face(edgearray)
|
422
|
+
# - entities.add_face(pt1, pt2, pt3, ...)
|
423
|
+
# - entities.add_face([pt1, pt2, pt3,...])
|
424
|
+
# - entities.add_face(curve)
|
425
|
+
#
|
426
|
+
# For the last form that takes a Curve, the curve must be closed - like a
|
427
|
+
# circle.
|
428
|
+
#
|
429
|
+
# @example
|
430
|
+
# depth = 100
|
431
|
+
# width = 100
|
432
|
+
# model = Sketchup.active_model
|
433
|
+
# entities = model.active_entities
|
434
|
+
# pts = []
|
435
|
+
# pts[0] = [0, 0, 0]
|
436
|
+
# pts[1] = [width, 0, 0]
|
437
|
+
# pts[2] = [width, depth, 0]
|
438
|
+
# pts[3] = [0, depth, 0]
|
439
|
+
# # Add the face to the entities in the model
|
440
|
+
# face = entities.add_face(pts)
|
441
|
+
#
|
442
|
+
# @note A special case exists for any face created on the ground plane, in
|
443
|
+
# which case the vertex order is ignored and the face is always facing down.
|
444
|
+
#
|
445
|
+
# @overload add_face(entities)
|
446
|
+
#
|
447
|
+
# @param [Array<Sketchup::Edge>, Array<Geom::Point3d>, Sketchup::Curve] entities
|
448
|
+
#
|
449
|
+
# @overload add_face(*entities)
|
450
|
+
#
|
451
|
+
# @param [Array<Sketchup::Edge>, Array<Geom::Point3d>] entities
|
452
|
+
#
|
453
|
+
# @return [Sketchup::Face, nil]
|
454
|
+
#
|
455
|
+
# @see Sketchup::EntitiesBuilder#add_face
|
456
|
+
# EntitiesBuilder#add_face, alternative
|
457
|
+
# for generating bulk geometry with performance in mind.
|
458
|
+
#
|
459
|
+
# @see file:pages/generating_geometry.md
|
460
|
+
# Guide on Generating Geometry
|
461
|
+
#
|
462
|
+
# @version SketchUp 6.0
|
463
|
+
def add_face(*args)
|
464
|
+
end
|
465
|
+
|
466
|
+
# The {#add_faces_from_mesh} method is used to add {Sketchup::Face} entities to the
|
467
|
+
# collection of entities from a {Geom::PolygonMesh}.
|
468
|
+
#
|
469
|
+
# The +smooth_flags+ parameter can contain any of the following values if
|
470
|
+
# passed. The constants were added in SketchUp 2014. For previous versions,
|
471
|
+
# numeric values have to be specified instead of the Ruby constants.
|
472
|
+
#
|
473
|
+
# - 0: {Geom::PolygonMesh::NO_SMOOTH_OR_HIDE}
|
474
|
+
# - 1: {Geom::PolygonMesh::HIDE_BASED_ON_INDEX} (Negative point index will hide the edge.)
|
475
|
+
# - 2: {Geom::PolygonMesh::SOFTEN_BASED_ON_INDEX} (Negative point index will soften the edge.)
|
476
|
+
# - 4: {Geom::PolygonMesh::AUTO_SOFTEN} (Interior edges are softened.)
|
477
|
+
# - 8: {Geom::PolygonMesh::SMOOTH_SOFT_EDGES} (All soft edges will also be smooth.)
|
478
|
+
#
|
479
|
+
# The 3rd and 4th parameters will accept a {Sketchup::Material} object or a
|
480
|
+
# string name of a material currently in the model.
|
481
|
+
#
|
482
|
+
# @example
|
483
|
+
# pm = Geom::PolygonMesh.new
|
484
|
+
# pm.add_point([ 0, 0, 0]) # 1
|
485
|
+
# pm.add_point([10, 0, 0]) # 2
|
486
|
+
# pm.add_point([10,10, 0]) # 3
|
487
|
+
# pm.add_point([ 0,10, 0]) # 4
|
488
|
+
# pm.add_point([20, 0, 5]) # 5
|
489
|
+
# pm.add_point([20,10, 5]) # 6
|
490
|
+
# pm.add_polygon(1, -2, 3, 4)
|
491
|
+
# pm.add_polygon(2, 5,6, -3)
|
492
|
+
#
|
493
|
+
# # Create a new group that we will populate with the mesh.
|
494
|
+
# group = Sketchup.active_model.entities.add_group
|
495
|
+
# material = Sketchup.active_model.materials.add('green')
|
496
|
+
# smooth_flags = Geom::PolygonMesh::NO_SMOOTH_OR_HIDE
|
497
|
+
# group.entities.add_faces_from_mesh(pm, smooth_flags, material)
|
498
|
+
#
|
499
|
+
# @param [Geom::PolygonMesh] polygon_mesh
|
500
|
+
#
|
501
|
+
# @param [Integer] smooth_flags
|
502
|
+
# flags for softening and smoothing of edges.
|
503
|
+
#
|
504
|
+
# @param [Sketchup::Material, String] f_material
|
505
|
+
# material to paint front faces with.
|
506
|
+
#
|
507
|
+
# @param [Sketchup::Material, String] b_material
|
508
|
+
# material to paint back faces with.
|
509
|
+
#
|
510
|
+
# @return [Integer] Number of faces created
|
511
|
+
#
|
512
|
+
# @see Sketchup::EntitiesBuilder
|
513
|
+
# EntitiesBuilder, alternative interface
|
514
|
+
# for generating bulk geometry with performance in mind.
|
515
|
+
#
|
516
|
+
# @see file:pages/generating_geometry.md
|
517
|
+
# Guide on Generating Geometry
|
518
|
+
#
|
519
|
+
# @version SketchUp 6.0
|
520
|
+
def add_faces_from_mesh(polygon_mesh, smooth_flags = Geom::PolygonMesh::AUTO_SOFTEN|Geom::PolygonMesh::SMOOTH_SOFT_EDGES, f_material = nil, b_material = nil)
|
521
|
+
end
|
522
|
+
|
523
|
+
# The add_group method is used to create an empty group or a group with
|
524
|
+
# entities.
|
525
|
+
#
|
526
|
+
# @example
|
527
|
+
# model = Sketchup.active_model
|
528
|
+
# entities = model.active_entities
|
529
|
+
# group = entities.add_group
|
530
|
+
#
|
531
|
+
# @note Calling add_group with entities in its parameters has been known to
|
532
|
+
# crash SketchUp before version 8.0. It is preferable to create an empty
|
533
|
+
# group and then add things to its Entities collection.
|
534
|
+
#
|
535
|
+
# @overload add_group(entities)
|
536
|
+
#
|
537
|
+
# @param [Array<Sketchup::Entity>] entities
|
538
|
+
# an entities collection to add to the group.
|
539
|
+
#
|
540
|
+
# @overload add_group(*entities)
|
541
|
+
#
|
542
|
+
# @param [Array<Sketchup::Entity>] entities
|
543
|
+
# an entities collection to add to the group.
|
544
|
+
#
|
545
|
+
# @return [Sketchup::Group]
|
546
|
+
#
|
547
|
+
# @version SketchUp 6.0
|
548
|
+
def add_group(*args)
|
549
|
+
end
|
550
|
+
|
551
|
+
# The add_image method is used to add an image to the collection of entities.
|
552
|
+
#
|
553
|
+
# The width and height are measured in model units (i.e. inches). If the
|
554
|
+
# height is not given, then it is computed from the width to preserve the
|
555
|
+
# aspect ratio of the image.
|
556
|
+
#
|
557
|
+
# @example
|
558
|
+
# model = Sketchup.active_model
|
559
|
+
# entities = model.active_entities
|
560
|
+
# point = Geom::Point3d.new 10,20,30
|
561
|
+
# image = entities.add_image "Shapes.jpg", point, 300
|
562
|
+
# if (image)
|
563
|
+
# UI.messagebox image
|
564
|
+
# else
|
565
|
+
# UI.messagebox "Failure"
|
566
|
+
# end
|
567
|
+
#
|
568
|
+
# @param [String] path
|
569
|
+
# A path for the image file.
|
570
|
+
#
|
571
|
+
# @param [Geom::Point3d] point
|
572
|
+
# A Point3d object representing the insertion point of
|
573
|
+
# the image.
|
574
|
+
#
|
575
|
+
# @param [Numeric] width
|
576
|
+
# Width for the image.
|
577
|
+
#
|
578
|
+
# @param [Numeric] height
|
579
|
+
# height for the image if you want to control
|
580
|
+
# width and height independently. Leave as default +0.0+ when you want it
|
581
|
+
# to be relative to the aspect ratio.
|
582
|
+
#
|
583
|
+
# @return [Sketchup::Image, nil] an Image object if successful.
|
584
|
+
#
|
585
|
+
# @version SketchUp 6.0
|
586
|
+
def add_image(path, point, width, height = 0.0)
|
587
|
+
end
|
588
|
+
|
589
|
+
# The add_instance method adds a component instance to the collection of
|
590
|
+
# entities.
|
591
|
+
#
|
592
|
+
# @example
|
593
|
+
# point = Geom::Point3d.new 10,20,30
|
594
|
+
# transform = Geom::Transformation.new point
|
595
|
+
# model = Sketchup.active_model
|
596
|
+
# entities = model.active_entities
|
597
|
+
# path = Sketchup.find_support_file "Bed.skp",
|
598
|
+
# "Components/Components Sampler/"
|
599
|
+
# definitions = model.definitions
|
600
|
+
# componentdefinition = definitions.load path
|
601
|
+
# instance = entities.add_instance componentdefinition, transform
|
602
|
+
# if (instance)
|
603
|
+
# UI.messagebox instance
|
604
|
+
# else
|
605
|
+
# UI.messagebox "Failure"
|
606
|
+
# end
|
607
|
+
#
|
608
|
+
# @param [Sketchup::ComponentDefinition] definition
|
609
|
+
# A ComponentDefinition object.
|
610
|
+
#
|
611
|
+
# @param [Geom::Transformation] transform
|
612
|
+
# A Transformation object.
|
613
|
+
#
|
614
|
+
# @return [Sketchup::ComponentInstance] a ComponentInstance object if successful
|
615
|
+
#
|
616
|
+
# @version SketchUp 6.0
|
617
|
+
def add_instance(definition, transform)
|
618
|
+
end
|
619
|
+
|
620
|
+
# The add_line method is used to add an edge to the collection of entities.
|
621
|
+
# This is not to be confused with the concept of a "line" from a geometric
|
622
|
+
# sense, which is an invisible object represented by an Array of a point
|
623
|
+
# and a vector. (See the Array class for more information on geometric lines in
|
624
|
+
# SketchUp.)
|
625
|
+
#
|
626
|
+
# This method is the same as add_edges method, but returns a single edge.
|
627
|
+
#
|
628
|
+
# @example
|
629
|
+
# model = Sketchup.active_model
|
630
|
+
# entities = model.active_entities
|
631
|
+
# point1 = Geom::Point3d.new(0,0,0)
|
632
|
+
# point2 = Geom::Point3d.new(20,20,20)
|
633
|
+
# line = entities.add_line point1,point2
|
634
|
+
# if (line)
|
635
|
+
# UI.messagebox line
|
636
|
+
# else
|
637
|
+
# UI.messagebox "Failure"
|
638
|
+
# end
|
639
|
+
#
|
640
|
+
# @param [Geom::Point3d] point1
|
641
|
+
# Point3d object representing the edge's starting point.
|
642
|
+
#
|
643
|
+
# @param [Geom::Point3d] point2
|
644
|
+
# Point3d object representing the edge's ending point.
|
645
|
+
#
|
646
|
+
# @return [Sketchup::Edge] a Edge object if successful
|
647
|
+
#
|
648
|
+
# @see Sketchup::EntitiesBuilder#add_edge
|
649
|
+
# EntitiesBuilder#add_edge, alternative
|
650
|
+
# for generating bulk geometry with performance in mind.
|
651
|
+
#
|
652
|
+
# @see file:pages/generating_geometry.md
|
653
|
+
# Guide on Generating Geometry
|
654
|
+
#
|
655
|
+
# @version SketchUp 6.0
|
656
|
+
def add_line(point1, point2)
|
657
|
+
end
|
658
|
+
|
659
|
+
# The add_ngon method is used to create a multi-sided polygon.
|
660
|
+
#
|
661
|
+
# @example
|
662
|
+
# entities = Sketchup.active_model.entities
|
663
|
+
# center = Geom::Point3d.new
|
664
|
+
# normal = Geom::Vector3d.new(0,0,1)
|
665
|
+
# radius = 100
|
666
|
+
# numsides = 6
|
667
|
+
# edges = entities.add_ngon center, normal, radius, numsides
|
668
|
+
#
|
669
|
+
# @param [Geom::Point3d] center
|
670
|
+
# A Point3d object representing the center of the polygon.
|
671
|
+
#
|
672
|
+
# @param [Geom::Vector3d] normal
|
673
|
+
# A Vector3d object.
|
674
|
+
#
|
675
|
+
# @param [Numeric] radius
|
676
|
+
# A radius.
|
677
|
+
#
|
678
|
+
# @param [Integer] numsides
|
679
|
+
# The number of sides for the polygon.
|
680
|
+
#
|
681
|
+
# @return [Array<Sketchup::Edge>] an array of Edges that make up the polygon if
|
682
|
+
# successful
|
683
|
+
#
|
684
|
+
# @version SketchUp 6.0
|
685
|
+
def add_ngon(center, normal, radius, numsides = 24)
|
686
|
+
end
|
687
|
+
|
688
|
+
# The add_observer method is used to add an observer to the current object.
|
689
|
+
#
|
690
|
+
# @example
|
691
|
+
# entities = Sketchup.active_model.entities
|
692
|
+
# status = entities.add_observer observer
|
693
|
+
#
|
694
|
+
# @param [Object] observer
|
695
|
+
# An observer.
|
696
|
+
#
|
697
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
698
|
+
#
|
699
|
+
# @version SketchUp 6.0
|
700
|
+
def add_observer(observer)
|
701
|
+
end
|
702
|
+
|
703
|
+
# The add_section_plane method adds a section plane object to the entities.
|
704
|
+
#
|
705
|
+
# @example
|
706
|
+
# # Create a section plane
|
707
|
+
# model = Sketchup.active_model
|
708
|
+
# sp = model.entities.add_section_plane([50, 50, 0], [1.0, 1.0, 0])
|
709
|
+
# # Activate it
|
710
|
+
# sp.activate
|
711
|
+
# # Make sure section planes are visible
|
712
|
+
# model.rendering_options['DisplaySectionPlanes'] = true
|
713
|
+
#
|
714
|
+
# @param plane
|
715
|
+
# the geometric plane where the SectionPlane object is to
|
716
|
+
# be created. Refer to the Geom module for information on
|
717
|
+
# how planes are represented.
|
718
|
+
#
|
719
|
+
# @return [Sketchup::SectionPlane, nil] the created SectionPlane object if
|
720
|
+
# successful, nil on failure.
|
721
|
+
#
|
722
|
+
# @version SketchUp 2014
|
723
|
+
def add_section_plane(plane)
|
724
|
+
end
|
725
|
+
|
726
|
+
# The {#add_text} method adds a note or label text entity to the entities.
|
727
|
+
#
|
728
|
+
# @example
|
729
|
+
# coordinates = [10, 10, 10]
|
730
|
+
# model = Sketchup.active_model
|
731
|
+
# entities = model.entities
|
732
|
+
# point = Geom::Point3d.new coordinates
|
733
|
+
# text = entities.add_text "This is a Test", point
|
734
|
+
#
|
735
|
+
# @example Instance path
|
736
|
+
# instance = Sketchup.active_model.active_entities.grep(Sketchup::ComponentInstance).first
|
737
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
738
|
+
# instance_path = Sketchup::InstancePath.new([instance, edge])
|
739
|
+
# point = edge.start.position
|
740
|
+
# vector = Geom::Vector3d.new(30, 30, 0)
|
741
|
+
# Sketchup.active_model.entities.add_text("mytext", [instance_path, point], vector)
|
742
|
+
#
|
743
|
+
# @example Instance path as an array
|
744
|
+
# instance = Sketchup.active_model.active_entities.grep(Sketchup::ComponentInstance).first
|
745
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
746
|
+
# path = [instance, edge]
|
747
|
+
# point = edge.start.position
|
748
|
+
# vector = Geom::Vector3d.new(30, 30, 0)
|
749
|
+
# Sketchup.active_model.entities.add_text("mytext", [path, point], vector)
|
750
|
+
#
|
751
|
+
# @overload add_text(text, point, vector)
|
752
|
+
#
|
753
|
+
# @bug SketchUp 2019.0 had a regression bug where an error was thrown if
|
754
|
+
# +point+ was provided as a {Sketchup::Vertex} or {Sketchup::InputPoint}.
|
755
|
+
# This was fixed in SketchUp 2019.1.
|
756
|
+
# @param [String] text The text string to add.
|
757
|
+
# @param [Geom::Point3d, Sketchup::Vertex, Sketchup::InputPoint] point
|
758
|
+
# A Point3d object representing the insertion point.
|
759
|
+
# @param [Geom::Vector3d] vector The Vector representing an arrow leader.
|
760
|
+
#
|
761
|
+
# @overload add_text(text, instance_path_and_pt, vector)
|
762
|
+
#
|
763
|
+
# @version SketchUp 2019
|
764
|
+
# @param [String] text The text to add.
|
765
|
+
# @param [Array<Sketchup::InstancePath, Geom::Point3d>] instance_path_and_pt
|
766
|
+
# The array containing a {Sketchup::InstancePath} and a {Geom::Point3d}.
|
767
|
+
# @param [Geom::Vector3d] vector The vector representing an arrow leader.
|
768
|
+
#
|
769
|
+
# @overload add_text(text, instance_array_and_pt, vector)
|
770
|
+
#
|
771
|
+
# @version SketchUp 2019
|
772
|
+
# @param [String] text The text to add.
|
773
|
+
# @param [Array(Array<Sketchup::Entity>, Geom::Point3d)] instance_array_with_pt
|
774
|
+
# The array containing one or more {Sketchup::ComponentInstance}'s and a
|
775
|
+
# leaf entity. The leaf entity can be a {Sketchup::Vertex},
|
776
|
+
# {Sketchup::ConstructionPoint}, {Sketchup::ConstructionLine}, or
|
777
|
+
# {Sketchup::Edge}. The {Geom::Point3d} is the point associated with the
|
778
|
+
# leaf entity.
|
779
|
+
# @param [Geom::Vector3d] vector The vector representing an arrow leader.
|
780
|
+
#
|
781
|
+
# @return [Sketchup::Text] a Text object if successful
|
782
|
+
#
|
783
|
+
# @version SketchUp 6.0
|
784
|
+
def add_text(*args)
|
785
|
+
end
|
786
|
+
|
787
|
+
# The {#at} method is an alias for {#[]}.
|
788
|
+
#
|
789
|
+
# @example
|
790
|
+
# entities = Sketchup.active_model.entities
|
791
|
+
# entity = entities.at(0)
|
792
|
+
#
|
793
|
+
# @param [Integer] entity_index
|
794
|
+
# The index for a specific entity.
|
795
|
+
#
|
796
|
+
# @return [Sketchup::Entity, nil]
|
797
|
+
#
|
798
|
+
# @see #[]
|
799
|
+
#
|
800
|
+
# @version SketchUp 6.0
|
801
|
+
def at(entity_index)
|
802
|
+
end
|
803
|
+
|
804
|
+
# Creates an {Sketchup::EntitiesBuilder} that can be used to generate bulk
|
805
|
+
# geometry with performance in mind. This is particularly useful for importers
|
806
|
+
# where the geometry is already well defined and one wants to recreate it
|
807
|
+
# without further processing.
|
808
|
+
#
|
809
|
+
# The call to {#build} starts an implicit operation, even if no other model
|
810
|
+
# changes are made within the block. This is not the same as
|
811
|
+
# {Sketchup::Model#start_operation}, so it's still recommended to wrap all
|
812
|
+
# model changes, including {#build} with {Sketchup::Model#start_operation} and
|
813
|
+
# {Sketchup::Model#commit_operation}.
|
814
|
+
#
|
815
|
+
# Refer to the documentation of {Sketchup::EntitiesBuilder} for more details.
|
816
|
+
#
|
817
|
+
# @api EntitiesBuilder
|
818
|
+
#
|
819
|
+
# @example
|
820
|
+
# model = Sketchup.active_model
|
821
|
+
# model.entities.build { |builder|
|
822
|
+
# edge = builder.add_edge([0, 0, 0], [9, 0, 0])
|
823
|
+
# edge.material = 'red'
|
824
|
+
# face = builder.add_face([[0, 0, 0], [9, 0, 0], [9, 9, 0], [0, 9, 0]])
|
825
|
+
# face.material = 'maroon'
|
826
|
+
# }
|
827
|
+
#
|
828
|
+
# @note While using {Sketchup::Entities#build} it is important to not
|
829
|
+
# add or remove vertices by other means of the builder. Also don't modify the
|
830
|
+
# position of the vertices in the {Sketchup::Entities} container geometry is
|
831
|
+
# added to. Doing so can break the vertex-cache that de-duplicates the vertices.
|
832
|
+
#
|
833
|
+
# @return [nil]
|
834
|
+
#
|
835
|
+
# @see Sketchup::EntitiesBuilder
|
836
|
+
#
|
837
|
+
# @version SketchUp 2022.0
|
838
|
+
#
|
839
|
+
# @yield [builder]
|
840
|
+
#
|
841
|
+
# @yieldparam [Sketchup::EntitiesBuilder] builder
|
842
|
+
def build
|
843
|
+
end
|
844
|
+
|
845
|
+
# The clear! method is used to remove all entities from the collection of
|
846
|
+
# entities.
|
847
|
+
#
|
848
|
+
# @example
|
849
|
+
# coordinates = [10, 10, 10]
|
850
|
+
# model = Sketchup.active_model
|
851
|
+
# entities = model.entities
|
852
|
+
# point = Geom::Point3d.new coordinates
|
853
|
+
# text = entities.add_text "This is a Test", point
|
854
|
+
# UI.messagebox "Clearing All"
|
855
|
+
# status = entities.clear!
|
856
|
+
#
|
857
|
+
# @return [Boolean] true if successful, false if unsuccessful
|
858
|
+
#
|
859
|
+
# @version SketchUp 6.0
|
860
|
+
def clear!
|
861
|
+
end
|
862
|
+
|
863
|
+
#
|
864
|
+
# @example
|
865
|
+
# model = Sketchup.active_model
|
866
|
+
# entities = model.entities
|
867
|
+
# entities.add_cpoint([10, 10, 10])
|
868
|
+
# number = entities.count
|
869
|
+
#
|
870
|
+
# @note Since SketchUp 2014 the count method is inherited from Ruby's
|
871
|
+
# +Enumerable+ mix-in module. Prior to that the {#count} method is an alias
|
872
|
+
# for {#length}.
|
873
|
+
#
|
874
|
+
# @return [Integer]
|
875
|
+
#
|
876
|
+
# @see #length
|
877
|
+
#
|
878
|
+
# @version SketchUp 6.0
|
879
|
+
def count
|
880
|
+
end
|
881
|
+
|
882
|
+
# The {#each} method is used to iterate through the entities in the collection
|
883
|
+
# of entities.
|
884
|
+
#
|
885
|
+
# @example
|
886
|
+
# coordinates = [10, 10, 10]
|
887
|
+
# model = Sketchup.active_model
|
888
|
+
# entities = model.entities
|
889
|
+
# point = Geom::Point3d.new coordinates
|
890
|
+
# text = entities.add_text "This is a Test", point
|
891
|
+
# entities.each { | entity| puts entity }
|
892
|
+
#
|
893
|
+
# @note Don't remove content from this collection while iterating over it with
|
894
|
+
# {#each}. This would change the size of the collection and cause elements to
|
895
|
+
# be skipped as the indices change. Instead copy the current collection to an
|
896
|
+
# array using +to_a+ and then use +each+ on the array, when removing content.
|
897
|
+
#
|
898
|
+
# @return [nil]
|
899
|
+
#
|
900
|
+
# @version SketchUp 6.0
|
901
|
+
#
|
902
|
+
# @yieldparam [Sketchup::Entity] entity
|
903
|
+
def each
|
904
|
+
end
|
905
|
+
|
906
|
+
# The erase_entities method is used to erase one or more entities from the
|
907
|
+
# model.
|
908
|
+
#
|
909
|
+
# @example
|
910
|
+
# depth = 100
|
911
|
+
# width = 100
|
912
|
+
# model = Sketchup.active_model
|
913
|
+
# entities = model.active_entities
|
914
|
+
# pts = []
|
915
|
+
# pts[0] = [0, 0, 0]
|
916
|
+
# pts[1] = [width, 0, 0]
|
917
|
+
# pts[2] = [width, depth, 0]
|
918
|
+
# pts[3] = [0, depth, 0]
|
919
|
+
#
|
920
|
+
# # Add the face to the entities in the model
|
921
|
+
# face = entities.add_face pts
|
922
|
+
#
|
923
|
+
# # I just happen to know that the second entity in the
|
924
|
+
# # entities objects is an edge, so erase it.
|
925
|
+
# UI.messagebox entities
|
926
|
+
# entities.erase_entities entities[1]
|
927
|
+
# UI.messagebox entities
|
928
|
+
#
|
929
|
+
# @overload erase_entities(entities)
|
930
|
+
#
|
931
|
+
# @param [Array<Sketchup::Entity>] entities
|
932
|
+
#
|
933
|
+
# @overload erase_entities(*entities)
|
934
|
+
#
|
935
|
+
# @param [Array<Sketchup::Entity>] entities
|
936
|
+
#
|
937
|
+
# @return [nil]
|
938
|
+
#
|
939
|
+
# @version SketchUp 6.0
|
940
|
+
def erase_entities(*args)
|
941
|
+
end
|
942
|
+
|
943
|
+
# The {#fill_from_mesh} method is used to add faces and edges to the collection
|
944
|
+
# of entities from a {Geom::PolygonMesh}. It requires that the entities
|
945
|
+
# collection to be filled is empty. It has higher performance than
|
946
|
+
# {#add_faces_from_mesh}, but does less error checking as it builds the
|
947
|
+
# geometry.
|
948
|
+
#
|
949
|
+
# The +smooth_flags+ parameter can contain any of the following values if
|
950
|
+
# passed. The constants were added in SketchUp 2014. For previous versions,
|
951
|
+
# numeric values have to be specified instead of the Ruby constants:
|
952
|
+
#
|
953
|
+
# - 0: {Geom::PolygonMesh::NO_SMOOTH_OR_HIDE}
|
954
|
+
# - 1: {Geom::PolygonMesh::HIDE_BASED_ON_INDEX} (Negative point index will hide the edge.)
|
955
|
+
# - 2: {Geom::PolygonMesh::SOFTEN_BASED_ON_INDEX} (Negative point index will soften the edge.)
|
956
|
+
# - 4: {Geom::PolygonMesh::AUTO_SOFTEN} (Interior edges are softened.)
|
957
|
+
# - 8: {Geom::PolygonMesh::SMOOTH_SOFT_EDGES} (All soft edges will also be smooth.)
|
958
|
+
#
|
959
|
+
# The 4rd and 5th parameters will accept a {Sketchup::Material} object or a
|
960
|
+
# string name of a material currently in the model.
|
961
|
+
#
|
962
|
+
# @example
|
963
|
+
# pm = Geom::PolygonMesh.new
|
964
|
+
# pm.add_point([ 0, 0, 0]) # 1
|
965
|
+
# pm.add_point([10, 0, 0]) # 2
|
966
|
+
# pm.add_point([10,10, 0]) # 3
|
967
|
+
# pm.add_point([ 0,10, 0]) # 4
|
968
|
+
# pm.add_point([20, 0, 5]) # 5
|
969
|
+
# pm.add_point([20,10, 5]) # 6
|
970
|
+
# pm.add_polygon(1, -2, 3, 4)
|
971
|
+
# pm.add_polygon(2, 5, 6, -3)
|
972
|
+
#
|
973
|
+
# # Create a new group that we will populate with the mesh.
|
974
|
+
# group = Sketchup.active_model.entities.add_group
|
975
|
+
# material = Sketchup.active_model.materials.add('red')
|
976
|
+
# smooth_flags = Geom::PolygonMesh::HIDE_BASED_ON_INDEX
|
977
|
+
# group.entities.fill_from_mesh(pm, true, smooth_flags, material)
|
978
|
+
#
|
979
|
+
# @param [Geom::PolygonMesh] polygon_mesh
|
980
|
+
#
|
981
|
+
# @param [Boolean] weld_vertices
|
982
|
+
# This argument has no effect and is kept for
|
983
|
+
# compatibility reasons. Points are always
|
984
|
+
# merged.
|
985
|
+
#
|
986
|
+
# @param [Integer] smooth_flags
|
987
|
+
# flags for softening and smoothing of edges.
|
988
|
+
#
|
989
|
+
# @param [Sketchup::Material, String] f_material
|
990
|
+
# material to paint front faces with.
|
991
|
+
#
|
992
|
+
# @param [Sketchup::Material, String] b_material
|
993
|
+
# material to paint back faces with.
|
994
|
+
#
|
995
|
+
# @return [Boolean]
|
996
|
+
#
|
997
|
+
# @see Sketchup::EntitiesBuilder
|
998
|
+
# EntitiesBuilder, alternative interface
|
999
|
+
# for generating bulk geometry with performance in mind.
|
1000
|
+
#
|
1001
|
+
# @see file:pages/generating_geometry.md
|
1002
|
+
# Guide on Generating Geometry
|
1003
|
+
#
|
1004
|
+
# @version SketchUp 6.0
|
1005
|
+
def fill_from_mesh(polygon_mesh, weld_vertices = true, smooth_flags = Geom::PolygonMesh::AUTO_SOFTEN|Geom::PolygonMesh::SMOOTH_SOFT_EDGES, f_material = nil, b_material = nil)
|
1006
|
+
end
|
1007
|
+
|
1008
|
+
# The intersect_with method is used to intersect an entities, component
|
1009
|
+
# instance, or group object with a entities object.
|
1010
|
+
#
|
1011
|
+
# @example
|
1012
|
+
# entities.intersect_with recurse, transformation1, entities1,
|
1013
|
+
# transformation2, hidden, entities2
|
1014
|
+
#
|
1015
|
+
# @param [Boolean] recurse
|
1016
|
+
# true if you want this entities object to be recursed
|
1017
|
+
# (intersection lines will be put inside of groups and
|
1018
|
+
# components within this entities object).
|
1019
|
+
#
|
1020
|
+
# @param [Geom::Transformation] transform1
|
1021
|
+
# The transformation for this entities object.
|
1022
|
+
#
|
1023
|
+
# @param [Sketchup::Entities] entities1
|
1024
|
+
# The entities object where you want the intersection
|
1025
|
+
# lines to appear.
|
1026
|
+
#
|
1027
|
+
# @param [Geom::Transformation] transform2
|
1028
|
+
# The transformation for entities1.
|
1029
|
+
#
|
1030
|
+
# @param [Boolean] hidden
|
1031
|
+
# true if you want hidden geometry in this entities
|
1032
|
+
# object to be used in the intersection.
|
1033
|
+
#
|
1034
|
+
# @param [Sketchup::Entity, Array<Sketchup::Entity>] entities2
|
1035
|
+
# A single entity, or an array of entities.
|
1036
|
+
#
|
1037
|
+
# @return [nil]
|
1038
|
+
#
|
1039
|
+
# @version SketchUp 6.0
|
1040
|
+
def intersect_with(recurse, transform1, entities1, transform2, hidden, entities2)
|
1041
|
+
end
|
1042
|
+
|
1043
|
+
# The {#length} method is used to retrieve the number of entities in the
|
1044
|
+
# collection of entities.
|
1045
|
+
#
|
1046
|
+
# @example
|
1047
|
+
# model = Sketchup.active_model
|
1048
|
+
# entities = model.entities
|
1049
|
+
# entities.add_cpoint([10, 10, 10])
|
1050
|
+
# number = entities.length
|
1051
|
+
#
|
1052
|
+
# @return [Integer]
|
1053
|
+
#
|
1054
|
+
# @see #size
|
1055
|
+
#
|
1056
|
+
# @version SketchUp 6.0
|
1057
|
+
def length
|
1058
|
+
end
|
1059
|
+
|
1060
|
+
# The model method is used to retrieve the model that contains the collection
|
1061
|
+
# of entities.
|
1062
|
+
#
|
1063
|
+
# @example
|
1064
|
+
# coordinates = [10, 10, 10]
|
1065
|
+
# model = Sketchup.active_model
|
1066
|
+
# entities = model.entities
|
1067
|
+
# point = Geom::Point3d.new coordinates
|
1068
|
+
# text = entities.add_text "This is a Test", point
|
1069
|
+
# model = entities.model
|
1070
|
+
#
|
1071
|
+
# @return [Sketchup::Model] the model that contains the collection of
|
1072
|
+
# entities if successful.
|
1073
|
+
#
|
1074
|
+
# @version SketchUp 6.0
|
1075
|
+
def model
|
1076
|
+
end
|
1077
|
+
|
1078
|
+
# The parent method is used to retrieve the parent or object that contains the
|
1079
|
+
# collection of entities. A parent can be either a Model or
|
1080
|
+
# ComponentDefinition object.
|
1081
|
+
#
|
1082
|
+
# @example
|
1083
|
+
# coordinates = [10, 10, 10]
|
1084
|
+
# model = Sketchup.active_model
|
1085
|
+
# entities = model.entities
|
1086
|
+
# point = Geom::Point3d.new coordinates
|
1087
|
+
# text = entities.add_text "This is a Test", point
|
1088
|
+
# parent = entities.parent
|
1089
|
+
#
|
1090
|
+
# @return [Sketchup::ComponentDefinition, Sketchup::Model] the object that
|
1091
|
+
# contains the collection of entities if successful
|
1092
|
+
#
|
1093
|
+
# @version SketchUp 6.0
|
1094
|
+
def parent
|
1095
|
+
end
|
1096
|
+
|
1097
|
+
# The remove_observer method is used to remove an observer from the current
|
1098
|
+
# object.
|
1099
|
+
#
|
1100
|
+
# @example
|
1101
|
+
# entities = Sketchup.active_model.entities
|
1102
|
+
# status = entities.remove_observer observer
|
1103
|
+
#
|
1104
|
+
# @param [Object] observer
|
1105
|
+
# An observer.
|
1106
|
+
#
|
1107
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
1108
|
+
#
|
1109
|
+
# @version SketchUp 6.0
|
1110
|
+
def remove_observer(observer)
|
1111
|
+
end
|
1112
|
+
|
1113
|
+
# The {#size} method is an alias for the {#length} method.
|
1114
|
+
#
|
1115
|
+
# @example
|
1116
|
+
# model = Sketchup.active_model
|
1117
|
+
# entities = model.entities
|
1118
|
+
# entities.add_cpoint([10, 10, 10])
|
1119
|
+
# number = entities.size
|
1120
|
+
#
|
1121
|
+
# @return [Integer]
|
1122
|
+
#
|
1123
|
+
# @see #length
|
1124
|
+
#
|
1125
|
+
# @version SketchUp 2014
|
1126
|
+
def size
|
1127
|
+
end
|
1128
|
+
|
1129
|
+
# The transform_by_vectors method is used to apply several vectors to several
|
1130
|
+
# sub-entities all at once.
|
1131
|
+
#
|
1132
|
+
# @example
|
1133
|
+
# # Raise vertices in selection by their distance to the origin.
|
1134
|
+
# model = Sketchup.active_model
|
1135
|
+
# entities = model.active_entities
|
1136
|
+
# with_vertices = entities.select { |entity| entity.respond_to?(:vertices) }
|
1137
|
+
# vertices = with_vertices.flat_map(&:vertices).uniq
|
1138
|
+
# lengths = vertices.map { |vertex| vertex.position.distance(ORIGIN) }
|
1139
|
+
# vectors = lengths.map { |length| Geom::Vector3d.new(0, 0, length) }
|
1140
|
+
#
|
1141
|
+
# entities.transform_by_vectors(vertices, vectors)
|
1142
|
+
#
|
1143
|
+
# @param [Array<Sketchup::Entity>] sub_entities
|
1144
|
+
# An array of entities to transform.
|
1145
|
+
#
|
1146
|
+
# @param [Array<Geom::Vector3d>] vectors
|
1147
|
+
# An array of vectors to apply.
|
1148
|
+
#
|
1149
|
+
# @return [Sketchup::Entities]
|
1150
|
+
#
|
1151
|
+
# @version SketchUp 6.0
|
1152
|
+
def transform_by_vectors(sub_entities, vectors)
|
1153
|
+
end
|
1154
|
+
|
1155
|
+
# The transform_entities method is used to apply a transform to several
|
1156
|
+
# sub-entities all at once.
|
1157
|
+
#
|
1158
|
+
# If you are transforming entities in the active drawing context or any of its
|
1159
|
+
# parent drawing contexts, the transformation will be interpreted as relative
|
1160
|
+
# to the global coordinate system. Otherwise the transformation will be
|
1161
|
+
# interpreted as being on the local coordinate system.
|
1162
|
+
#
|
1163
|
+
# @example
|
1164
|
+
# entities = Sketchup.active_model.entities
|
1165
|
+
# entity1 = entities.add_line([0,0,0],[100,100,100])
|
1166
|
+
# entity2 = entities.add_line([0,0,0],[200,-10,-10])
|
1167
|
+
#
|
1168
|
+
# transformation = Geom::Transformation.new([100,0,0])
|
1169
|
+
# entities.transform_entities(transformation, [entity1, entity2])
|
1170
|
+
#
|
1171
|
+
# @param [Geom::Transformation] transform
|
1172
|
+
# The Transformation to apply.
|
1173
|
+
#
|
1174
|
+
# @param [Array<Sketchup::Entity>] entities
|
1175
|
+
# An array or series of entities to transform.
|
1176
|
+
#
|
1177
|
+
# @return [Boolean] +false+ if the entities array was empty.
|
1178
|
+
#
|
1179
|
+
# @version SketchUp 6.0
|
1180
|
+
def transform_entities(transform, entities)
|
1181
|
+
end
|
1182
|
+
|
1183
|
+
# The {#weld} method takes a set of edges and find all possible chains of edges
|
1184
|
+
# and connect them with a {Sketchup::Curve}.
|
1185
|
+
#
|
1186
|
+
# A curve will not cross another curve. They will split where multiple curves
|
1187
|
+
# meet.
|
1188
|
+
#
|
1189
|
+
# @example
|
1190
|
+
# model = Sketchup.active_model
|
1191
|
+
# edges = model.selection.grep(Sketchup::Edge)
|
1192
|
+
# curves = model.active_entities.weld(edges)
|
1193
|
+
#
|
1194
|
+
# @param [Array<Sketchup::Edge>] edges
|
1195
|
+
#
|
1196
|
+
# @raise [ArgumentError] if the given entities are not part of the same
|
1197
|
+
# {Sketchup::Entities} collection.
|
1198
|
+
#
|
1199
|
+
# @return [Array<Sketchup::Curve>]
|
1200
|
+
#
|
1201
|
+
# @version SketchUp 2020.1
|
1202
|
+
def weld(edges)
|
1203
|
+
end
|
1204
|
+
|
1205
|
+
end
|