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.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +148 -145
  3. data/lib/sketchup-api-stubs/stubs/{array.rb → Array.rb} +741 -741
  4. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -318
  5. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
  6. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
  7. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
  10. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +523 -492
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
  13. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +693 -691
  16. data/lib/sketchup-api-stubs/stubs/{geom.rb → Geom.rb} +351 -348
  17. data/lib/sketchup-api-stubs/stubs/{languagehandler.rb → LanguageHandler.rb} +93 -92
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -573
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +698 -411
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -174
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  22. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +516 -514
  23. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -143
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -349
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  30. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -371
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  32. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  33. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -220
  34. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  37. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  38. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
  39. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -204
  40. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  41. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  42. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +692 -694
  43. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  44. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  48. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  49. data/lib/sketchup-api-stubs/stubs/{length.rb → Length.rb} +278 -278
  50. data/lib/sketchup-api-stubs/stubs/{numeric.rb → Numeric.rb} +249 -249
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -140
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -157
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +286 -281
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -328
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -577
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -281
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +619 -562
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -194
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +426 -329
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -72
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -102
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -312
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -38
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +396 -390
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +502 -508
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1205 -1119
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +272 -0
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -125
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -544
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -59
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +126 -125
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -750
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -697
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +292 -285
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +468 -409
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -226
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -190
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +407 -393
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -82
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -303
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -285
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -244
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -136
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -112
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -416
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +318 -311
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -141
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -95
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1651 -1638
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -356
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +131 -132
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -770
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +363 -353
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -76
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +477 -456
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -44
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +459 -454
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +260 -257
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -57
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -211
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -225
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +837 -829
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  135. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -154
  136. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -61
  137. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  138. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1317 -1301
  139. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
  140. data/lib/sketchup-api-stubs/stubs/{sketchup.rb → Sketchup.rb} +1360 -1310
  141. data/lib/sketchup-api-stubs/stubs/{sketchupextension.rb → SketchupExtension.rb} +353 -353
  142. data/lib/sketchup-api-stubs/stubs/{string.rb → String.rb} +24 -24
  143. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +389 -310
  144. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +496 -356
  145. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -229
  146. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
  147. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -633
  148. data/lib/sketchup-api-stubs/stubs/{ui.rb → UI.rb} +683 -667
  149. data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
  150. data/lib/sketchup-api-stubs.rb +1 -1
  151. metadata +15 -12
