sketchup-api-stubs 0.7.9 → 0.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +157 -151
  3. data/lib/sketchup-api-stubs/stubs/Array.rb +741 -741
  4. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -322
  5. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +182 -172
  6. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +111 -126
  7. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +423 -400
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +693 -661
  10. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +535 -509
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +500 -476
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +267 -263
  13. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +133 -141
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +547 -522
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +678 -693
  16. data/lib/sketchup-api-stubs/stubs/Geom.rb +351 -351
  17. data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +93 -93
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -595
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +751 -747
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -183
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  22. data/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb +234 -0
  23. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +683 -517
  24. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
  26. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +464 -353
  27. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
  28. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  29. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  30. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  31. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -370
  32. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  33. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  34. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -225
  35. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +614 -567
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  37. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  38. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +282 -183
  39. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +458 -387
  40. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -209
  41. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +346 -344
  42. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  43. data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +82 -82
  44. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +714 -692
  45. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1565 -1519
  46. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  48. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  49. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  50. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  51. data/lib/sketchup-api-stubs/stubs/Length.rb +286 -278
  52. data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +196 -144
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +226 -209
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +145 -150
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +294 -281
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +296 -302
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +473 -478
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -121
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +673 -659
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +600 -593
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +252 -257
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -201
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +443 -449
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +167 -165
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +403 -406
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -397
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1282 -1239
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -261
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +519 -545
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Environment.rb +406 -0
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Environments.rb +185 -0
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb +113 -0
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +122 -125
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +1006 -937
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -102
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +740 -750
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +289 -282
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +64 -62
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +405 -468
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +432 -406
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +307 -306
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +332 -326
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +380 -422
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +409 -427
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +241 -249
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +55 -48
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +114 -114
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb +70 -0
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1115 -414
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +330 -317
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1714 -1652
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +372 -357
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +133 -130
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -271
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +463 -490
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +104 -116
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +939 -797
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +388 -361
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +501 -478
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +385 -361
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +451 -458
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +211 -212
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +259 -255
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
  135. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
  136. data/lib/sketchup-api-stubs/stubs/Sketchup/Snap.rb +125 -0
  137. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +88 -69
  138. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +263 -217
  139. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +283 -262
  140. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +199 -217
  141. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  142. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +924 -834
  143. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  144. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
  145. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
  146. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +143 -142
  147. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1566 -1311
  148. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +71 -45
  149. data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1429 -1377
  150. data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
  151. data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
  152. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +399 -389
  153. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +580 -494
  154. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +280 -269
  155. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +258 -241
  156. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +636 -635
  157. data/lib/sketchup-api-stubs/stubs/UI.rb +791 -683
  158. data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -303
  159. data/lib/sketchup-api-stubs.rb +1 -1
  160. metadata +10 -24
