sketchup-api-stubs 0.7.7 → 0.7.9
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 +151 -147
- data/lib/sketchup-api-stubs/stubs/{array.rb → Array.rb} +741 -741
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -322
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +509 -509
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +476 -478
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +693 -691
- data/lib/sketchup-api-stubs/stubs/{geom.rb → Geom.rb} +351 -351
- 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 +747 -411
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -179
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +517 -515
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -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 -370
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -0
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +692 -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 -144
- 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 +150 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -286
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -302
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +659 -577
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -594
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +449 -425
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +406 -396
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -502
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1239 -1126
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -545
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -126
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -917
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +282 -292
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +468 -468
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +406 -405
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -327
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -422
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -427
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -414
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +317 -318
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1652 -1654
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -357
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +130 -131
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +490 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +116 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -797
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +361 -363
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +361 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +458 -459
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +255 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +834 -835
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -71
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1311 -1307
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/{sketchup.rb → Sketchup.rb} +1377 -1353
- 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 -317
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +494 -478
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -269
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +241 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -633
- data/lib/sketchup-api-stubs/stubs/{ui.rb → UI.rb} +683 -672
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -311
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +20 -16
@@ -1,396 +1,406 @@
|
|
1
|
-
# Copyright:: Copyright
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# Drawingelement is a base class for an item in the model that can be
|
5
|
-
# displayed. These items include edges, construction points, construction
|
6
|
-
# lines, and images. Arc curves and arcs are not included because they are not
|
7
|
-
# drawing elements by themselves, but are a composition of edges.
|
8
|
-
#
|
9
|
-
# @version SketchUp 6.0
|
10
|
-
class Sketchup::Drawingelement < Sketchup::Entity
|
11
|
-
|
12
|
-
# Instance Methods
|
13
|
-
|
14
|
-
# The {#bounds} method is used to retrieve the {Geom::BoundingBox} bounding a
|
15
|
-
# {Sketchup::Drawingelement}.
|
16
|
-
#
|
17
|
-
# For a {Sketchup::Edge}, {Sketchup::ComponentInstance} and most other
|
18
|
-
# {Sketchup::Drawingelement}s, the boundingbox follows the coordinate system
|
19
|
-
# the drawing element is placed in.
|
20
|
-
# For {Sketchup::ComponentDefinition}, the box bounds the contents of the
|
21
|
-
# component and follows the component's own internal coordinate system.
|
22
|
-
#
|
23
|
-
# @example
|
24
|
-
# depth = 100
|
25
|
-
# width = 100
|
26
|
-
# model = Sketchup.active_model
|
27
|
-
# entities = model.active_entities
|
28
|
-
# pts = []
|
29
|
-
# pts[0] = [0, 0, 0]
|
30
|
-
# pts[1] = [width, 0, 0]
|
31
|
-
# pts[2] = [width, depth, 0]
|
32
|
-
# pts[3] = [0, depth, 0]
|
33
|
-
# # Add the face to the entities in the model
|
34
|
-
# face = entities.add_face pts
|
35
|
-
# # Remember, anything that can be displayed, such as a face, is also
|
36
|
-
# # a Drawingelement. So I can call bounds on a face because Face
|
37
|
-
# # is a sub-class of Drawingelement.
|
38
|
-
# boundingbox = face.bounds
|
39
|
-
#
|
40
|
-
# @return [Geom::BoundingBox]
|
41
|
-
#
|
42
|
-
# @version SketchUp 6.0
|
43
|
-
def bounds
|
44
|
-
end
|
45
|
-
|
46
|
-
# The casts_shadows= method is used to set the Drawingelement to cast shadows.
|
47
|
-
#
|
48
|
-
# @example
|
49
|
-
# depth = 100
|
50
|
-
# width = 100
|
51
|
-
# model = Sketchup.active_model
|
52
|
-
# entities = model.active_entities
|
53
|
-
# pts = []
|
54
|
-
# pts[0] = [0, 0, 100]
|
55
|
-
# pts[1] = [width, 0, 100]
|
56
|
-
# pts[2] = [width, depth, 100]
|
57
|
-
# pts[3] = [0, depth, 100]
|
58
|
-
# # Add the face to the entities in the model.
|
59
|
-
# face = entities.add_face pts
|
60
|
-
#
|
61
|
-
# # Make the face not cast shadows.
|
62
|
-
# status = face.casts_shadows = false
|
63
|
-
# UI.messagebox status.to_s
|
64
|
-
#
|
65
|
-
# @param [Boolean] casts
|
66
|
-
# true if you want the Drawingelement object to cast
|
67
|
-
# shadows, false if you do not want the Drawingelement
|
68
|
-
# object to cast shadows.
|
69
|
-
#
|
70
|
-
# @return [Boolean] true if successful, false if unsuccessful.
|
71
|
-
#
|
72
|
-
# @version SketchUp 6.0
|
73
|
-
def casts_shadows=(casts)
|
74
|
-
end
|
75
|
-
|
76
|
-
# The casts_shadows? method is used to determine if the Drawingelement is
|
77
|
-
# casting shadows.
|
78
|
-
#
|
79
|
-
# @example
|
80
|
-
# depth = 100
|
81
|
-
# width = 100
|
82
|
-
# model = Sketchup.active_model
|
83
|
-
# entities = model.active_entities
|
84
|
-
# pts = []
|
85
|
-
# pts[0] = [0, 0, 0]
|
86
|
-
# pts[1] = [width, 0, 0]
|
87
|
-
# pts[2] = [width, depth, 0]
|
88
|
-
# pts[3] = [0, depth, 0]
|
89
|
-
# # Add the face to the entities in the model
|
90
|
-
# face = entities.add_face pts
|
91
|
-
# status = face.casts_shadows?
|
92
|
-
# UI.messagebox status.to_s
|
93
|
-
#
|
94
|
-
# @return [Boolean]
|
95
|
-
#
|
96
|
-
# @version SketchUp 6.0
|
97
|
-
def casts_shadows?
|
98
|
-
end
|
99
|
-
|
100
|
-
# The erase! method is used to erase an element from the model.
|
101
|
-
#
|
102
|
-
# Erasing an Edge also erases all of the Face objects that use the Edge.
|
103
|
-
#
|
104
|
-
# @
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
# pts
|
113
|
-
# pts[
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
# the
|
147
|
-
#
|
148
|
-
#
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
#
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
195
|
-
#
|
196
|
-
#
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
#
|
211
|
-
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
#
|
215
|
-
#
|
216
|
-
#
|
217
|
-
#
|
218
|
-
#
|
219
|
-
#
|
220
|
-
#
|
221
|
-
#
|
222
|
-
#
|
223
|
-
#
|
224
|
-
#
|
225
|
-
#
|
226
|
-
#
|
227
|
-
#
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
#
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
#
|
242
|
-
#
|
243
|
-
#
|
244
|
-
#
|
245
|
-
#
|
246
|
-
#
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
#
|
255
|
-
#
|
256
|
-
#
|
257
|
-
#
|
258
|
-
#
|
259
|
-
#
|
260
|
-
#
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
#
|
265
|
-
#
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
276
|
-
#
|
277
|
-
# #
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
#
|
283
|
-
#
|
284
|
-
#
|
285
|
-
#
|
286
|
-
#
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
#
|
291
|
-
#
|
292
|
-
#
|
293
|
-
#
|
294
|
-
#
|
295
|
-
#
|
296
|
-
#
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
#
|
301
|
-
#
|
302
|
-
#
|
303
|
-
#
|
304
|
-
#
|
305
|
-
#
|
306
|
-
#
|
307
|
-
#
|
308
|
-
#
|
309
|
-
#
|
310
|
-
#
|
311
|
-
#
|
312
|
-
#
|
313
|
-
#
|
314
|
-
#
|
315
|
-
#
|
316
|
-
#
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
#
|
321
|
-
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
#
|
325
|
-
#
|
326
|
-
#
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
#
|
331
|
-
#
|
332
|
-
#
|
333
|
-
#
|
334
|
-
#
|
335
|
-
#
|
336
|
-
#
|
337
|
-
#
|
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
|
-
|
1
|
+
# Copyright:: Copyright 2023 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# Drawingelement is a base class for an item in the model that can be
|
5
|
+
# displayed. These items include edges, construction points, construction
|
6
|
+
# lines, and images. Arc curves and arcs are not included because they are not
|
7
|
+
# drawing elements by themselves, but are a composition of edges.
|
8
|
+
#
|
9
|
+
# @version SketchUp 6.0
|
10
|
+
class Sketchup::Drawingelement < Sketchup::Entity
|
11
|
+
|
12
|
+
# Instance Methods
|
13
|
+
|
14
|
+
# The {#bounds} method is used to retrieve the {Geom::BoundingBox} bounding a
|
15
|
+
# {Sketchup::Drawingelement}.
|
16
|
+
#
|
17
|
+
# For a {Sketchup::Edge}, {Sketchup::ComponentInstance} and most other
|
18
|
+
# {Sketchup::Drawingelement}s, the boundingbox follows the coordinate system
|
19
|
+
# the drawing element is placed in.
|
20
|
+
# For {Sketchup::ComponentDefinition}, the box bounds the contents of the
|
21
|
+
# component and follows the component's own internal coordinate system.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# depth = 100
|
25
|
+
# width = 100
|
26
|
+
# model = Sketchup.active_model
|
27
|
+
# entities = model.active_entities
|
28
|
+
# pts = []
|
29
|
+
# pts[0] = [0, 0, 0]
|
30
|
+
# pts[1] = [width, 0, 0]
|
31
|
+
# pts[2] = [width, depth, 0]
|
32
|
+
# pts[3] = [0, depth, 0]
|
33
|
+
# # Add the face to the entities in the model
|
34
|
+
# face = entities.add_face pts
|
35
|
+
# # Remember, anything that can be displayed, such as a face, is also
|
36
|
+
# # a Drawingelement. So I can call bounds on a face because Face
|
37
|
+
# # is a sub-class of Drawingelement.
|
38
|
+
# boundingbox = face.bounds
|
39
|
+
#
|
40
|
+
# @return [Geom::BoundingBox]
|
41
|
+
#
|
42
|
+
# @version SketchUp 6.0
|
43
|
+
def bounds
|
44
|
+
end
|
45
|
+
|
46
|
+
# The casts_shadows= method is used to set the Drawingelement to cast shadows.
|
47
|
+
#
|
48
|
+
# @example
|
49
|
+
# depth = 100
|
50
|
+
# width = 100
|
51
|
+
# model = Sketchup.active_model
|
52
|
+
# entities = model.active_entities
|
53
|
+
# pts = []
|
54
|
+
# pts[0] = [0, 0, 100]
|
55
|
+
# pts[1] = [width, 0, 100]
|
56
|
+
# pts[2] = [width, depth, 100]
|
57
|
+
# pts[3] = [0, depth, 100]
|
58
|
+
# # Add the face to the entities in the model.
|
59
|
+
# face = entities.add_face pts
|
60
|
+
#
|
61
|
+
# # Make the face not cast shadows.
|
62
|
+
# status = face.casts_shadows = false
|
63
|
+
# UI.messagebox status.to_s
|
64
|
+
#
|
65
|
+
# @param [Boolean] casts
|
66
|
+
# true if you want the Drawingelement object to cast
|
67
|
+
# shadows, false if you do not want the Drawingelement
|
68
|
+
# object to cast shadows.
|
69
|
+
#
|
70
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
71
|
+
#
|
72
|
+
# @version SketchUp 6.0
|
73
|
+
def casts_shadows=(casts)
|
74
|
+
end
|
75
|
+
|
76
|
+
# The casts_shadows? method is used to determine if the Drawingelement is
|
77
|
+
# casting shadows.
|
78
|
+
#
|
79
|
+
# @example
|
80
|
+
# depth = 100
|
81
|
+
# width = 100
|
82
|
+
# model = Sketchup.active_model
|
83
|
+
# entities = model.active_entities
|
84
|
+
# pts = []
|
85
|
+
# pts[0] = [0, 0, 0]
|
86
|
+
# pts[1] = [width, 0, 0]
|
87
|
+
# pts[2] = [width, depth, 0]
|
88
|
+
# pts[3] = [0, depth, 0]
|
89
|
+
# # Add the face to the entities in the model
|
90
|
+
# face = entities.add_face pts
|
91
|
+
# status = face.casts_shadows?
|
92
|
+
# UI.messagebox status.to_s
|
93
|
+
#
|
94
|
+
# @return [Boolean]
|
95
|
+
#
|
96
|
+
# @version SketchUp 6.0
|
97
|
+
def casts_shadows?
|
98
|
+
end
|
99
|
+
|
100
|
+
# The {#erase!} method is used to erase an element from the model.
|
101
|
+
#
|
102
|
+
# Erasing an Edge also erases all of the Face objects that use the Edge.
|
103
|
+
#
|
104
|
+
# @bug Prior to SketchUp 2023.0 this could crash SketchUp if you erased an
|
105
|
+
# instance used by the active edit path.
|
106
|
+
#
|
107
|
+
# @example
|
108
|
+
# depth = 100
|
109
|
+
# width = 100
|
110
|
+
# model = Sketchup.active_model
|
111
|
+
# entities = model.active_entities
|
112
|
+
# pts = []
|
113
|
+
# pts[0] = [0, 0, 0]
|
114
|
+
# pts[1] = [width, 0, 0]
|
115
|
+
# pts[2] = [width, depth, 0]
|
116
|
+
# pts[3] = [0, depth, 0]
|
117
|
+
# # Add the face to the entities in the model
|
118
|
+
# face = entities.add_face pts
|
119
|
+
# status = face.erase!
|
120
|
+
#
|
121
|
+
# @note When erasing multiple elements, it's faster to
|
122
|
+
# use {Sketchup::Entities#erase_entities} and erase in bulk than to iterate
|
123
|
+
# individual drawing elements calling {Sketchup::Drawingelement#erase!}.
|
124
|
+
#
|
125
|
+
# @raise [ArgumentError] if the drawing element is an instance used
|
126
|
+
# by {Sketchup::Model#active_path}.
|
127
|
+
#
|
128
|
+
# @return [nil]
|
129
|
+
#
|
130
|
+
# @version SketchUp 6.0
|
131
|
+
def erase!
|
132
|
+
end
|
133
|
+
|
134
|
+
# The hidden= method is used to set the hidden status for an element.
|
135
|
+
#
|
136
|
+
# @example
|
137
|
+
# depth = 100
|
138
|
+
# width = 100
|
139
|
+
# model = Sketchup.active_model
|
140
|
+
# entities = model.active_entities
|
141
|
+
# pts = []
|
142
|
+
# pts[0] = [0, 0, 0]
|
143
|
+
# pts[1] = [width, 0, 0]
|
144
|
+
# pts[2] = [width, depth, 0]
|
145
|
+
# pts[3] = [0, depth, 0]
|
146
|
+
# # Add the face to the entities in the model
|
147
|
+
# face = entities.add_face pts
|
148
|
+
# UI.messagebox "Click OK to Hide the Box"
|
149
|
+
# status = face.hidden = true
|
150
|
+
#
|
151
|
+
# @param [Boolean] hidden
|
152
|
+
# true if you want to hide the element, false if you do
|
153
|
+
# not want to hide the element.
|
154
|
+
#
|
155
|
+
# @return [Boolean] true if the element has been hidden, false if
|
156
|
+
# the element has not been hidden.
|
157
|
+
#
|
158
|
+
# @version SketchUp 6.0
|
159
|
+
def hidden=(hidden)
|
160
|
+
end
|
161
|
+
|
162
|
+
# The hidden? method is used to determine if the element is hidden.
|
163
|
+
#
|
164
|
+
# Hidden elements are still in the model, but they are not displayed.
|
165
|
+
#
|
166
|
+
# @example
|
167
|
+
# depth = 100
|
168
|
+
# width = 100
|
169
|
+
# model = Sketchup.active_model
|
170
|
+
# entities = model.active_entities
|
171
|
+
# pts = []
|
172
|
+
# pts[0] = [0, 0, 0]
|
173
|
+
# pts[1] = [width, 0, 0]
|
174
|
+
# pts[2] = [width, depth, 0]
|
175
|
+
# pts[3] = [0, depth, 0]
|
176
|
+
# # Add the face to the entities in the model
|
177
|
+
# face = entities.add_face pts
|
178
|
+
# status = face.hidden?
|
179
|
+
# UI.messagebox "hidden? " + status.to_s
|
180
|
+
#
|
181
|
+
# @return [Boolean]
|
182
|
+
#
|
183
|
+
# @version SketchUp 6.0
|
184
|
+
def hidden?
|
185
|
+
end
|
186
|
+
|
187
|
+
# The layer method is used to retrieve the Layer object of the drawing
|
188
|
+
# element.
|
189
|
+
#
|
190
|
+
# @example
|
191
|
+
# depth = 100
|
192
|
+
# width = 100
|
193
|
+
# model = Sketchup.active_model
|
194
|
+
# entities = model.active_entities
|
195
|
+
# pts = []
|
196
|
+
# pts[0] = [0, 0, 0]
|
197
|
+
# pts[1] = [width, 0, 0]
|
198
|
+
# pts[2] = [width, depth, 0]
|
199
|
+
# pts[3] = [0, depth, 0]
|
200
|
+
# # Add the face to the entities in the model
|
201
|
+
# face = entities.add_face pts
|
202
|
+
# layer = face.layer
|
203
|
+
#
|
204
|
+
# @return [Sketchup::Layer] a layer object if successful
|
205
|
+
#
|
206
|
+
# @version SketchUp 6.0
|
207
|
+
def layer
|
208
|
+
end
|
209
|
+
|
210
|
+
# The layer= method is used to set the layer for the drawing element.
|
211
|
+
#
|
212
|
+
# An exception is raised if you give a string that doesn't match any layer
|
213
|
+
# name.
|
214
|
+
#
|
215
|
+
# @example
|
216
|
+
# depth = 100
|
217
|
+
# width = 100
|
218
|
+
# model = Sketchup.active_model
|
219
|
+
# entities = model.active_entities
|
220
|
+
# pts = []
|
221
|
+
# pts[0] = [0, 0, 0]
|
222
|
+
# pts[1] = [width, 0, 0]
|
223
|
+
# pts[2] = [width, depth, 0]
|
224
|
+
# pts[3] = [0, depth, 0]
|
225
|
+
# # Add the face to the entities in the model
|
226
|
+
# face = entities.add_face pts
|
227
|
+
# # Add a layer
|
228
|
+
# layer = Sketchup.active_model.layers.add "joe"
|
229
|
+
# # Put the face on the joe layer (instead of layer 0)
|
230
|
+
# newlayer = face.layer = layer
|
231
|
+
#
|
232
|
+
# @param [Sketchup::Layer, String] layer
|
233
|
+
# A layer or layer name.
|
234
|
+
#
|
235
|
+
# @return [Sketchup::Layer, String] the new Layer object if successful
|
236
|
+
#
|
237
|
+
# @version SketchUp 6.0
|
238
|
+
def layer=(layer)
|
239
|
+
end
|
240
|
+
|
241
|
+
# The material method is used to retrieve the material for the drawing
|
242
|
+
# element.
|
243
|
+
#
|
244
|
+
# @example
|
245
|
+
# depth = 100
|
246
|
+
# width = 100
|
247
|
+
# model = Sketchup.active_model
|
248
|
+
# entities = model.active_entities
|
249
|
+
# pts = []
|
250
|
+
# pts[0] = [0, 0, 0]
|
251
|
+
# pts[1] = [width, 0, 0]
|
252
|
+
# pts[2] = [width, depth, 0]
|
253
|
+
# pts[3] = [0, depth, 0]
|
254
|
+
# # Add the face to the entities in the model
|
255
|
+
# face = entities.add_face pts
|
256
|
+
# material = face.material
|
257
|
+
#
|
258
|
+
# @return [Sketchup::Material] the Material object if successful
|
259
|
+
#
|
260
|
+
# @version SketchUp 6.0
|
261
|
+
def material
|
262
|
+
end
|
263
|
+
|
264
|
+
# The material= method is used to set the material for the drawing
|
265
|
+
# element.
|
266
|
+
#
|
267
|
+
# @example
|
268
|
+
# depth = 100
|
269
|
+
# width = 100
|
270
|
+
# model = Sketchup.active_model
|
271
|
+
# entities = model.active_entities
|
272
|
+
# pts = []
|
273
|
+
# pts[0] = [0, 0, 0]
|
274
|
+
# pts[1] = [width, 0, 0]
|
275
|
+
# pts[2] = [width, depth, 0]
|
276
|
+
# pts[3] = [0, depth, 0]
|
277
|
+
# # Add the face to the entities in the model
|
278
|
+
# face = entities.add_face pts
|
279
|
+
# m = model.materials.add "Joe"
|
280
|
+
# begin
|
281
|
+
# # Returns nil if not successful, path if successful.
|
282
|
+
# # Should return a texture object.
|
283
|
+
# m.texture = "c:\\My Textures\\Carpet.jpg"
|
284
|
+
# rescue
|
285
|
+
# UI.messagebox $!.message
|
286
|
+
# end
|
287
|
+
# # You will see the material applied when you reverse the box's faces
|
288
|
+
# material = face.material = m
|
289
|
+
#
|
290
|
+
# @param [Sketchup::Material, String, Sketchup::Color] material
|
291
|
+
# A Material, name of a material, Color, or name of a
|
292
|
+
# color.
|
293
|
+
#
|
294
|
+
# @return [Sketchup::Material, String, Sketchup::Color] the new Material object if successful
|
295
|
+
#
|
296
|
+
# @version SketchUp 6.0
|
297
|
+
def material=(material)
|
298
|
+
end
|
299
|
+
|
300
|
+
# The receive_shadows= method is used to set the Drawingelement to receive
|
301
|
+
# shadows.
|
302
|
+
#
|
303
|
+
# @example
|
304
|
+
# depth = 100
|
305
|
+
# width = 100
|
306
|
+
# model = Sketchup.active_model
|
307
|
+
# entities = model.active_entities
|
308
|
+
# pts = []
|
309
|
+
# pts[0] = [0, 0, 100]
|
310
|
+
# pts[1] = [width, 0, 100]
|
311
|
+
# pts[2] = [width, depth, 100]
|
312
|
+
# pts[3] = [0, depth, 100]
|
313
|
+
# # Add the face to the entities in the model.
|
314
|
+
# face = entities.add_face pts
|
315
|
+
#
|
316
|
+
# # Make the face not receive shadows.
|
317
|
+
# status = face.receives_shadows = false
|
318
|
+
# UI.messagebox status.to_s
|
319
|
+
#
|
320
|
+
# @param [Boolean] receive
|
321
|
+
# true if you want the Drawingelement object to
|
322
|
+
# receive shadows, false if not.
|
323
|
+
#
|
324
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
325
|
+
#
|
326
|
+
# @version SketchUp 6.0
|
327
|
+
def receives_shadows=(receive)
|
328
|
+
end
|
329
|
+
|
330
|
+
# The receive_shadows? method is used to determine if the Drawingelement is
|
331
|
+
# receiving shadows.
|
332
|
+
#
|
333
|
+
# @example
|
334
|
+
# depth = 100
|
335
|
+
# width = 100
|
336
|
+
# model = Sketchup.active_model
|
337
|
+
# entities = model.active_entities
|
338
|
+
# pts = []
|
339
|
+
# pts[0] = [0, 0, 0]
|
340
|
+
# pts[1] = [width, 0, 0]
|
341
|
+
# pts[2] = [width, depth, 0]
|
342
|
+
# pts[3] = [0, depth, 0]
|
343
|
+
# # Add the face to the entities in the model
|
344
|
+
# face = entities.add_face pts
|
345
|
+
# status = face.receives_shadows?
|
346
|
+
# UI.messagebox status.to_s
|
347
|
+
#
|
348
|
+
# @return [Boolean]
|
349
|
+
#
|
350
|
+
# @version SketchUp 6.0
|
351
|
+
def receives_shadows?
|
352
|
+
end
|
353
|
+
|
354
|
+
# The visible= method is used to set the visible status for an element. This
|
355
|
+
# method performs an opposite function to the hidden= method.
|
356
|
+
#
|
357
|
+
# @example
|
358
|
+
# depth = 100
|
359
|
+
# width = 100
|
360
|
+
# model = Sketchup.active_model
|
361
|
+
# entities = model.active_entities
|
362
|
+
# pts = []
|
363
|
+
# pts[0] = [0, 0, 0]
|
364
|
+
# pts[1] = [width, 0, 0]
|
365
|
+
# pts[2] = [width, depth, 0]
|
366
|
+
# pts[3] = [0, depth, 0]
|
367
|
+
# # Add the face to the entities in the model
|
368
|
+
# face = entities.add_face pts
|
369
|
+
# UI.messagebox "Click OK to Hide the Box"
|
370
|
+
# status = face.visible = false
|
371
|
+
#
|
372
|
+
# @param [Boolean] visibility
|
373
|
+
# true if you want to hide the element, false if not
|
374
|
+
#
|
375
|
+
# @return [Boolean] true if the element has been hidden, false if
|
376
|
+
# the element has not been hidden.
|
377
|
+
#
|
378
|
+
# @version SketchUp 6.0
|
379
|
+
def visible=(visibility)
|
380
|
+
end
|
381
|
+
|
382
|
+
# The visible? method is used to get the visible status for an element.
|
383
|
+
#
|
384
|
+
# @example
|
385
|
+
# depth = 100
|
386
|
+
# width = 100
|
387
|
+
# model = Sketchup.active_model
|
388
|
+
# entities = model.active_entities
|
389
|
+
# pts = []
|
390
|
+
# pts[0] = [0, 0, 0]
|
391
|
+
# pts[1] = [width, 0, 0]
|
392
|
+
# pts[2] = [width, depth, 0]
|
393
|
+
# pts[3] = [0, depth, 0]
|
394
|
+
# # Add the face to the entities in the model
|
395
|
+
# face = entities.add_face pts
|
396
|
+
# UI.messagebox "Click OK to Hide the Box"
|
397
|
+
# face.visible = false
|
398
|
+
# UI.messagebox "Is the face visible? " + face.visible?.to_s
|
399
|
+
#
|
400
|
+
# @return [Boolean]
|
401
|
+
#
|
402
|
+
# @version SketchUp 6.0
|
403
|
+
def visible?
|
404
|
+
end
|
405
|
+
|
406
|
+
end
|