@@ -1,544 +1,545 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # This is the base class for all SketchUp entities. Entities are basically
5
- # anything that can be contained in a model, including Drawingelements
6
- # such as Edges, SectionPlanes, Groups, etc. and entities that relate to
7
- # those Drawingelements, such as Loops, Layers, etc.
8
- #
9
- # Keep in mind that the methods below are available on all subclasses.
10
- # For example, an Edge's parent class is Drawingelement, and a
11
- # Drawingelement's parent class is Entity. Therefore an Edge has all of the
12
- # methods defined in Drawingelement and Entity.
13
- #
14
- # The Object.is_a? method is the common way of determining what sort of Entity
15
- # you're dealing with.
16
- #
17
- # @example
18
- # # Count how many faces are in the current selection.
19
- # selection = Sketchup.active_model.selection
20
- # face_count = 0
21
- #
22
- # # Look at all of the entities in the selection.
23
- # selection.each { |entity|
24
- # if entity.is_a? Sketchup::Face
25
- # face_count = face_count + 1
26
- # end
27
- # }
28
- #
29
- # UI.messagebox("There are " + face_count.to_s + " faces selected.")
30
- #
31
- # @version SketchUp 6.0
32
- class Sketchup::Entity
33
-
34
- # Instance Methods
35
-
36
- # The add_observer method is used to add an observer to the current object.
37
- #
38
- # @example
39
- # entity = Sketchup.active_model.entities[0]
40
- # if entity.valid?
41
- # status = entity.add_observer observer
42
- # end
43
- #
44
- # @param [Object] observer
45
- # An observer.
46
- #
47
- # @return [Boolean] true if successful, false if unsuccessful.
48
- #
49
- # @version SketchUp 6.0
50
- def add_observer(observer)
51
- end
52
-
53
- # The attribute_dictionaries method is used to retrieve the
54
- # AttributeDictionaries collection attached to the entity.
55
- #
56
- # @example
57
- # depth = 100
58
- # width = 100
59
- # model = Sketchup.active_model
60
- # entities = model.active_entities
61
- # pts = []
62
- # pts[0] = [0, 0, 0]
63
- # pts[1] = [width, 0, 0]
64
- # pts[2] = [width, depth, 0]
65
- # pts[3] = [0, depth, 0]
66
- #
67
- # # Add the face to the entities in the model
68
- # face = entities.add_face pts
69
- #
70
- # # I just happen to know that the second and third entities in the
71
- # # entities objects are edges.
72
- # entity1 = entities[1]
73
- # status = entity1.set_attribute "testdictionary", "test", 115
74
- # attrdicts = entity1.attribute_dictionaries
75
- #
76
- # @return [Sketchup::AttributeDictionaries, nil] the AttributeDictionaries
77
- # object associated with the entity, or nil if there are
78
- # no attribute_dictionary objects associated with the
79
- # model. Care must be taken if nil is returned, for
80
- # example: invoking attribute_dictionaries.length will
81
- # throw a NoMethodError exception, not return 0.
82
- #
83
- # @version SketchUp 6.0
84
- def attribute_dictionaries
85
- end
86
-
87
- # The attribute_dictionary method is used to retrieve an attribute dictionary
88
- # with a given name that is attached to an Entity.
89
- #
90
- # @example
91
- # depth = 100
92
- # width = 100
93
- # model = Sketchup.active_model
94
- # entities = model.active_entities
95
- # pts = []
96
- # pts[0] = [0, 0, 0]
97
- # pts[1] = [width, 0, 0]
98
- # pts[2] = [width, depth, 0]
99
- # pts[3] = [0, depth, 0]
100
- #
101
- # # Add the face to the entities in the model
102
- # face = entities.add_face pts
103
- #
104
- # # I just happen to know that the second and third entities in the
105
- # # entities objects are edges.
106
- # entity1 = entities[1]
107
- # status = entity1.set_attribute "testdictionary", "test", 115
108
- # attrdict = entity1.attribute_dictionary "testdictionary"
109
- #
110
- # @param [String] name
111
- # The name of the attribute dictionary.
112
- #
113
- # @param [Boolean] create
114
- # boolean, if set to true then the attribute
115
- # dictionary will be created if it does not exist.
116
- #
117
- # @return [Sketchup::AttributeDictionary, nil] - an AttributeDictionary object
118
- # if successful, or nil if there is no attribute dictionary
119
- #
120
- # @version SketchUp 6.0
121
- def attribute_dictionary(name, create = false)
122
- end
123
-
124
- # The {#delete_attribute} method is used to delete an attribute from an entity.
125
- #
126
- # If only the dictionary_name is given, then it deletes the entire
127
- # AttributeDictionary. Otherwise, {#delete_attribute} deletes the attribute with
128
- # the given key from the given dictionary.
129
- #
130
- # @bug Prior to SketchUp 2019.0 the return values was always +true+.
131
- #
132
- # @example
133
- # depth = 100
134
- # width = 100
135
- # model = Sketchup.active_model
136
- # entities = model.active_entities
137
- # pts = []
138
- # pts[0] = [0, 0, 0]
139
- # pts[1] = [width, 0, 0]
140
- # pts[2] = [width, depth, 0]
141
- # pts[3] = [0, depth, 0]
142
- # # Add the face to the entities in the model
143
- # face = entities.add_face pts
144
- #
145
- # # I just happen to know that the second and third entities in the
146
- # # entities objects are edges.
147
- # entity1 = entities[1]
148
- # status = entity1.set_attribute "testdictionary", "test", 115
149
- # status = entity1.delete_attribute "testdictionary"
150
- #
151
- # @note In SketchUp 2018, special attribute dictionaries have been added.
152
- # The name of these dictionaries are "SU_InstanceSet" and "SU_DefinitionSet".
153
- # The dictionaries cannot be deleted via ruby and an ArgumentError will be
154
- # raised. The key/value pairs in the dictionary can be deleted safely.
155
- #
156
- # @overload delete_attribute(dictionary_name)
157
- #
158
- # @param dictionary_name [String] The name of an attribute dictionary.
159
- # @return [Boolean]
160
- #
161
- # @overload delete_attribute(dictionary_name, key)
162
- #
163
- # @param dictionary_name [String] The name of an attribute dictionary.
164
- # @param key [String] An attribute key.
165
- # @return [Boolean]
166
- #
167
- # @version SketchUp 6.0
168
- def delete_attribute(*args)
169
- end
170
-
171
- # The deleted? method is used to determine if your entity is still valid (not
172
- # deleted by another script, for example.)
173
- #
174
- # @example
175
- # depth = 100
176
- # width = 100
177
- # model = Sketchup.active_model
178
- # entities = model.active_entities
179
- # pts = []
180
- # pts[0] = [0, 0, 0]
181
- # pts[1] = [width, 0, 0]
182
- # pts[2] = [width, depth, 0]
183
- # pts[3] = [0, depth, 0]
184
- #
185
- # # Add the face to the entities in the model
186
- # face = entities.add_face pts
187
- # entity1 = entities[1]
188
- # status = entity1.deleted?
189
- #
190
- # @return [Boolean]
191
- #
192
- # @version SketchUp 6.0
193
- def deleted?
194
- end
195
-
196
- # The entityID method is used to retrieve a unique ID assigned to an entity.
197
- #
198
- # The entityID is not persistent between sessions.
199
- #
200
- # @example
201
- # depth = 100
202
- # width = 100
203
- # model = Sketchup.active_model
204
- # entities = model.active_entities
205
- # pts = []
206
- # pts[0] = [0, 0, 0]
207
- # pts[1] = [width, 0, 0]
208
- # pts[2] = [width, depth, 0]
209
- # pts[3] = [0, depth, 0]
210
- #
211
- # # Add the face to the entities in the model
212
- # face = entities.add_face pts
213
- # entity1 = entities[1]
214
- # id = entity1.entityID
215
- #
216
- # @return [Integer] the id for the Entity object
217
- #
218
- # @version SketchUp 6.0
219
- def entityID
220
- end
221
-
222
- # The {#get_attribute} method is used to retrieve the value of an attribute in
223
- # the entity's attribute dictionary.
224
- #
225
- # If the third parameter, +default_value+, is not passed and there is no
226
- # attribute that matches the given name, it returns +nil+.
227
- #
228
- # If +default_value+ is provided and there is no matching attribute it returns
229
- # the given value. It does not create an attribute with that name though.
230
- #
231
- # @example
232
- # # Add an entity to the model:
233
- # model = Sketchup.active_model
234
- # entities = model.active_entities
235
- # edge = entities.add_line([0, 0, 0], [9, 9, 9])
236
- #
237
- # # Read an attribute value from the edge. In this case this will return the
238
- # # default value provided; 42.
239
- # value = edge.get_attribute("MyExtension", "MyProperty", 42)
240
- #
241
- # @param [String] dict_name
242
- # The name of an attribute dictionary.
243
- #
244
- # @param [String] key
245
- # An attribute key.
246
- #
247
- # @param [Object] default_value
248
- # A default value to return if no attribute is found.
249
- #
250
- # @return [Object] the retrieved value
251
- #
252
- # @version SketchUp 6.0
253
- def get_attribute(dict_name, key, default_value = nil)
254
- end
255
-
256
- # The to_s method is used to retrieve the string representation of the entity.
257
- #
258
- # @example
259
- # depth = 100
260
- # width = 100
261
- # model = Sketchup.active_model
262
- # entities = model.active_entities
263
- # pts = []
264
- # pts[0] = [0, 0, 0]
265
- # pts[1] = [width, 0, 0]
266
- # pts[2] = [width, depth, 0]
267
- # pts[3] = [0, depth, 0]
268
- #
269
- # # Add the face to the entities in the model
270
- # face = entities.add_face pts
271
- #
272
- # # I just happen to know that the second and third entities in the
273
- # # entities objects are edges.
274
- # entity1 = entities[1]
275
- # st = entity1.to_s
276
- #
277
- # @return [String] the string representation of the entity if
278
- # successful
279
- #
280
- # @version SketchUp 6.0
281
- def inspect
282
- end
283
-
284
- # The model method is used to retrieve the model for the entity.
285
- #
286
- # @example
287
- # depth = 100
288
- # width = 100
289
- # model = Sketchup.active_model
290
- # entities = model.active_entities
291
- # pts = []
292
- # pts[0] = [0, 0, 0]
293
- # pts[1] = [width, 0, 0]
294
- # pts[2] = [width, depth, 0]
295
- # pts[3] = [0, depth, 0]
296
- #
297
- # # Add the face to the entities in the model
298
- # face = entities.add_face pts
299
- #
300
- # # I just happen to know that the second and third entities in the
301
- # # entities objects are edges.
302
- # entity1 = entities[1]
303
- # m = entity1.model
304
- #
305
- # @return [Sketchup::Model] the model that contains the Entity object
306
- #
307
- # @version SketchUp 6.0
308
- def model
309
- end
310
-
311
- # The parent method is used to retrieve the parent of the entity.
312
- #
313
- # The parent will be a ComponentDefinition, a Group, or a Model, whatever
314
- # the entity is contained within.
315
- #
316
- # @example
317
- # depth = 100
318
- # width = 100
319
- # model = Sketchup.active_model
320
- # entities = model.active_entities
321
- # pts = []
322
- # pts[0] = [0, 0, 0]
323
- # pts[1] = [width, 0, 0]
324
- # pts[2] = [width, depth, 0]
325
- # pts[3] = [0, depth, 0]
326
- #
327
- # # Add the face to the entities in the model
328
- # face = entities.add_face pts
329
- #
330
- # # I just happen to know that the second and third entities in the
331
- # # entities objects are edges.
332
- # entity1 = entities[1]
333
- # parent = entity1.parent
334
- #
335
- # @return [Sketchup::ComponentDefinition, Sketchup::Model] a Entity object
336
- # representing the parent of this entity
337
- #
338
- # @version SketchUp 6.0
339
- def parent
340
- end
341
-
342
- # The {#persistent_id} method is used to retrieve a unique persistent id
343
- # assigned to an entity.
344
- #
345
- # The persistent id persistent between sessions.
346
- #
347
- # [SketchUp 2020.1]
348
- # - {Sketchup::ComponentDefinition}
349
- # - {Sketchup::Material}
350
- # - {Sketchup::Style}
351
- # [SketchUp 2020.0]
352
- # - {Sketchup::Layer}
353
- # - {Sketchup::LineStyle}
354
- # [SketchUp 2018]
355
- # - {Sketchup::Page}
356
- # [SketchUp 2017]
357
- # - {Sketchup::ComponentInstance}
358
- # - {Sketchup::ConstructionLine}
359
- # - {Sketchup::ConstructionPoint}
360
- # - {Sketchup::Curve}
361
- # - {Sketchup::Dimension}
362
- # - {Sketchup::Edge}
363
- # - {Sketchup::Face}
364
- # - {Sketchup::Group}
365
- # - {Sketchup::Image}
366
- # - {Sketchup::SectionPlane}
367
- # - {Sketchup::Text}
368
- # - {Sketchup::Vertex}
369
- # - Polyline3d entities exposed only as {Sketchup::Drawingelement} Use
370
- # {#typename} to determine if a {Sketchup::Drawingelement} is
371
- # a +"Polyline3d"+.
372
- #
373
- # @example
374
- # model = Sketchup.active_model
375
- # entities = model.active_entities
376
- # pts = [
377
- # Geom::Point3d.new(0, 0, 0),
378
- # Geom::Point3d.new(9, 0, 0),
379
- # Geom::Point3d.new(9, 9, 0),
380
- # Geom::Point3d.new(0, 9, 0),
381
- # ]
382
- #
383
- # # Add the face to the entities in the model
384
- # group = entities.add_group
385
- # face = group.entities.add_face(pts)
386
- # pid = face.persistent_id
387
- # # Exploding the group will preserve the pid.
388
- # pid == face.persistent_id # Should return true
389
- #
390
- # @note Only a subset of entity types support PIDs. Refer to the table
391
- # below for which and when support was added. In general it is entities that
392
- # you can iterate over in a {Sketchup::Entities} collection.
393
- #
394
- # @return [Integer] the id for the {Sketchup::Entity} object
395
- #
396
- # @version SketchUp 2017
397
- def persistent_id
398
- end
399
-
400
- # The remove_observer method is used to remove an observer from the current
401
- # object.
402
- #
403
- # @example
404
- # entity = Sketchup.active_model.entities[0]
405
- # if entity.valid?
406
- # status = entity.remove_observer observer
407
- # end
408
- #
409
- # @param [Object] observer
410
- # An observer.
411
- #
412
- # @return [Boolean] true if successful, false if unsuccessful.
413
- #
414
- # @version SketchUp 6.0
415
- def remove_observer(observer)
416
- end
417
-
418
- # The set attribute is used to set the value of an attribute in an attribute
419
- # dictionary with the given name.
420
- #
421
- # This method will create a new AttributeDictionary if none exists.
422
- #
423
- # Note, a bug prior to SketchUp 2015 would corrupt the model if the key is
424
- # an empty string. This also includes values that will evaluate to empty
425
- # strings, such as nil.
426
- #
427
- # @example
428
- # depth = 100
429
- # width = 100
430
- # model = Sketchup.active_model
431
- # entities = model.active_entities
432
- # pts = []
433
- # pts[0] = [0, 0, 0]
434
- # pts[1] = [width, 0, 0]
435
- # pts[2] = [width, depth, 0]
436
- # pts[3] = [0, depth, 0]
437
- #
438
- # # Add the face to the entities in the model
439
- # face = entities.add_face pts
440
- #
441
- # # I just happen to know that the second and third entities in the
442
- # # entities objects are edges.
443
- # entity1 = entities[1]
444
- # status = entity1.set_attribute "testdictionary", "test", 115
445
- #
446
- # @param [String] dict_name
447
- # The name of an attribute dictionary.
448
- #
449
- # @param [String] key
450
- # An attribute key.
451
- #
452
- # @param [Object] value
453
- # The value for the attribute.
454
- #
455
- # @return [Object] the newly set value if successful
456
- #
457
- # @version SketchUp 6.0
458
- def set_attribute(dict_name, key, value)
459
- end
460
-
461
- # The to_s method is used to retrieve the string representation of the entity.
462
- #
463
- # @example
464
- # depth = 100
465
- # width = 100
466
- # model = Sketchup.active_model
467
- # entities = model.active_entities
468
- # pts = []
469
- # pts[0] = [0, 0, 0]
470
- # pts[1] = [width, 0, 0]
471
- # pts[2] = [width, depth, 0]
472
- # pts[3] = [0, depth, 0]
473
- #
474
- # # Add the face to the entities in the model
475
- # face = entities.add_face pts
476
- #
477
- # # I just happen to know that the second and third entities in the
478
- # # entities objects are edges.
479
- # entity1 = entities[1]
480
- # st = entity1.to_s
481
- #
482
- # @return [String] the string representation of the entity if
483
- # successful
484
- #
485
- # @version SketchUp 6.0
486
- def to_s
487
- end
488
-
489
- # The typename method retrieves the type of the entity, which will be a string
490
- # such as "Face", "Edge", or "Group".
491
- #
492
- # @example
493
- # depth = 100
494
- # width = 100
495
- # model = Sketchup.active_model
496
- # entities = model.active_entities
497
- # pts = []
498
- # pts[0] = [0, 0, 0]
499
- # pts[1] = [width, 0, 0]
500
- # pts[2] = [width, depth, 0]
501
- # pts[3] = [0, depth, 0]
502
- #
503
- # # Add the face to the entities in the model
504
- # face = entities.add_face pts
505
- #
506
- # # I just happen to know that the second and third entities in the
507
- # # entities objects are edges.
508
- # entity1 = entities[1]
509
- # type = entity1.typename
510
- #
511
- # @return [String] the type of the entity
512
- #
513
- # @version SketchUp 6.0
514
- def typename
515
- end
516
-
517
- # The valid? method is used to determine if your entity is still valid (not
518
- # deleted by another script, for example.)
519
- #
520
- # This method is functionally identical to the deleted? method.
521
- #
522
- # @example
523
- # depth = 100
524
- # width = 100
525
- # model = Sketchup.active_model
526
- # entities = model.active_entities
527
- # pts = []
528
- # pts[0] = [0, 0, 0]
529
- # pts[1] = [width, 0, 0]
530
- # pts[2] = [width, depth, 0]
531
- # pts[3] = [0, depth, 0]
532
- #
533
- # # Add the face to the entities in the model
534
- # face = entities.add_face pts
535
- # entity1 = entities[1]
536
- # status = entity1.valid?
537
- #
538
- # @return [Boolean]
539
- #
540
- # @version SketchUp 6.0
541
- def valid?
542
- end
543
-
544
- end
1
+ # Copyright:: Copyright 2022 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # This is the base class for all SketchUp entities. Entities are basically
5
+ # anything that can be contained in a model, including Drawingelements
6
+ # such as Edges, SectionPlanes, Groups, etc. and entities that relate to
7
+ # those Drawingelements, such as Loops, Layers, etc.
8
+ #
9
+ # Keep in mind that the methods below are available on all subclasses.
10
+ # For example, an Edge's parent class is Drawingelement, and a
11
+ # Drawingelement's parent class is Entity. Therefore an Edge has all of the
12
+ # methods defined in Drawingelement and Entity.
13
+ #
14
+ # The Object.is_a? method is the common way of determining what sort of Entity
15
+ # you're dealing with.
16
+ #
17
+ # @example
18
+ # # Count how many faces are in the current selection.
19
+ # selection = Sketchup.active_model.selection
20
+ # face_count = 0
21
+ #
22
+ # # Look at all of the entities in the selection.
23
+ # selection.each { |entity|
24
+ # if entity.is_a? Sketchup::Face
25
+ # face_count = face_count + 1
26
+ # end
27
+ # }
28
+ #
29
+ # UI.messagebox("There are " + face_count.to_s + " faces selected.")
30
+ #
31
+ # @version SketchUp 6.0
32
+ class Sketchup::Entity
33
+
34
+ # Instance Methods
35
+
36
+ # The add_observer method is used to add an observer to the current object.
37
+ #
38
+ # @example
39
+ # entity = Sketchup.active_model.entities[0]
40
+ # if entity.valid?
41
+ # status = entity.add_observer observer
42
+ # end
43
+ #
44
+ # @param [Object] observer
45
+ # An observer.
46
+ #
47
+ # @return [Boolean] true if successful, false if unsuccessful.
48
+ #
49
+ # @version SketchUp 6.0
50
+ def add_observer(observer)
51
+ end
52
+
53
+ # The attribute_dictionaries method is used to retrieve the
54
+ # AttributeDictionaries collection attached to the entity.
55
+ #
56
+ # @example
57
+ # depth = 100
58
+ # width = 100
59
+ # model = Sketchup.active_model
60
+ # entities = model.active_entities
61
+ # pts = []
62
+ # pts[0] = [0, 0, 0]
63
+ # pts[1] = [width, 0, 0]
64
+ # pts[2] = [width, depth, 0]
65
+ # pts[3] = [0, depth, 0]
66
+ #
67
+ # # Add the face to the entities in the model
68
+ # face = entities.add_face pts
69
+ #
70
+ # # I just happen to know that the second and third entities in the
71
+ # # entities objects are edges.
72
+ # entity1 = entities[1]
73
+ # status = entity1.set_attribute "testdictionary", "test", 115
74
+ # attrdicts = entity1.attribute_dictionaries
75
+ #
76
+ # @note The return value may be either +nil+ or an empty
77
+ # {Sketchup::AttributeDictionaries} collection if this entity has no
78
+ # {Sketchup::AttributeDictionary}s.
79
+ #
80
+ # @return [Sketchup::AttributeDictionaries, nil]
81
+ #
82
+ # @version SketchUp 6.0
83
+ def attribute_dictionaries
84
+ end
85
+
86
+ # The attribute_dictionary method is used to retrieve an attribute dictionary
87
+ # with a given name that is attached to an Entity.
88
+ #
89
+ # @example
90
+ # depth = 100
91
+ # width = 100
92
+ # model = Sketchup.active_model
93
+ # entities = model.active_entities
94
+ # pts = []
95
+ # pts[0] = [0, 0, 0]
96
+ # pts[1] = [width, 0, 0]
97
+ # pts[2] = [width, depth, 0]
98
+ # pts[3] = [0, depth, 0]
99
+ #
100
+ # # Add the face to the entities in the model
101
+ # face = entities.add_face pts
102
+ #
103
+ # # I just happen to know that the second and third entities in the
104
+ # # entities objects are edges.
105
+ # entity1 = entities[1]
106
+ # status = entity1.set_attribute "testdictionary", "test", 115
107
+ # attrdict = entity1.attribute_dictionary "testdictionary"
108
+ #
109
+ # @param [String] name
110
+ # The name of the attribute dictionary.
111
+ #
112
+ # @param [Boolean] create
113
+ # boolean, if set to true then the attribute
114
+ # dictionary will be created if it does not exist.
115
+ #
116
+ # @return [Sketchup::AttributeDictionary, nil] - an AttributeDictionary object
117
+ # if successful, or nil if there is no attribute dictionary
118
+ #
119
+ # @version SketchUp 6.0
120
+ def attribute_dictionary(name, create = false)
121
+ end
122
+
123
+ # The {#delete_attribute} method is used to delete an attribute from an entity.
124
+ #
125
+ # If only the dictionary_name is given, then it deletes the entire
126
+ # AttributeDictionary. Otherwise, {#delete_attribute} deletes the attribute with
127
+ # the given key from the given dictionary.
128
+ #
129
+ # @bug Prior to SketchUp 2019.0 the return values was always +true+.
130
+ #
131
+ # @example
132
+ # depth = 100
133
+ # width = 100
134
+ # model = Sketchup.active_model
135
+ # entities = model.active_entities
136
+ # pts = []
137
+ # pts[0] = [0, 0, 0]
138
+ # pts[1] = [width, 0, 0]
139
+ # pts[2] = [width, depth, 0]
140
+ # pts[3] = [0, depth, 0]
141
+ # # Add the face to the entities in the model
142
+ # face = entities.add_face pts
143
+ #
144
+ # # I just happen to know that the second and third entities in the
145
+ # # entities objects are edges.
146
+ # entity1 = entities[1]
147
+ # status = entity1.set_attribute "testdictionary", "test", 115
148
+ # status = entity1.delete_attribute "testdictionary"
149
+ #
150
+ # @note In SketchUp 2018, special attribute dictionaries have been added.
151
+ # The name of these dictionaries are "SU_InstanceSet" and "SU_DefinitionSet".
152
+ # The dictionaries cannot be deleted via ruby and an ArgumentError will be
153
+ # raised. The key/value pairs in the dictionary can be deleted safely.
154
+ #
155
+ # @overload delete_attribute(dictionary_name)
156
+ #
157
+ # @param [String] dictionary_name The name of an attribute dictionary.
158
+ # @return [Boolean]
159
+ #
160
+ # @overload delete_attribute(dictionary_name, key)
161
+ #
162
+ # @param [String] dictionary_name The name of an attribute dictionary.
163
+ # @param [String] key An attribute key.
164
+ # @return [Boolean]
165
+ #
166
+ # @version SketchUp 6.0
167
+ def delete_attribute(*args)
168
+ end
169
+
170
+ # The deleted? method is used to determine if your entity is still valid (not
171
+ # deleted by another script, for example.)
172
+ #
173
+ # @example
174
+ # depth = 100
175
+ # width = 100
176
+ # model = Sketchup.active_model
177
+ # entities = model.active_entities
178
+ # pts = []
179
+ # pts[0] = [0, 0, 0]
180
+ # pts[1] = [width, 0, 0]
181
+ # pts[2] = [width, depth, 0]
182
+ # pts[3] = [0, depth, 0]
183
+ #
184
+ # # Add the face to the entities in the model
185
+ # face = entities.add_face pts
186
+ # entity1 = entities[1]
187
+ # status = entity1.deleted?
188
+ #
189
+ # @return [Boolean]
190
+ #
191
+ # @version SketchUp 6.0
192
+ def deleted?
193
+ end
194
+
195
+ # The entityID method is used to retrieve a unique ID assigned to an entity.
196
+ #
197
+ # The entityID is not persistent between sessions.
198
+ #
199
+ # @example
200
+ # depth = 100
201
+ # width = 100
202
+ # model = Sketchup.active_model
203
+ # entities = model.active_entities
204
+ # pts = []
205
+ # pts[0] = [0, 0, 0]
206
+ # pts[1] = [width, 0, 0]
207
+ # pts[2] = [width, depth, 0]
208
+ # pts[3] = [0, depth, 0]
209
+ #
210
+ # # Add the face to the entities in the model
211
+ # face = entities.add_face pts
212
+ # entity1 = entities[1]
213
+ # id = entity1.entityID
214
+ #
215
+ # @return [Integer] the id for the Entity object
216
+ #
217
+ # @version SketchUp 6.0
218
+ def entityID
219
+ end
220
+
221
+ # The {#get_attribute} method is used to retrieve the value of an attribute in
222
+ # the entity's attribute dictionary.
223
+ #
224
+ # If the third parameter, +default_value+, is not passed and there is no
225
+ # attribute that matches the given name, it returns +nil+.
226
+ #
227
+ # If +default_value+ is provided and there is no matching attribute it returns
228
+ # the given value. It does not create an attribute with that name though.
229
+ #
230
+ # @example
231
+ # # Add an entity to the model:
232
+ # model = Sketchup.active_model
233
+ # entities = model.active_entities
234
+ # edge = entities.add_line([0, 0, 0], [9, 9, 9])
235
+ #
236
+ # # Read an attribute value from the edge. In this case this will return the
237
+ # # default value provided; 42.
238
+ # value = edge.get_attribute("MyExtension", "MyProperty", 42)
239
+ #
240
+ # @param [String] dict_name
241
+ # The name of an attribute dictionary.
242
+ #
243
+ # @param [String] key
244
+ # An attribute key.
245
+ #
246
+ # @param [Object] default_value
247
+ # A default value to return if no attribute is found.
248
+ #
249
+ # @return [Object] the retrieved value
250
+ #
251
+ # @version SketchUp 6.0
252
+ def get_attribute(dict_name, key, default_value = nil)
253
+ end
254
+
255
+ # The to_s method is used to retrieve the string representation of the entity.
256
+ #
257
+ # @example
258
+ # depth = 100
259
+ # width = 100
260
+ # model = Sketchup.active_model
261
+ # entities = model.active_entities
262
+ # pts = []
263
+ # pts[0] = [0, 0, 0]
264
+ # pts[1] = [width, 0, 0]
265
+ # pts[2] = [width, depth, 0]
266
+ # pts[3] = [0, depth, 0]
267
+ #
268
+ # # Add the face to the entities in the model
269
+ # face = entities.add_face pts
270
+ #
271
+ # # I just happen to know that the second and third entities in the
272
+ # # entities objects are edges.
273
+ # entity1 = entities[1]
274
+ # st = entity1.to_s
275
+ #
276
+ # @return [String] the string representation of the entity if
277
+ # successful
278
+ #
279
+ # @version SketchUp 6.0
280
+ def inspect
281
+ end
282
+
283
+ # The model method is used to retrieve the model for the entity.
284
+ #
285
+ # @example
286
+ # depth = 100
287
+ # width = 100
288
+ # model = Sketchup.active_model
289
+ # entities = model.active_entities
290
+ # pts = []
291
+ # pts[0] = [0, 0, 0]
292
+ # pts[1] = [width, 0, 0]
293
+ # pts[2] = [width, depth, 0]
294
+ # pts[3] = [0, depth, 0]
295
+ #
296
+ # # Add the face to the entities in the model
297
+ # face = entities.add_face pts
298
+ #
299
+ # # I just happen to know that the second and third entities in the
300
+ # # entities objects are edges.
301
+ # entity1 = entities[1]
302
+ # m = entity1.model
303
+ #
304
+ # @return [Sketchup::Model] the model that contains the Entity object
305
+ #
306
+ # @version SketchUp 6.0
307
+ def model
308
+ end
309
+
310
+ # The parent method is used to retrieve the parent of the entity.
311
+ #
312
+ # The parent will be a ComponentDefinition, a Group, or a Model, whatever
313
+ # the entity is contained within.
314
+ #
315
+ # @example
316
+ # depth = 100
317
+ # width = 100
318
+ # model = Sketchup.active_model
319
+ # entities = model.active_entities
320
+ # pts = []
321
+ # pts[0] = [0, 0, 0]
322
+ # pts[1] = [width, 0, 0]
323
+ # pts[2] = [width, depth, 0]
324
+ # pts[3] = [0, depth, 0]
325
+ #
326
+ # # Add the face to the entities in the model
327
+ # face = entities.add_face pts
328
+ #
329
+ # # I just happen to know that the second and third entities in the
330
+ # # entities objects are edges.
331
+ # entity1 = entities[1]
332
+ # parent = entity1.parent
333
+ #
334
+ # @return [Sketchup::ComponentDefinition, Sketchup::Model] a Entity object
335
+ # representing the parent of this entity
336
+ #
337
+ # @version SketchUp 6.0
338
+ def parent
339
+ end
340
+
341
+ # The {#persistent_id} method is used to retrieve a unique persistent id
342
+ # assigned to an entity.
343
+ #
344
+ # The persistent id persistent between sessions.
345
+ #
346
+ # [SketchUp 2020.1]
347
+ # - {Sketchup::ComponentDefinition}
348
+ # - {Sketchup::Material}
349
+ # - {Sketchup::Style}
350
+ # [SketchUp 2020.0]
351
+ # - {Sketchup::Layer}
352
+ # - {Sketchup::LineStyle}
353
+ # [SketchUp 2018]
354
+ # - {Sketchup::Page}
355
+ # [SketchUp 2017]
356
+ # - {Sketchup::ComponentInstance}
357
+ # - {Sketchup::ConstructionLine}
358
+ # - {Sketchup::ConstructionPoint}
359
+ # - {Sketchup::Curve}
360
+ # - {Sketchup::Dimension}
361
+ # - {Sketchup::Edge}
362
+ # - {Sketchup::Face}
363
+ # - {Sketchup::Group}
364
+ # - {Sketchup::Image}
365
+ # - {Sketchup::SectionPlane}
366
+ # - {Sketchup::Text}
367
+ # - {Sketchup::Vertex}
368
+ # - Polyline3d entities exposed only as {Sketchup::Drawingelement} Use
369
+ # {#typename} to determine if a {Sketchup::Drawingelement} is
370
+ # a +"Polyline3d"+.
371
+ #
372
+ # @example
373
+ # model = Sketchup.active_model
374
+ # entities = model.active_entities
375
+ # pts = [
376
+ # Geom::Point3d.new(0, 0, 0),
377
+ # Geom::Point3d.new(9, 0, 0),
378
+ # Geom::Point3d.new(9, 9, 0),
379
+ # Geom::Point3d.new(0, 9, 0),
380
+ # ]
381
+ #
382
+ # # Add the face to the entities in the model
383
+ # group = entities.add_group
384
+ # face = group.entities.add_face(pts)
385
+ # pid = face.persistent_id
386
+ # # Exploding the group will preserve the pid.
387
+ # pid == face.persistent_id # Should return true
388
+ #
389
+ # @note Only a subset of entity types support PIDs. Refer to the table
390
+ # below for which and when support was added. In general it is entities that
391
+ # you can iterate over in a {Sketchup::Entities} collection.
392
+ #
393
+ # @return [Integer] the id for the {Sketchup::Entity} object
394
+ #
395
+ # @version SketchUp 2017
396
+ def persistent_id
397
+ end
398
+
399
+ # The remove_observer method is used to remove an observer from the current
400
+ # object.
401
+ #
402
+ # @example
403
+ # entity = Sketchup.active_model.entities[0]
404
+ # if entity.valid?
405
+ # status = entity.remove_observer observer
406
+ # end
407
+ #
408
+ # @param [Object] observer
409
+ # An observer.
410
+ #
411
+ # @return [Boolean] true if successful, false if unsuccessful.
412
+ #
413
+ # @version SketchUp 6.0
414
+ def remove_observer(observer)
415
+ end
416
+
417
+ # The set attribute is used to set the value of an attribute in an attribute
418
+ # dictionary with the given name.
419
+ #
420
+ # This method will create a new AttributeDictionary if none exists.
421
+ #
422
+ # Note, a bug prior to SketchUp 2015 would corrupt the model if the key is
423
+ # an empty string. This also includes values that will evaluate to empty
424
+ # strings, such as nil.
425
+ #
426
+ # @example
427
+ # depth = 100
428
+ # width = 100
429
+ # model = Sketchup.active_model
430
+ # entities = model.active_entities
431
+ # pts = []
432
+ # pts[0] = [0, 0, 0]
433
+ # pts[1] = [width, 0, 0]
434
+ # pts[2] = [width, depth, 0]
435
+ # pts[3] = [0, depth, 0]
436
+ #
437
+ # # Add the face to the entities in the model
438
+ # face = entities.add_face pts
439
+ #
440
+ # # I just happen to know that the second and third entities in the
441
+ # # entities objects are edges.
442
+ # entity1 = entities[1]
443
+ # status = entity1.set_attribute "testdictionary", "test", 115
444
+ #
445
+ # @param [String] dict_name
446
+ # The name of an attribute dictionary.
447
+ #
448
+ # @param [String] key
449
+ # An attribute key.
450
+ #
451
+ # @param [Object] value
452
+ # The value for the attribute.
453
+ #
454
+ # @return [Object] the newly set value if successful
455
+ #
456
+ # @version SketchUp 6.0
457
+ def set_attribute(dict_name, key, value)
458
+ end
459
+
460
+ # The to_s method is used to retrieve the string representation of the entity.
461
+ #
462
+ # @example
463
+ # depth = 100
464
+ # width = 100
465
+ # model = Sketchup.active_model
466
+ # entities = model.active_entities
467
+ # pts = []
468
+ # pts[0] = [0, 0, 0]
469
+ # pts[1] = [width, 0, 0]
470
+ # pts[2] = [width, depth, 0]
471
+ # pts[3] = [0, depth, 0]
472
+ #
473
+ # # Add the face to the entities in the model
474
+ # face = entities.add_face pts
475
+ #
476
+ # # I just happen to know that the second and third entities in the
477
+ # # entities objects are edges.
478
+ # entity1 = entities[1]
479
+ # st = entity1.to_s
480
+ #
481
+ # @return [String] the string representation of the entity if
482
+ # successful
483
+ #
484
+ # @version SketchUp 6.0
485
+ def to_s
486
+ end
487
+
488
+ # The typename method retrieves the type of the entity, which will be a string
489
+ # such as "Face", "Edge", or "Group".
490
+ #
491
+ # @example
492
+ # depth = 100
493
+ # width = 100
494
+ # model = Sketchup.active_model
495
+ # entities = model.active_entities
496
+ # pts = []
497
+ # pts[0] = [0, 0, 0]
498
+ # pts[1] = [width, 0, 0]
499
+ # pts[2] = [width, depth, 0]
500
+ # pts[3] = [0, depth, 0]
501
+ #
502
+ # # Add the face to the entities in the model
503
+ # face = entities.add_face pts
504
+ #
505
+ # # I just happen to know that the second and third entities in the
506
+ # # entities objects are edges.
507
+ # entity1 = entities[1]
508
+ # type = entity1.typename
509
+ #
510
+ # @note Prefer +is_a?+ over +typename+ when possible as it is faster.
511
+ #
512
+ # @return [String] the type of the entity
513
+ #
514
+ # @version SketchUp 6.0
515
+ def typename
516
+ end
517
+
518
+ # The {#valid?} method is used to determine if your entity is still valid (not
519
+ # deleted by another script, for example).
520
+ #
521
+ # This method is functionally the inverse to the {#deleted?} method.
522
+ #
523
+ # @example
524
+ # depth = 100
525
+ # width = 100
526
+ # model = Sketchup.active_model
527
+ # entities = model.active_entities
528
+ # pts = []
529
+ # pts[0] = [0, 0, 0]
530
+ # pts[1] = [width, 0, 0]
531
+ # pts[2] = [width, depth, 0]
532
+ # pts[3] = [0, depth, 0]
533
+ #
534
+ # # Add the face to the entities in the model
535
+ # face = entities.add_face pts
536
+ # entity1 = entities[1]
537
+ # status = entity1.valid?
538
+ #
539
+ # @return [Boolean]
540
+ #
541
+ # @version SketchUp 6.0
542
+ def valid?
543
+ end
544
+
545
+ end