@@ -1,545 +1,519 @@
1
- # Copyright:: Copyright 2023 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
1
+ # Copyright:: Copyright 2026 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
+ # "There are #{face_count} 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 {#inspect} method is used to retrieve the string representation of the entity.
256
+ #
257
+ # @example
258
+ # model = Sketchup.active_model
259
+ # entities = model.active_entities
260
+ # edge = entities.add_line(Geom::Point3d.new(0, 0, 0), Geom::Point3d.new(9, 9, 9))
261
+ # string = edge.inspect
262
+ #
263
+ # @return [String]
264
+ #
265
+ # @see #to_s
266
+ #
267
+ # @version SketchUp 6.0
268
+ def inspect
269
+ end
270
+
271
+ # The model method is used to retrieve the model for the entity.
272
+ #
273
+ # @example
274
+ # depth = 100
275
+ # width = 100
276
+ # model = Sketchup.active_model
277
+ # entities = model.active_entities
278
+ # pts = []
279
+ # pts[0] = [0, 0, 0]
280
+ # pts[1] = [width, 0, 0]
281
+ # pts[2] = [width, depth, 0]
282
+ # pts[3] = [0, depth, 0]
283
+ #
284
+ # # Add the face to the entities in the model
285
+ # face = entities.add_face pts
286
+ #
287
+ # # I just happen to know that the second and third entities in the
288
+ # # entities objects are edges.
289
+ # entity1 = entities[1]
290
+ # m = entity1.model
291
+ #
292
+ # @return [Sketchup::Model] the model that contains the Entity object
293
+ #
294
+ # @version SketchUp 6.0
295
+ def model
296
+ end
297
+
298
+ # The parent method is used to retrieve the parent of the entity.
299
+ #
300
+ # The parent will be a ComponentDefinition, a Group, a Model, or whatever
301
+ # the entity is contained within.
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, 0]
310
+ # pts[1] = [width, 0, 0]
311
+ # pts[2] = [width, depth, 0]
312
+ # pts[3] = [0, depth, 0]
313
+ #
314
+ # # Add the face to the entities in the model
315
+ # face = entities.add_face pts
316
+ #
317
+ # # I just happen to know that the second and third entities in the
318
+ # # entities objects are edges.
319
+ # entity1 = entities[1]
320
+ # parent = entity1.parent
321
+ #
322
+ # @return [Sketchup::ComponentDefinition, Sketchup::Model] a Entity object
323
+ # representing the parent of this entity
324
+ #
325
+ # @version SketchUp 6.0
326
+ def parent
327
+ end
328
+
329
+ # The {#persistent_id} method is used to retrieve a unique persistent id
330
+ # assigned to an entity.
331
+ #
332
+ # The persistent id persistent between sessions.
333
+ #
334
+ # [SketchUp 2020.1]
335
+ # - {Sketchup::ComponentDefinition}
336
+ # - {Sketchup::Material}
337
+ # - {Sketchup::Style}
338
+ # [SketchUp 2020.0]
339
+ # - {Sketchup::Layer}
340
+ # - {Sketchup::LineStyle}
341
+ # [SketchUp 2018]
342
+ # - {Sketchup::Page}
343
+ # [SketchUp 2017]
344
+ # - {Sketchup::ComponentInstance}
345
+ # - {Sketchup::ConstructionLine}
346
+ # - {Sketchup::ConstructionPoint}
347
+ # - {Sketchup::Curve}
348
+ # - {Sketchup::Dimension}
349
+ # - {Sketchup::Edge}
350
+ # - {Sketchup::Face}
351
+ # - {Sketchup::Group}
352
+ # - {Sketchup::Image}
353
+ # - {Sketchup::SectionPlane}
354
+ # - {Sketchup::Text}
355
+ # - {Sketchup::Vertex}
356
+ # - Polyline3d entities exposed only as {Sketchup::Drawingelement} Use
357
+ # {#typename} to determine if a {Sketchup::Drawingelement} is
358
+ # a +"Polyline3d"+.
359
+ #
360
+ # @example
361
+ # model = Sketchup.active_model
362
+ # entities = model.active_entities
363
+ # pts = [
364
+ # Geom::Point3d.new(0, 0, 0),
365
+ # Geom::Point3d.new(9, 0, 0),
366
+ # Geom::Point3d.new(9, 9, 0),
367
+ # Geom::Point3d.new(0, 9, 0),
368
+ # ]
369
+ #
370
+ # # Add the face to the entities in the model
371
+ # group = entities.add_group
372
+ # face = group.entities.add_face(pts)
373
+ # pid = face.persistent_id
374
+ # # Exploding the group will preserve the pid.
375
+ # pid == face.persistent_id # Should return true
376
+ #
377
+ # @note Only a subset of entity types support PIDs. Refer to the table
378
+ # below for which and when support was added. In general it is entities that
379
+ # you can iterate over in a {Sketchup::Entities} collection.
380
+ #
381
+ # @return [Integer] the id for the {Sketchup::Entity} object
382
+ #
383
+ # @version SketchUp 2017
384
+ def persistent_id
385
+ end
386
+
387
+ # The remove_observer method is used to remove an observer from the current
388
+ # object.
389
+ #
390
+ # @example
391
+ # entity = Sketchup.active_model.entities[0]
392
+ # if entity.valid?
393
+ # status = entity.remove_observer observer
394
+ # end
395
+ #
396
+ # @param [Object] observer
397
+ # An observer.
398
+ #
399
+ # @return [Boolean] true if successful, false if unsuccessful.
400
+ #
401
+ # @version SketchUp 6.0
402
+ def remove_observer(observer)
403
+ end
404
+
405
+ # The set attribute is used to set the value of an attribute in an attribute
406
+ # dictionary with the given name.
407
+ #
408
+ # This method will create a new AttributeDictionary if none exists.
409
+ #
410
+ # Note, a bug prior to SketchUp 2015 would corrupt the model if the key is
411
+ # an empty string. This also includes values that will evaluate to empty
412
+ # strings, such as nil.
413
+ #
414
+ # @example
415
+ # depth = 100
416
+ # width = 100
417
+ # model = Sketchup.active_model
418
+ # entities = model.active_entities
419
+ # pts = []
420
+ # pts[0] = [0, 0, 0]
421
+ # pts[1] = [width, 0, 0]
422
+ # pts[2] = [width, depth, 0]
423
+ # pts[3] = [0, depth, 0]
424
+ #
425
+ # # Add the face to the entities in the model
426
+ # face = entities.add_face pts
427
+ #
428
+ # # I just happen to know that the second and third entities in the
429
+ # # entities objects are edges.
430
+ # entity1 = entities[1]
431
+ # status = entity1.set_attribute "testdictionary", "test", 115
432
+ #
433
+ # @param [String] dict_name
434
+ # The name of an attribute dictionary.
435
+ #
436
+ # @param [String] key
437
+ # An attribute key.
438
+ #
439
+ # @param [Object] value
440
+ # The value for the attribute.
441
+ #
442
+ # @return [Object] the newly set value if successful
443
+ #
444
+ # @version SketchUp 6.0
445
+ def set_attribute(dict_name, key, value)
446
+ end
447
+
448
+ # The {#to_s} method is used to retrieve the string representation of the entity.
449
+ #
450
+ # @example
451
+ # model = Sketchup.active_model
452
+ # entities = model.active_entities
453
+ # edge = entities.add_line(Geom::Point3d.new(0, 0, 0), Geom::Point3d.new(9, 9, 9))
454
+ # string = edge.to_s
455
+ #
456
+ # @return [String]
457
+ #
458
+ # @version SketchUp 6.0
459
+ def to_s
460
+ end
461
+
462
+ # The typename method retrieves the type of the entity, which will be a string
463
+ # such as "Face", "Edge", or "Group".
464
+ #
465
+ # @example
466
+ # depth = 100
467
+ # width = 100
468
+ # model = Sketchup.active_model
469
+ # entities = model.active_entities
470
+ # pts = []
471
+ # pts[0] = [0, 0, 0]
472
+ # pts[1] = [width, 0, 0]
473
+ # pts[2] = [width, depth, 0]
474
+ # pts[3] = [0, depth, 0]
475
+ #
476
+ # # Add the face to the entities in the model
477
+ # face = entities.add_face pts
478
+ #
479
+ # # I just happen to know that the second and third entities in the
480
+ # # entities objects are edges.
481
+ # entity1 = entities[1]
482
+ # type = entity1.typename
483
+ #
484
+ # @note Prefer +is_a?+ over +typename+ when possible as it is faster.
485
+ #
486
+ # @return [String] the type of the entity
487
+ #
488
+ # @version SketchUp 6.0
489
+ def typename
490
+ end
491
+
492
+ # The {#valid?} method is used to determine if your entity is still valid (not
493
+ # deleted by another script, for example).
494
+ #
495
+ # This method is functionally the inverse to the {#deleted?} method.
496
+ #
497
+ # @example
498
+ # depth = 100
499
+ # width = 100
500
+ # model = Sketchup.active_model
501
+ # entities = model.active_entities
502
+ # pts = []
503
+ # pts[0] = [0, 0, 0]
504
+ # pts[1] = [width, 0, 0]
505
+ # pts[2] = [width, depth, 0]
506
+ # pts[3] = [0, depth, 0]
507
+ #
508
+ # # Add the face to the entities in the model
509
+ # face = entities.add_face pts
510
+ # entity1 = entities[1]
511
+ # status = entity1.valid?
512
+ #
513
+ # @return [Boolean]
514
+ #
515
+ # @version SketchUp 6.0
516
+ def valid?
517
+ end
518
+
519
+ end