sketchup-api-stubs 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/SketchUp/Geom/BoundingBox.rb +17 -20
- data/SketchUp/Geom/Bounds2d.rb +172 -0
- data/SketchUp/Geom/LatLong.rb +31 -16
- data/SketchUp/Geom/OrientedBounds2d.rb +102 -0
- data/SketchUp/Geom/Point2d.rb +365 -0
- data/SketchUp/Geom/Point3d.rb +121 -110
- data/SketchUp/Geom/PolygonMesh.rb +30 -21
- data/SketchUp/Geom/Transformation.rb +8 -4
- data/SketchUp/Geom/Transformation2d.rb +125 -0
- data/SketchUp/Geom/UTM.rb +43 -37
- data/SketchUp/Geom/Vector2d.rb +497 -0
- data/SketchUp/Geom/Vector3d.rb +143 -131
- data/SketchUp/Layout.rb +25 -0
- data/SketchUp/Layout/AngularDimension.rb +569 -0
- data/SketchUp/Layout/AutoTextDefinition.rb +417 -0
- data/SketchUp/Layout/AutoTextDefinitions.rb +186 -0
- data/SketchUp/Layout/ConnectionPoint.rb +70 -0
- data/SketchUp/Layout/Document.rb +458 -0
- data/SketchUp/Layout/Ellipse.rb +29 -0
- data/SketchUp/Layout/Entities.rb +155 -0
- data/SketchUp/Layout/Entity.rb +363 -0
- data/SketchUp/Layout/FormattedText.rb +349 -0
- data/SketchUp/Layout/Grid.rb +131 -0
- data/SketchUp/Layout/Group.rb +261 -0
- data/SketchUp/Layout/Image.rb +86 -0
- data/SketchUp/Layout/Label.rb +371 -0
- data/SketchUp/Layout/Layer.rb +222 -0
- data/SketchUp/Layout/LayerInstance.rb +128 -0
- data/SketchUp/Layout/Layers.rb +232 -0
- data/SketchUp/Layout/LinearDimension.rb +563 -0
- data/SketchUp/Layout/LockedEntityError.rb +10 -0
- data/SketchUp/Layout/LockedLayerError.rb +11 -0
- data/SketchUp/Layout/Page.rb +187 -0
- data/SketchUp/Layout/PageInfo.rb +393 -0
- data/SketchUp/Layout/Pages.rb +216 -0
- data/SketchUp/Layout/Path.rb +326 -0
- data/SketchUp/Layout/Rectangle.rb +174 -0
- data/SketchUp/Layout/SketchUpModel.rb +522 -0
- data/SketchUp/Layout/Style.rb +1520 -0
- data/SketchUp/Layout/Table.rb +290 -0
- data/SketchUp/Layout/TableCell.rb +149 -0
- data/SketchUp/Layout/TableColumn.rb +139 -0
- data/SketchUp/Layout/TableRow.rb +135 -0
- data/SketchUp/Sketchup/Animation.rb +7 -4
- data/SketchUp/Sketchup/ArcCurve.rb +10 -10
- data/SketchUp/Sketchup/AttributeDictionaries.rb +13 -4
- data/SketchUp/Sketchup/AttributeDictionary.rb +12 -12
- data/SketchUp/Sketchup/Color.rb +68 -78
- data/SketchUp/Sketchup/ComponentDefinition.rb +60 -60
- data/SketchUp/Sketchup/ComponentInstance.rb +57 -55
- data/SketchUp/Sketchup/DefinitionList.rb +34 -17
- data/SketchUp/Sketchup/Drawingelement.rb +19 -21
- data/SketchUp/Sketchup/Edge.rb +22 -24
- data/SketchUp/Sketchup/Entities.rb +173 -162
- data/SketchUp/Sketchup/Entity.rb +71 -55
- data/SketchUp/Sketchup/Face.rb +45 -44
- data/SketchUp/Sketchup/Group.rb +47 -49
- data/SketchUp/Sketchup/Image.rb +16 -0
- data/SketchUp/Sketchup/ImageRep.rb +226 -0
- data/SketchUp/Sketchup/InstancePath.rb +13 -13
- data/SketchUp/Sketchup/Layer.rb +15 -17
- data/SketchUp/Sketchup/Material.rb +40 -30
- data/SketchUp/Sketchup/Materials.rb +40 -22
- data/SketchUp/Sketchup/Menu.rb +5 -5
- data/SketchUp/Sketchup/Model.rb +230 -228
- data/SketchUp/Sketchup/Page.rb +32 -0
- data/SketchUp/Sketchup/Pages.rb +3 -4
- data/SketchUp/Sketchup/RenderingOptions.rb +21 -16
- data/SketchUp/Sketchup/SectionPlane.rb +64 -0
- data/SketchUp/Sketchup/Selection.rb +20 -28
- data/SketchUp/Sketchup/ShadowInfo.rb +14 -14
- data/SketchUp/Sketchup/Text.rb +24 -26
- data/SketchUp/Sketchup/Texture.rb +28 -12
- data/SketchUp/Sketchup/Vertex.rb +14 -11
- data/SketchUp/Sketchup/View.rb +126 -116
- data/SketchUp/UI/Command.rb +17 -17
- data/SketchUp/UI/HtmlDialog.rb +8 -5
- data/SketchUp/UI/Notification.rb +1 -1
- data/SketchUp/UI/Toolbar.rb +13 -14
- data/SketchUp/UI/WebDialog.rb +55 -59
- data/SketchUp/_top_level.rb +139 -27
- data/SketchUp/{Array.rb → array.rb} +167 -30
- data/SketchUp/{Geom.rb → geom.rb} +9 -7
- data/SketchUp/{LanguageHandler.rb → languagehandler.rb} +15 -15
- data/SketchUp/{Length.rb → length.rb} +15 -15
- data/SketchUp/{Numeric.rb → numeric.rb} +19 -19
- data/SketchUp/sketchup.rb +167 -156
- data/SketchUp/{SketchupExtension.rb → sketchupextension.rb} +27 -27
- data/SketchUp/{String.rb → string.rb} +1 -1
- data/SketchUp/ui.rb +113 -87
- metadata +46 -9
@@ -55,11 +55,11 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
55
55
|
# componentdefinition = definitions.add "BedTraditional"
|
56
56
|
# component = definitions[0]
|
57
57
|
#
|
58
|
-
# @param def_name
|
58
|
+
# @param [String] def_name
|
59
59
|
# The new component definition to add to the definition
|
60
60
|
# list.
|
61
61
|
#
|
62
|
-
# @return
|
62
|
+
# @return [Sketchup::ComponentDefinition] the ComponentDefinition object
|
63
63
|
# that was added (if successful)
|
64
64
|
#
|
65
65
|
# @version SketchUp 6.0
|
@@ -72,10 +72,10 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
72
72
|
# definitions = Sketchup.active_model.definitions
|
73
73
|
# status = definitions.add_observer observer
|
74
74
|
#
|
75
|
-
# @param observer
|
75
|
+
# @param [Object] observer
|
76
76
|
# An observer.
|
77
77
|
#
|
78
|
-
# @return true if successful, false if unsuccessful.
|
78
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
79
79
|
#
|
80
80
|
# @version SketchUp 6.0
|
81
81
|
def add_observer(observer)
|
@@ -142,12 +142,11 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
142
142
|
# definitions.add("BedTraditional")
|
143
143
|
# number = definitions.each { |definition| puts definition.name }
|
144
144
|
#
|
145
|
-
# @return nil
|
145
|
+
# @return [nil]
|
146
146
|
#
|
147
147
|
# @version SketchUp 6.0
|
148
148
|
#
|
149
|
-
# @yield [
|
150
|
-
# object as they are found.
|
149
|
+
# @yield [Sketchup::ComponentDefinition] definition
|
151
150
|
def each
|
152
151
|
end
|
153
152
|
|
@@ -176,10 +175,10 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
176
175
|
# definitions = model.definitions
|
177
176
|
# componentdefinition = definitions.load path
|
178
177
|
#
|
179
|
-
# @param path
|
178
|
+
# @param [String] path
|
180
179
|
# The path where the component definition file is located.
|
181
180
|
#
|
182
|
-
# @return
|
181
|
+
# @return [Sketchup::ComponentDefinition] the loaded ComponentDefinition
|
183
182
|
# object if successful
|
184
183
|
#
|
185
184
|
# @version SketchUp 6.0
|
@@ -233,14 +232,14 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
233
232
|
# puts "Error: #{load_handler.error}"
|
234
233
|
# end
|
235
234
|
#
|
236
|
-
# @param url
|
235
|
+
# @param [String] url
|
237
236
|
# URL to load a .skp file from.
|
238
237
|
#
|
239
|
-
# @param [
|
238
|
+
# @param [Object] load_handler
|
240
239
|
# Ruby object that has methods defined
|
241
240
|
# as described in the load_from_url details.
|
242
241
|
#
|
243
|
-
# @return
|
242
|
+
# @return [Sketchup::ComponentDefinition] the loaded ComponentDefinition
|
244
243
|
# object if successful
|
245
244
|
#
|
246
245
|
# @version SketchUp 7.0
|
@@ -253,12 +252,30 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
253
252
|
# definitions = Sketchup.active_model.definitions
|
254
253
|
# definitions.purge_unused
|
255
254
|
#
|
256
|
-
# @return Sketchup::DefinitionList
|
255
|
+
# @return [Sketchup::DefinitionList]
|
257
256
|
#
|
258
257
|
# @version SketchUp 6.0
|
259
258
|
def purge_unused
|
260
259
|
end
|
261
260
|
|
261
|
+
# The {#remove} method is used to remove a component definition from the
|
262
|
+
# definition list with the given component definition. This will remove all
|
263
|
+
# instances of the definition.
|
264
|
+
#
|
265
|
+
# @example
|
266
|
+
# model = Sketchup.active_model
|
267
|
+
# definitions = model.definitions
|
268
|
+
# definition = definitions[0]
|
269
|
+
# definitions.remove(definition)
|
270
|
+
#
|
271
|
+
# @param [Sketchup::ComponentDefinition] definition
|
272
|
+
#
|
273
|
+
# @return [Boolean]
|
274
|
+
#
|
275
|
+
# @version SketchUp 2018
|
276
|
+
def remove(definition)
|
277
|
+
end
|
278
|
+
|
262
279
|
# The remove_observer method is used to remove an observer from the current
|
263
280
|
# object.
|
264
281
|
#
|
@@ -266,10 +283,10 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
266
283
|
# definitions = Sketchup.active_model.definitions
|
267
284
|
# status = definitions.remove_observer observer
|
268
285
|
#
|
269
|
-
# @param observer
|
286
|
+
# @param [Object] observer
|
270
287
|
# An observer.
|
271
288
|
#
|
272
|
-
# @return true if successful, false if unsuccessful.
|
289
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
273
290
|
#
|
274
291
|
# @version SketchUp 6.0
|
275
292
|
def remove_observer(observer)
|
@@ -298,9 +315,9 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
298
315
|
# definitions = model.definitions
|
299
316
|
# new_name = definitions.unique_name "My Base Name"
|
300
317
|
#
|
301
|
-
# @param base_name
|
318
|
+
# @param [String] base_name
|
302
319
|
#
|
303
|
-
# @return
|
320
|
+
# @return [String] the unique name.
|
304
321
|
#
|
305
322
|
# @version SketchUp 6.0
|
306
323
|
def unique_name(base_name)
|
@@ -31,7 +31,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
31
31
|
# # is a sub-class of Drawingelement.
|
32
32
|
# boundingbox = face.bounds
|
33
33
|
#
|
34
|
-
# @return
|
34
|
+
# @return [Geom::BoundingBox] A BoundingBox object if successful
|
35
35
|
#
|
36
36
|
# @version SketchUp 6.0
|
37
37
|
def bounds
|
@@ -56,12 +56,12 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
56
56
|
# status = face.casts_shadows = false
|
57
57
|
# UI.messagebox status.to_s
|
58
58
|
#
|
59
|
-
# @param casts
|
59
|
+
# @param [Boolean] casts
|
60
60
|
# true if you want the Drawingelement object to cast
|
61
61
|
# shadows, false if you do not want the Drawingelement
|
62
62
|
# object to cast shadows.
|
63
63
|
#
|
64
|
-
# @return
|
64
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
65
65
|
#
|
66
66
|
# @version SketchUp 6.0
|
67
67
|
def casts_shadows=(casts)
|
@@ -85,8 +85,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
85
85
|
# status = face.casts_shadows?
|
86
86
|
# UI.messagebox status.to_s
|
87
87
|
#
|
88
|
-
# @return
|
89
|
-
# false if unsuccessful.
|
88
|
+
# @return [Boolean]
|
90
89
|
#
|
91
90
|
# @return [Boolean]
|
92
91
|
#
|
@@ -112,7 +111,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
112
111
|
# face = entities.add_face pts
|
113
112
|
# status = face.erase!
|
114
113
|
#
|
115
|
-
# @return
|
114
|
+
# @return [Boolean] true if successful, false if unsuccessful
|
116
115
|
#
|
117
116
|
# @version SketchUp 6.0
|
118
117
|
def erase!
|
@@ -135,11 +134,11 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
135
134
|
# UI.messagebox "Click OK to Hide the Box"
|
136
135
|
# status = face.hidden = true
|
137
136
|
#
|
138
|
-
# @param hidden
|
137
|
+
# @param [Boolean] hidden
|
139
138
|
# true if you want to hide the element, false if you do
|
140
139
|
# not want to hide the element.
|
141
140
|
#
|
142
|
-
# @return
|
141
|
+
# @return [Boolean] true if the element has been hidden, false if
|
143
142
|
# the element has not been hidden.
|
144
143
|
#
|
145
144
|
# @version SketchUp 6.0
|
@@ -165,7 +164,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
165
164
|
# status = face.hidden?
|
166
165
|
# UI.messagebox "hidden? " + status.to_s
|
167
166
|
#
|
168
|
-
# @return
|
167
|
+
# @return [Boolean]
|
169
168
|
#
|
170
169
|
# @return [Boolean]
|
171
170
|
#
|
@@ -190,7 +189,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
190
189
|
# face = entities.add_face pts
|
191
190
|
# layer = face.layer
|
192
191
|
#
|
193
|
-
# @return
|
192
|
+
# @return [Sketchup::Layer] a layer object if successful
|
194
193
|
#
|
195
194
|
# @version SketchUp 6.0
|
196
195
|
def layer
|
@@ -221,7 +220,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
221
220
|
# @param [Sketchup::Layer, String] layer
|
222
221
|
# A layer or layer name.
|
223
222
|
#
|
224
|
-
# @return
|
223
|
+
# @return [Sketchup::Layer, String] the new Layer object if successful
|
225
224
|
#
|
226
225
|
# @version SketchUp 6.0
|
227
226
|
def layer=(layer)
|
@@ -244,7 +243,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
244
243
|
# face = entities.add_face pts
|
245
244
|
# material = face.material
|
246
245
|
#
|
247
|
-
# @return
|
246
|
+
# @return [Sketchup::Material] the Material object if successful
|
248
247
|
#
|
249
248
|
# @version SketchUp 6.0
|
250
249
|
def material
|
@@ -276,11 +275,11 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
276
275
|
# # You will see the material applied when you reverse the box's faces
|
277
276
|
# material = face.material = m
|
278
277
|
#
|
279
|
-
# @param material
|
278
|
+
# @param [Sketchup::Material, String, Sketchup::Color] material
|
280
279
|
# A Material, name of a material, Color, or name of a
|
281
280
|
# color.
|
282
281
|
#
|
283
|
-
# @return
|
282
|
+
# @return [Sketchup::Material, String, Sketchup::Color] the new Material object if successful
|
284
283
|
#
|
285
284
|
# @version SketchUp 6.0
|
286
285
|
def material=(material)
|
@@ -306,11 +305,11 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
306
305
|
# status = face.receives_shadows = false
|
307
306
|
# UI.messagebox status.to_s
|
308
307
|
#
|
309
|
-
# @param receive
|
308
|
+
# @param [Boolean] receive
|
310
309
|
# true if you want the Drawingelement object to
|
311
310
|
# receive shadows, false if not.
|
312
311
|
#
|
313
|
-
# @return
|
312
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
314
313
|
#
|
315
314
|
# @version SketchUp 6.0
|
316
315
|
def receives_shadows=(receive)
|
@@ -334,8 +333,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
334
333
|
# status = face.receives_shadows?
|
335
334
|
# UI.messagebox status.to_s
|
336
335
|
#
|
337
|
-
# @return
|
338
|
-
# shadows, false if unsuccessful.
|
336
|
+
# @return [Boolean]
|
339
337
|
#
|
340
338
|
# @return [Boolean]
|
341
339
|
#
|
@@ -361,10 +359,10 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
361
359
|
# UI.messagebox "Click OK to Hide the Box"
|
362
360
|
# status = face.visible = false
|
363
361
|
#
|
364
|
-
# @param visibility
|
362
|
+
# @param [Boolean] visibility
|
365
363
|
# true if you want to hide the element, false if not
|
366
364
|
#
|
367
|
-
# @return
|
365
|
+
# @return [Boolean] true if the element has been hidden, false if
|
368
366
|
# the element has not been hidden.
|
369
367
|
#
|
370
368
|
# @version SketchUp 6.0
|
@@ -389,7 +387,7 @@ class Sketchup::Drawingelement < Sketchup::Entity
|
|
389
387
|
# face.visible = false
|
390
388
|
# UI.messagebox "Is the face visible? " + face.visible?.to_s
|
391
389
|
#
|
392
|
-
# @return
|
390
|
+
# @return [Boolean]
|
393
391
|
#
|
394
392
|
# @return [Boolean]
|
395
393
|
#
|
data/SketchUp/Sketchup/Edge.rb
CHANGED
@@ -35,7 +35,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
35
35
|
# UI.messagebox "Failure"
|
36
36
|
# end
|
37
37
|
#
|
38
|
-
# @return
|
38
|
+
# @return [Array<Sketchup::Entity>] the edge and entities connected to that edge
|
39
39
|
#
|
40
40
|
# @version SketchUp 6.0
|
41
41
|
def all_connected
|
@@ -68,10 +68,10 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
68
68
|
# UI.messagebox "Failure: No Common Face"
|
69
69
|
# end
|
70
70
|
#
|
71
|
-
# @param edge2
|
71
|
+
# @param [Sketchup::Edge] edge2
|
72
72
|
# The face whose edge you are checking for commonality.
|
73
73
|
#
|
74
|
-
# @return
|
74
|
+
# @return [Sketchup::Face, nil] the Face object that is common to the two edges
|
75
75
|
# if successful
|
76
76
|
#
|
77
77
|
# @version SketchUp 6.0
|
@@ -92,7 +92,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
92
92
|
# UI.messagebox "Failure: Not a Curve"
|
93
93
|
# end
|
94
94
|
#
|
95
|
-
# @return
|
95
|
+
# @return [Sketchup::Curve, nil] returns a Curve object if it is a
|
96
96
|
# curve, nil if it is not a curve
|
97
97
|
#
|
98
98
|
# @version SketchUp 6.0
|
@@ -118,7 +118,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
118
118
|
# UI.messagebox "Failure"
|
119
119
|
# end
|
120
120
|
#
|
121
|
-
# @return
|
121
|
+
# @return [Sketchup::Vertex] a Vertex object if successful
|
122
122
|
#
|
123
123
|
# @version SketchUp 6.0
|
124
124
|
def end
|
@@ -149,7 +149,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
149
149
|
# UI.messagebox "Failure"
|
150
150
|
# end
|
151
151
|
#
|
152
|
-
# @return
|
152
|
+
# @return [Sketchup::Edge] an exploded edge object if successful
|
153
153
|
#
|
154
154
|
# @version SketchUp 6.0
|
155
155
|
def explode_curve
|
@@ -167,7 +167,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
167
167
|
# UI.messagebox "Failure: No Faces Found"
|
168
168
|
# end
|
169
169
|
#
|
170
|
-
# @return
|
170
|
+
# @return [Array<Sketchup::Face>] an array of Face objects if successful, false
|
171
171
|
# if unsuccessful
|
172
172
|
#
|
173
173
|
# @version SketchUp 6.0
|
@@ -203,7 +203,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
203
203
|
# UI.messagebox "Failure"
|
204
204
|
# end
|
205
205
|
#
|
206
|
-
# @return
|
206
|
+
# @return [Integer] the number of faces found
|
207
207
|
#
|
208
208
|
# @version SketchUp 6.0
|
209
209
|
def find_faces
|
@@ -228,13 +228,13 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
228
228
|
#
|
229
229
|
# @overload length
|
230
230
|
#
|
231
|
-
# @return
|
231
|
+
# @return [Length] the length of the edge in current units
|
232
232
|
#
|
233
233
|
# @overload length(transform)
|
234
234
|
#
|
235
|
-
# @param transform
|
236
|
-
#
|
237
|
-
# @return
|
235
|
+
# @param transform [Geom::Transformation] A Transformation object or array
|
236
|
+
# that can be interpreted as a Transformation object.
|
237
|
+
# @return [Length] the length of the edge in current units
|
238
238
|
#
|
239
239
|
# @version SketchUp 6.0
|
240
240
|
def length(*args)
|
@@ -255,8 +255,8 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
255
255
|
# UI.messagebox "Failure"
|
256
256
|
# end
|
257
257
|
#
|
258
|
-
# @return
|
259
|
-
# object.
|
258
|
+
# @return [Array(Geom::Point3d, Geom::Vector3d)] an array with a Point3d object
|
259
|
+
# and a Vector3d object.
|
260
260
|
#
|
261
261
|
# @version SketchUp 6.0
|
262
262
|
def line
|
@@ -284,11 +284,10 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
284
284
|
# UI.messagebox "Failure"
|
285
285
|
# end
|
286
286
|
#
|
287
|
-
# @param vertex1
|
287
|
+
# @param [Sketchup::Vertex] vertex1
|
288
288
|
# One of the Vertex objects associated with the edge.
|
289
289
|
#
|
290
|
-
# @return
|
291
|
-
# edge
|
290
|
+
# @return [Sketchup::Vertex] the other Vertex object associated with the edge
|
292
291
|
#
|
293
292
|
# @version SketchUp 6.0
|
294
293
|
def other_vertex(vertex1)
|
@@ -437,12 +436,12 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
437
436
|
# edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
|
438
437
|
# new_edge = edge.split 0.5
|
439
438
|
#
|
440
|
-
# @param position
|
439
|
+
# @param [Geom::Point3d] position
|
441
440
|
# A Point3d object whose location is along the edge, or
|
442
441
|
# a Float between 0.0 and 1.0 defining how far along the
|
443
442
|
# edge to split.
|
444
443
|
#
|
445
|
-
# @return
|
444
|
+
# @return [Sketchup::Edge] the new Edge object that was split off
|
446
445
|
# the old one if successful
|
447
446
|
#
|
448
447
|
# @version SketchUp 6.0
|
@@ -469,7 +468,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
469
468
|
# UI.messagebox "Failure"
|
470
469
|
# end
|
471
470
|
#
|
472
|
-
# @return
|
471
|
+
# @return [Sketchup::Vertex] a Vertex object if successful
|
473
472
|
#
|
474
473
|
# @version SketchUp 6.0
|
475
474
|
def start
|
@@ -490,11 +489,10 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
490
489
|
# UI.messagebox "Failure"
|
491
490
|
# end
|
492
491
|
#
|
493
|
-
# @param element
|
492
|
+
# @param [Sketchup::Vertex, Sketchup::Face] element
|
494
493
|
# A Vertex or Face object.
|
495
494
|
#
|
496
|
-
# @return
|
497
|
-
# false if not.
|
495
|
+
# @return [Boolean]
|
498
496
|
#
|
499
497
|
# @return [Boolean]
|
500
498
|
#
|
@@ -508,7 +506,7 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
508
506
|
# edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
|
509
507
|
# vertices = edge.vertices
|
510
508
|
#
|
511
|
-
# @return
|
509
|
+
# @return [Array<Sketchup::Vertex>] an array of Vertex objects
|
512
510
|
#
|
513
511
|
# @version SketchUp 6.0
|
514
512
|
def vertices
|
@@ -41,7 +41,7 @@ class Sketchup::Entities
|
|
41
41
|
# sp = Sketchup.active_model.entities.active_section_plane
|
42
42
|
# puts "Active section plane is #{sp}" if !sp.nil?
|
43
43
|
#
|
44
|
-
# @return the active SectionPlane or nil if none is active.
|
44
|
+
# @return [Sketchup::SectionPlane, nil] the active SectionPlane or nil if none is active.
|
45
45
|
#
|
46
46
|
# @version SketchUp 2014
|
47
47
|
def active_section_plane
|
@@ -55,11 +55,11 @@ class Sketchup::Entities
|
|
55
55
|
# sp = entities.add_section_plane([50, 50, 0], [1.0, 1.0, 0])
|
56
56
|
# entities.active_section_plane = sp
|
57
57
|
#
|
58
|
-
# @param sec_plane
|
58
|
+
# @param [Sketchup::SectionPlane, nil] sec_plane
|
59
59
|
# the SectionPlane object to be set active. Pass nil to
|
60
60
|
# deactivate any active section plane.
|
61
61
|
#
|
62
|
-
# @return the SectionPlane object that was set active.
|
62
|
+
# @return [Sketchup::SectionPlane, nil] the SectionPlane object that was set active.
|
63
63
|
#
|
64
64
|
# @version SketchUp 2014
|
65
65
|
def active_section_plane=(sec_plane)
|
@@ -76,44 +76,43 @@ class Sketchup::Entities
|
|
76
76
|
# success = entities.add_3d_text('test', TextAlignLeft, "Arial",
|
77
77
|
# true, false, 1.0, 0.0, 0.5, true, 5.0)
|
78
78
|
#
|
79
|
-
# @param [
|
80
|
-
#
|
79
|
+
# @param [Boolean] is_bold
|
80
|
+
# true for bold.
|
81
81
|
#
|
82
|
-
# @param
|
82
|
+
# @param [Numeric] extrusion
|
83
|
+
# Extrusion depth in inches.
|
84
|
+
#
|
85
|
+
# @param [String] string
|
83
86
|
# The text to create.
|
84
87
|
#
|
85
|
-
# @param alignment
|
88
|
+
# @param [Integer] alignment
|
86
89
|
# Number that defines the alignment. There are constants
|
87
90
|
# called TextAlignLeft, TextAlignRight, and
|
88
91
|
# TextAlignCenter that can be passed.
|
89
92
|
#
|
90
|
-
# @param font
|
91
|
-
#
|
93
|
+
# @param [String] font
|
94
|
+
# font name.
|
92
95
|
#
|
93
|
-
# @param [
|
94
|
-
#
|
96
|
+
# @param [Boolean] is_filled
|
97
|
+
# true for filled, which will put a face between the edges of the letters.
|
95
98
|
#
|
96
|
-
# @param [
|
97
|
-
#
|
99
|
+
# @param [Numeric] z
|
100
|
+
# z position in inches.
|
98
101
|
#
|
99
|
-
# @param [
|
102
|
+
# @param [Numeric] letter_height
|
100
103
|
# Height of the text in inches.
|
101
104
|
#
|
102
|
-
# @param [
|
105
|
+
# @param [Numeric] tolerance
|
103
106
|
# Tolerance of the curve creation. Defaults to
|
104
107
|
# 0.0, which creates the highest possible curve quality.
|
105
108
|
#
|
106
|
-
# @param [
|
107
|
-
#
|
109
|
+
# @param [Boolean] is_italic
|
110
|
+
# true for italic.
|
108
111
|
#
|
109
|
-
# @
|
110
|
-
# Boolean, true for filled, which will put a
|
111
|
-
# face between the edges of the letters.
|
112
|
-
#
|
113
|
-
# @return true if successful
|
112
|
+
# @return [Boolean] true if successful
|
114
113
|
#
|
115
114
|
# @version SketchUp 6.0
|
116
|
-
def add_3d_text(string, alignment, font, is_bold, is_italic, letter_height, tolerance, z, is_filled, extrusion)
|
115
|
+
def add_3d_text(string, alignment, font, is_bold = false, is_italic = false, letter_height = 1.0, tolerance = 0.0, z = 0.0, is_filled = true, extrusion = 0.0)
|
117
116
|
end
|
118
117
|
|
119
118
|
# The add_arc method is used to create an arc curve segment.
|
@@ -131,24 +130,24 @@ class Sketchup::Entities
|
|
131
130
|
#
|
132
131
|
# @overload add_arc(center, xaxis, normal, radius, start_angle, end_angle)
|
133
132
|
#
|
134
|
-
# @param center
|
135
|
-
# @param xaxis
|
136
|
-
# @param normal
|
137
|
-
# @param radius
|
138
|
-
# @param start_angle
|
139
|
-
# @param end_angle
|
140
|
-
# @return
|
133
|
+
# @param [Geom::Point3d] center A Point3d object representing the center .
|
134
|
+
# @param [Geom::Vector3d] xaxis A Vector3d object representing xaxis for the arc.
|
135
|
+
# @param [Geom::Vector3d] normal A Vector3d object representing normal for the arc.
|
136
|
+
# @param [Numeric] radius The radius of the arc.
|
137
|
+
# @param [Numeric] start_angle Start angle for the arc, in radians.
|
138
|
+
# @param [Numeric] end_angle End angle for the arc, in radians.
|
139
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects that define the arc.
|
141
140
|
#
|
142
141
|
# @overload add_arc(center, xaxis, normal, radius, start_angle, end_angle, num_segments)
|
143
142
|
#
|
144
|
-
# @param center
|
145
|
-
# @param xaxis
|
146
|
-
# @param normal
|
147
|
-
# @param radius
|
148
|
-
# @param start_angle
|
149
|
-
# @param end_angle
|
150
|
-
# @param num_segments
|
151
|
-
# @return
|
143
|
+
# @param [Geom::Point3d] center A Point3d object representing the center .
|
144
|
+
# @param [Geom::Vector3d] xaxis A Vector3d object representing xaxis for the arc.
|
145
|
+
# @param [Geom::Vector3d] normal A Vector3d object representing normal for the arc.
|
146
|
+
# @param [Numeric] radius The radius of the arc.
|
147
|
+
# @param [Numeric] start_angle Start angle for the arc, in radians.
|
148
|
+
# @param [Numeric] end_angle End angle for the arc, in radians.
|
149
|
+
# @param [Integer] num_segments How many segments to draw.
|
150
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects that define the arc.
|
152
151
|
#
|
153
152
|
# @version SketchUp 6.0
|
154
153
|
def add_arc(*args)
|
@@ -165,19 +164,19 @@ class Sketchup::Entities
|
|
165
164
|
# entities = model.active_entities
|
166
165
|
# edges = entities.add_circle centerpoint, vector2, 10
|
167
166
|
#
|
168
|
-
# @param center
|
169
|
-
# A Point3d object representing the center
|
167
|
+
# @param [Geom::Point3d] center
|
168
|
+
# A Point3d object representing the center.
|
170
169
|
#
|
171
|
-
# @param
|
172
|
-
# A Vector3d object representing normal for the arc.
|
173
|
-
#
|
174
|
-
# @param numsegs
|
170
|
+
# @param [Integer] numsegs
|
175
171
|
# The number of segments.
|
176
172
|
#
|
177
|
-
# @param radius
|
173
|
+
# @param [Numeric] radius
|
178
174
|
# The radius of the arc.
|
179
175
|
#
|
180
|
-
# @
|
176
|
+
# @param [Geom::Vector3d] normal
|
177
|
+
# A Vector3d object representing normal for the arc.
|
178
|
+
#
|
179
|
+
# @return [Array<Sketchup::Edge>] an Array object containing edges if successful
|
181
180
|
#
|
182
181
|
# @version SketchUp 6.0
|
183
182
|
def add_circle(center, normal, radius, numsegs = 24)
|
@@ -192,24 +191,34 @@ class Sketchup::Entities
|
|
192
191
|
# point2 = Geom::Point3d.new(20, 20, 20)
|
193
192
|
# cline = entities.add_cline(point1, point2)
|
194
193
|
#
|
195
|
-
# @
|
196
|
-
#
|
197
|
-
#
|
198
|
-
#
|
199
|
-
#
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
#
|
208
|
-
#
|
194
|
+
# @overload add_cline(start_point, end_point)
|
195
|
+
#
|
196
|
+
# @param [Geom::Point3d] start_point
|
197
|
+
# A Point3d object where the line will start.
|
198
|
+
# @param [Geom::Point3d] end_point
|
199
|
+
# If a Vector3d, then an infinite line passing through
|
200
|
+
# the start_point will be created in that direction. If a
|
201
|
+
# Point3d, then a finite line will be created between the
|
202
|
+
# two points.
|
203
|
+
#
|
204
|
+
# @overload add_cline(start_point, end_point, stipple)
|
205
|
+
#
|
206
|
+
# @param [Geom::Point3d] start_point
|
207
|
+
# A Point3d object where the line will start.
|
208
|
+
# @param [Geom::Point3d] end_point
|
209
|
+
# If a Vector3d, then an infinite line passing through
|
210
|
+
# the start_point will be created in that direction. If a
|
211
|
+
# Point3d, then a finite line will be created between the
|
212
|
+
# two points.
|
213
|
+
# @param [String] stipple
|
214
|
+
# Stipple pattern. See ConstructionLine.stipple
|
215
|
+
# for acceptable patterns.
|
216
|
+
#
|
217
|
+
# @return [Sketchup::ConstructionLine] a ConstructionLine object if
|
209
218
|
# successful
|
210
219
|
#
|
211
220
|
# @version SketchUp 6.0
|
212
|
-
def add_cline(
|
221
|
+
def add_cline(*args)
|
213
222
|
end
|
214
223
|
|
215
224
|
# The add_cpoint method is used to create a construction point.
|
@@ -225,10 +234,10 @@ class Sketchup::Entities
|
|
225
234
|
# UI.messagebox "Failure"
|
226
235
|
# end
|
227
236
|
#
|
228
|
-
# @param point
|
237
|
+
# @param [Geom::Point3d] point
|
229
238
|
# A Point3d object.
|
230
239
|
#
|
231
|
-
# @return
|
240
|
+
# @return [Sketchup::ConstructionPoint] a ConstructionPoint object if
|
232
241
|
# successful
|
233
242
|
#
|
234
243
|
# @version SketchUp 6.0
|
@@ -244,11 +253,11 @@ class Sketchup::Entities
|
|
244
253
|
# entities = Sketchup.active_model.entities
|
245
254
|
# curve = entities.add_curve [0,0,0], [0,10,0], [1,20,0]
|
246
255
|
#
|
247
|
-
# @param pts_or_array
|
256
|
+
# @param [Array<Geom::Point3d>] pts_or_array
|
248
257
|
# You can pass either a series of Point3d objects or a
|
249
258
|
# single array containing Point3d objects.
|
250
259
|
#
|
251
|
-
# @return
|
260
|
+
# @return [Array<Sketchup::Edge>] an array of Edges that make up the curve if
|
252
261
|
# successful
|
253
262
|
#
|
254
263
|
# @version SketchUp 6.0
|
@@ -275,22 +284,22 @@ class Sketchup::Entities
|
|
275
284
|
# # alternatively, the start params could be passed in separately
|
276
285
|
# dim = entities.add_dimension_linear edge, mp, cp, [20, 0, 0]
|
277
286
|
#
|
278
|
-
# @param start_pt_or_entity
|
287
|
+
# @param [Geom::Point3d, Sketchup::Entity] start_pt_or_entity
|
279
288
|
# the reference point and/or entity at the start of
|
280
289
|
# the dimension. This parameter can take several
|
281
290
|
# forms:
|
282
291
|
#
|
283
|
-
# @param
|
284
|
-
# the reference point and/or entity at the end
|
285
|
-
# of the dimension. This parameter takes the exact
|
286
|
-
# same forms as 'start_pt_or_entity'.
|
287
|
-
#
|
288
|
-
# @param offset_vector
|
292
|
+
# @param [Geom::Vector3d] offset_vector
|
289
293
|
# the parallel offset vector from the reference line
|
290
294
|
# to the dimension line measured from the 'start'
|
291
295
|
# reference point.
|
292
296
|
#
|
293
|
-
# @
|
297
|
+
# @param [Geom::Point3d, Sketchup::Entity] end_pt_or_entity
|
298
|
+
# the reference point and/or entity at the end
|
299
|
+
# of the dimension. This parameter takes the exact
|
300
|
+
# same forms as 'start_pt_or_entity'.
|
301
|
+
#
|
302
|
+
# @return [Sketchup::DimensionLinear] the created dimension
|
294
303
|
#
|
295
304
|
# @version SketchUp 2014
|
296
305
|
def add_dimension_linear(start_pt_or_entity, end_pt_or_entity, offset_vector)
|
@@ -308,22 +317,26 @@ class Sketchup::Entities
|
|
308
317
|
# circle = edges[0].curve
|
309
318
|
# dim = entities.add_dimension_radial circle, [30, 30, 0]
|
310
319
|
#
|
311
|
-
# @param arc_curve
|
320
|
+
# @param [Sketchup::ArcCurve] arc_curve
|
312
321
|
# an ArcCurve object to which the dimension is to be
|
313
322
|
# attached.
|
314
323
|
#
|
315
|
-
# @param leader_break_pt
|
324
|
+
# @param [Geom::Point3d] leader_break_pt
|
316
325
|
# a Point3d for the break point on the leader where the
|
317
326
|
# dimension text is attached.
|
318
327
|
#
|
319
|
-
# @return the created dimension
|
328
|
+
# @return [Sketchup::DimensionRadial] the created dimension
|
320
329
|
#
|
321
330
|
# @version SketchUp 2014
|
322
331
|
def add_dimension_radial(arc_curve, leader_break_pt)
|
323
332
|
end
|
324
333
|
|
325
|
-
# The add_edges method is used to add a set of connected edges to the
|
326
|
-
#
|
334
|
+
# The {#add_edges} method is used to add a set of connected edges to the
|
335
|
+
# {Sketchup::Entities} collection.
|
336
|
+
#
|
337
|
+
# * @overload add_edges(points)
|
338
|
+
# @param [Array<Geom::Point3d>] points
|
339
|
+
# @return [Array<Sketchup::Edge>]
|
327
340
|
#
|
328
341
|
# @example
|
329
342
|
# model = Sketchup.active_model
|
@@ -332,14 +345,18 @@ class Sketchup::Entities
|
|
332
345
|
# point2 = Geom::Point3d.new(20,20,20)
|
333
346
|
# edges = entities.add_edges point1, point2
|
334
347
|
#
|
335
|
-
# @
|
336
|
-
#
|
337
|
-
#
|
348
|
+
# @note If the points form a closed loop, the first and last vertex will not
|
349
|
+
# merge. If you intend to create a face from the edges, use {#add_face}
|
350
|
+
# directly.
|
338
351
|
#
|
339
|
-
# @
|
352
|
+
# @param [Array<Geom::Point3d>] points
|
353
|
+
#
|
354
|
+
# @return [Array<Sketchup::Edge>] an array of Edge objects if successful
|
355
|
+
#
|
356
|
+
# @return [Array<Sketchup::Edge>]
|
340
357
|
#
|
341
358
|
# @version SketchUp 6.0
|
342
|
-
def add_edges(
|
359
|
+
def add_edges(point1, point2, ...)
|
343
360
|
end
|
344
361
|
|
345
362
|
# The add_face method is used to create a face. You can call this method a
|
@@ -368,18 +385,11 @@ class Sketchup::Entities
|
|
368
385
|
# pts[2] = [width, depth, 0]
|
369
386
|
# pts[3] = [0, depth, 0]
|
370
387
|
# # Add the face to the entities in the model
|
371
|
-
# face = entities.add_face
|
372
|
-
# if (face)
|
373
|
-
# UI.messagebox face
|
374
|
-
# else
|
375
|
-
# UI.messagebox "Failure"
|
376
|
-
# end
|
388
|
+
# face = entities.add_face(pts)
|
377
389
|
#
|
378
|
-
# @param some_entities
|
379
|
-
# Either a series of Edge or Point3d objects, an array of
|
380
|
-
# Point3d objects, or a closed Curve.
|
390
|
+
# @param [Array<Sketchup::Edge>, Array<Geom::Point3d>, Sketchup::Curve] some_entities
|
381
391
|
#
|
382
|
-
# @return
|
392
|
+
# @return [Sketchup::Face] a Face object if successful
|
383
393
|
#
|
384
394
|
# @version SketchUp 6.0
|
385
395
|
def add_face(some_entities)
|
@@ -452,10 +462,10 @@ class Sketchup::Entities
|
|
452
462
|
# UI.messagebox "Failure"
|
453
463
|
# end
|
454
464
|
#
|
455
|
-
# @param [
|
465
|
+
# @param [Array<Sketchup::Entity>] entities
|
456
466
|
# an entities collection to add to the group.
|
457
467
|
#
|
458
|
-
# @return
|
468
|
+
# @return [Sketchup::Group] the new group
|
459
469
|
#
|
460
470
|
# @version SketchUp 6.0
|
461
471
|
def add_group(entities)
|
@@ -478,21 +488,21 @@ class Sketchup::Entities
|
|
478
488
|
# UI.messagebox "Failure"
|
479
489
|
# end
|
480
490
|
#
|
481
|
-
# @param filename
|
491
|
+
# @param [String] filename
|
482
492
|
# A filename for the image file.
|
483
493
|
#
|
484
|
-
# @param
|
485
|
-
# A Point3d object representing the insertion point of
|
486
|
-
# the image.
|
487
|
-
#
|
488
|
-
# @param [optional] height
|
494
|
+
# @param [Numeric] height
|
489
495
|
# height for the image if you want to control
|
490
496
|
# width and height independently.
|
491
497
|
#
|
492
|
-
# @param width
|
498
|
+
# @param [Numeric] width
|
493
499
|
# Width for the image.
|
494
500
|
#
|
495
|
-
# @
|
501
|
+
# @param [Geom::Point3d] point
|
502
|
+
# A Point3d object representing the insertion point of
|
503
|
+
# the image.
|
504
|
+
#
|
505
|
+
# @return [Sketchup::Image] an Image object if successful.
|
496
506
|
#
|
497
507
|
# @version SketchUp 6.0
|
498
508
|
def add_image(filename, point, width, height)
|
@@ -517,14 +527,13 @@ class Sketchup::Entities
|
|
517
527
|
# UI.messagebox "Failure"
|
518
528
|
# end
|
519
529
|
#
|
520
|
-
# @param definition
|
530
|
+
# @param [Sketchup::ComponentDefinition] definition
|
521
531
|
# A ComponentDefinition object.
|
522
532
|
#
|
523
|
-
# @param transform
|
533
|
+
# @param [Geom::Transformation] transform
|
524
534
|
# A Transformation object.
|
525
535
|
#
|
526
|
-
# @return
|
527
|
-
# successful
|
536
|
+
# @return [Sketchup::ComponentInstance] a ComponentInstance object if successful
|
528
537
|
#
|
529
538
|
# @version SketchUp 6.0
|
530
539
|
def add_instance(definition, transform)
|
@@ -550,13 +559,13 @@ class Sketchup::Entities
|
|
550
559
|
# UI.messagebox "Failure"
|
551
560
|
# end
|
552
561
|
#
|
553
|
-
# @param point1
|
562
|
+
# @param [Geom::Point3d] point1
|
554
563
|
# Point3d object representing the edge's starting point.
|
555
564
|
#
|
556
|
-
# @param point2
|
565
|
+
# @param [Geom::Point3d] point2
|
557
566
|
# Point3d object representing the edge's ending point.
|
558
567
|
#
|
559
|
-
# @return
|
568
|
+
# @return [Sketchup::Edge] a Edge object if successful
|
560
569
|
#
|
561
570
|
# @version SketchUp 6.0
|
562
571
|
def add_line(point1, point2)
|
@@ -572,19 +581,19 @@ class Sketchup::Entities
|
|
572
581
|
# numsides = 6
|
573
582
|
# edges = entities.add_ngon center, normal, radius, numsides
|
574
583
|
#
|
575
|
-
# @param center
|
584
|
+
# @param [Geom::Point3d] center
|
576
585
|
# A Point3d object representing the center of the polygon.
|
577
586
|
#
|
578
|
-
# @param
|
579
|
-
# A Vector3d object.
|
580
|
-
#
|
581
|
-
# @param numsides
|
587
|
+
# @param [Integer] numsides
|
582
588
|
# The number of sides for the polygon.
|
583
589
|
#
|
584
|
-
# @param radius
|
590
|
+
# @param [Numeric] radius
|
585
591
|
# A radius.
|
586
592
|
#
|
587
|
-
# @
|
593
|
+
# @param [Geom::Vector3d] normal
|
594
|
+
# A Vector3d object.
|
595
|
+
#
|
596
|
+
# @return [Array<Sketchup::Edge>] an array of Edges that make up the polygon if
|
588
597
|
# successful
|
589
598
|
#
|
590
599
|
# @version SketchUp 6.0
|
@@ -597,10 +606,10 @@ class Sketchup::Entities
|
|
597
606
|
# entities = Sketchup.active_model.entities
|
598
607
|
# status = entities.add_observer observer
|
599
608
|
#
|
600
|
-
# @param observer
|
609
|
+
# @param [Object] observer
|
601
610
|
# An observer.
|
602
611
|
#
|
603
|
-
# @return true if successful, false if unsuccessful.
|
612
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
604
613
|
#
|
605
614
|
# @version SketchUp 6.0
|
606
615
|
def add_observer(observer)
|
@@ -622,8 +631,8 @@ class Sketchup::Entities
|
|
622
631
|
# be created. Refer to the Geom module for information on
|
623
632
|
# how planes are represented.
|
624
633
|
#
|
625
|
-
# @return the created SectionPlane object if
|
626
|
-
# failure.
|
634
|
+
# @return [Sketchup::SectionPlane, nil] the created SectionPlane object if
|
635
|
+
# successful, nil on failure.
|
627
636
|
#
|
628
637
|
# @version SketchUp 2014
|
629
638
|
def add_section_plane(plane)
|
@@ -638,16 +647,16 @@ class Sketchup::Entities
|
|
638
647
|
# point = Geom::Point3d.new coordinates
|
639
648
|
# text = entities.add_text "This is a Test", point
|
640
649
|
#
|
641
|
-
# @param text
|
650
|
+
# @param [String] text
|
642
651
|
# The text string to add.
|
643
652
|
#
|
644
|
-
# @param
|
645
|
-
# A Point3d object representing the insertion point.
|
646
|
-
#
|
647
|
-
# @param [optional] vector
|
653
|
+
# @param [Geom::Vector3d] vector
|
648
654
|
# vector representing an arrow leader.
|
649
655
|
#
|
650
|
-
# @
|
656
|
+
# @param [Geom::Point3d] point
|
657
|
+
# A Point3d object representing the insertion point.
|
658
|
+
#
|
659
|
+
# @return [Sketchup::Text] a Text object if successful
|
651
660
|
#
|
652
661
|
# @version SketchUp 6.0
|
653
662
|
def add_text(text, point, vector)
|
@@ -659,6 +668,9 @@ class Sketchup::Entities
|
|
659
668
|
# entities = Sketchup.active_model.entities
|
660
669
|
# entity = entities.at(0)
|
661
670
|
#
|
671
|
+
# @param [Integer] entity_index
|
672
|
+
# The index for a specific entity.
|
673
|
+
#
|
662
674
|
# @return [Sketchup::Entity, nil]
|
663
675
|
#
|
664
676
|
# @see #[]
|
@@ -679,7 +691,7 @@ class Sketchup::Entities
|
|
679
691
|
# UI.messagebox "Clearing All"
|
680
692
|
# status = entities.clear!
|
681
693
|
#
|
682
|
-
# @return
|
694
|
+
# @return [Boolean] true if successful, false if unsuccessful
|
683
695
|
#
|
684
696
|
# @version SketchUp 6.0
|
685
697
|
def clear!
|
@@ -715,12 +727,11 @@ class Sketchup::Entities
|
|
715
727
|
# text = entities.add_text "This is a Test", point
|
716
728
|
# entities.each { | entity| UI.messagebox entity }
|
717
729
|
#
|
718
|
-
# @return nil
|
730
|
+
# @return [nil]
|
719
731
|
#
|
720
732
|
# @version SketchUp 6.0
|
721
733
|
#
|
722
|
-
# @
|
723
|
-
# found if successful.
|
734
|
+
# @yieldparam [Sketchup::Entity] entity
|
724
735
|
def each
|
725
736
|
end
|
726
737
|
|
@@ -747,10 +758,10 @@ class Sketchup::Entities
|
|
747
758
|
# entities.erase_entities entities[1]
|
748
759
|
# UI.messagebox entities
|
749
760
|
#
|
750
|
-
# @param entities
|
761
|
+
# @param [Array<Sketchup::Entity>] entities
|
751
762
|
# An entity or array of entities.
|
752
763
|
#
|
753
|
-
# @return nil
|
764
|
+
# @return [nil]
|
754
765
|
#
|
755
766
|
# @version SketchUp 6.0
|
756
767
|
def erase_entities(entities)
|
@@ -797,17 +808,17 @@ class Sketchup::Entities
|
|
797
808
|
# compatibility reasons. Points are always
|
798
809
|
# merged.
|
799
810
|
#
|
800
|
-
# @param [Geom::PolygonMesh] polygon_mesh
|
801
|
-
#
|
802
|
-
# @param [Integer] smooth_flags
|
803
|
-
# flags for softening and smoothing of edges.
|
804
|
-
#
|
805
811
|
# @param [Sketchup::Material, String] b_material
|
806
812
|
# material to paint back faces with.
|
807
813
|
#
|
814
|
+
# @param [Geom::PolygonMesh] polygon_mesh
|
815
|
+
#
|
808
816
|
# @param [Sketchup::Material, String] f_material
|
809
817
|
# material to paint front faces with.
|
810
818
|
#
|
819
|
+
# @param [Integer] smooth_flags
|
820
|
+
# flags for softening and smoothing of edges.
|
821
|
+
#
|
811
822
|
# @return [Boolean]
|
812
823
|
#
|
813
824
|
# @version SketchUp 6.0
|
@@ -821,29 +832,29 @@ class Sketchup::Entities
|
|
821
832
|
# entities.intersect_with recurse, transformation1, entities1,
|
822
833
|
# transformation2, hidden, entities2
|
823
834
|
#
|
824
|
-
# @param transform1
|
835
|
+
# @param [Geom::Transformation] transform1
|
825
836
|
# The transformation for this entities object.
|
826
837
|
#
|
827
|
-
# @param
|
838
|
+
# @param [Sketchup::Entity, Array<Sketchup::Entity>] entities2
|
839
|
+
# A single entity, or an array of entities.
|
840
|
+
#
|
841
|
+
# @param [Boolean] recurse
|
828
842
|
# true if you want this entities object to be recursed
|
829
843
|
# (intersection lines will be put inside of groups and
|
830
844
|
# components within this entities object).
|
831
845
|
#
|
832
|
-
# @param
|
833
|
-
#
|
834
|
-
#
|
835
|
-
#
|
836
|
-
# @param entities2
|
837
|
-
# A single entity, or an array of entities.
|
846
|
+
# @param [Boolean] hidden
|
847
|
+
# true if you want hidden geometry in this entities
|
848
|
+
# object to be used in the intersection.
|
838
849
|
#
|
839
|
-
# @param transform2
|
850
|
+
# @param [Geom::Transformation] transform2
|
840
851
|
# The transformation for entities1.
|
841
852
|
#
|
842
|
-
# @param
|
843
|
-
#
|
844
|
-
#
|
853
|
+
# @param [Sketchup::Entities] entities1
|
854
|
+
# The entities object where you want the intersection
|
855
|
+
# lines to appear.
|
845
856
|
#
|
846
|
-
# @return nil
|
857
|
+
# @return [nil]
|
847
858
|
#
|
848
859
|
# @version SketchUp 6.0
|
849
860
|
def intersect_with(recurse, transform1, entities1, transform2, hidden, entities2)
|
@@ -877,7 +888,7 @@ class Sketchup::Entities
|
|
877
888
|
# text = entities.add_text "This is a Test", point
|
878
889
|
# model = entities.model
|
879
890
|
#
|
880
|
-
# @return
|
891
|
+
# @return [Sketchup::Model] the model that contains the collection of
|
881
892
|
# entities if successful.
|
882
893
|
#
|
883
894
|
# @version SketchUp 6.0
|
@@ -896,8 +907,8 @@ class Sketchup::Entities
|
|
896
907
|
# text = entities.add_text "This is a Test", point
|
897
908
|
# parent = entities.parent
|
898
909
|
#
|
899
|
-
# @return
|
900
|
-
# entities if successful
|
910
|
+
# @return [Sketchup::ComponentDefinition, Sketchup::Model] the object that
|
911
|
+
# contains the collection of entities if successful
|
901
912
|
#
|
902
913
|
# @version SketchUp 6.0
|
903
914
|
def parent
|
@@ -910,10 +921,10 @@ class Sketchup::Entities
|
|
910
921
|
# entities = Sketchup.active_model.entities
|
911
922
|
# status = entities.remove_observer observer
|
912
923
|
#
|
913
|
-
# @param observer
|
924
|
+
# @param [Object] observer
|
914
925
|
# An observer.
|
915
926
|
#
|
916
|
-
# @return true if successful, false if unsuccessful.
|
927
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
917
928
|
#
|
918
929
|
# @version SketchUp 6.0
|
919
930
|
def remove_observer(observer)
|
@@ -942,13 +953,13 @@ class Sketchup::Entities
|
|
942
953
|
# # Need better Ruby example.
|
943
954
|
# entities = entities.transform_by_vectors sub_entities, vector_array
|
944
955
|
#
|
945
|
-
# @param sub_entities
|
956
|
+
# @param [Array<Sketchup::Entity>] sub_entities
|
946
957
|
# An array of entities to transform.
|
947
958
|
#
|
948
|
-
# @param vectors
|
959
|
+
# @param [Array<Geom::Vector3d>] vectors
|
949
960
|
# An array of vectors to apply.
|
950
961
|
#
|
951
|
-
# @return
|
962
|
+
# @return [Sketchup::Entities]
|
952
963
|
#
|
953
964
|
# @version SketchUp 6.0
|
954
965
|
def transform_by_vectors(sub_entities, vectors)
|
@@ -976,13 +987,13 @@ class Sketchup::Entities
|
|
976
987
|
# transform = Geom::Transformation.new([100,0,0])
|
977
988
|
# entities.transform_entities(transform, ent1, ent2, ent3)
|
978
989
|
#
|
979
|
-
# @param transform
|
990
|
+
# @param [Geom::Transformation] transform
|
980
991
|
# The Transformation to apply.
|
981
992
|
#
|
982
|
-
# @param entities
|
993
|
+
# @param [Array<Sketchup::Entity>] entities
|
983
994
|
# An array or series of entities to transform.
|
984
995
|
#
|
985
|
-
# @return
|
996
|
+
# @return [Boolean] results of the transform.
|
986
997
|
#
|
987
998
|
# @version SketchUp 6.0
|
988
999
|
def transform_entities(transform, entities)
|