sketchup-api-stubs 0.7.4 → 0.7.5

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 (150) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs.rb +1 -1
  3. data/lib/sketchup-api-stubs/sketchup.rb +147 -145
  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 +498 -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 +691 -691
  16. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  17. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -573
  18. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +179 -174
  20. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  21. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +515 -514
  22. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  23. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -143
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
  25. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
  26. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  27. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  28. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  29. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -371
  30. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  31. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  32. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -220
  33. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
  34. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  36. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  37. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
  38. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -204
  39. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  40. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  41. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -694
  42. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  43. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  44. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  47. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -140
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +286 -281
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -328
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -577
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -281
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +577 -562
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +604 -593
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -194
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +362 -329
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -72
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -102
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -312
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -38
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +396 -390
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +502 -508
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1126 -1119
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -125
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -544
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -59
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +126 -125
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +751 -750
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +699 -697
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +417 -409
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -226
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -190
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +405 -393
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -82
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -303
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +327 -285
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -244
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -136
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -112
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -416
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +318 -311
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -141
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -95
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1651 -1638
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -356
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +131 -132
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -770
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +363 -353
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -76
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -456
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -44
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +459 -454
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +257 -257
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -57
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -211
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -225
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +835 -829
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -154
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +71 -61
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1307 -1301
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
  135. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +317 -310
  136. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +387 -356
  137. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +255 -229
  138. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
  139. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
  140. data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
  141. data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
  142. data/lib/sketchup-api-stubs/stubs/geom.rb +351 -348
  143. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
  144. data/lib/sketchup-api-stubs/stubs/length.rb +278 -278
  145. data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
  146. data/lib/sketchup-api-stubs/stubs/sketchup.rb +1342 -1310
  147. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
  148. data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
  149. data/lib/sketchup-api-stubs/stubs/ui.rb +668 -667
  150. metadata +4 -2
@@ -1,562 +1,577 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # The {Sketchup::ComponentDefinition} class is used to define the contents for
5
- # a SketchUp component. Components are a collection of entities that can be
6
- # instanced and reused multiple times throughout a model. For example, you
7
- # could draw a chair once, turn it into a component, and then use 6 instances
8
- # of it to surround a table. Edits to the original "definition" will then
9
- # propagate across all of its instances.
10
- #
11
- # The ComponentDefinition class contains the global entities and settings for
12
- # each definition. See the {Sketchup::ComponentInstance} class for how each
13
- # copy is defined.
14
- #
15
- # Starting from SketchUp 2018+, the {Sketchup::ComponentDefinition} class
16
- # contains a new default attribute dictionary named "SU_DefinitionSet" with
17
- # default keys named named "Price", "Size", "Url". See the
18
- # {https://help.sketchup.com/en/article/3000124 Help article} for more
19
- # information. The dictionary cannot be deleted via ruby and an ArgumentError
20
- # will be raised. The key/value pairs in the dictionary can be deleted safely.
21
- #
22
- # @version SketchUp 6.0
23
- class Sketchup::ComponentDefinition < Sketchup::Drawingelement
24
-
25
- # Includes
26
-
27
- include Comparable
28
-
29
- # Instance Methods
30
-
31
- # The <=> method is used to compare two ComponentDefinition objects for
32
- # sorting. The comparison is done based on the component name.
33
- #
34
- # @example
35
- # c1=Sketchup.find_support_file "Bed.skp",
36
- # "Components/Components Sampler/"
37
- # c2=Sketchup.find_support_file "Fence.skp",
38
- # "Components/Components Sampler/"
39
- # if c1 <=> c2
40
- # UI.messagebox("c1 sorts before c2")
41
- # end
42
- #
43
- # @param [Sketchup::ComponentDefinition] compdef2
44
- # The second component definition in the comparison.
45
- #
46
- # @return [Integer] a -1 if component1 is less then component2. A 1
47
- # if component1 greater than component2
48
- #
49
- # @version SketchUp 6.0
50
- def <=>(compdef2)
51
- end
52
-
53
- # The == method is used to test if two ComponentDefinition objects are the
54
- # same (based on their address in memory).
55
- #
56
- # @example
57
- # c1=Sketchup.find_support_file "Bed.skp",
58
- # "Components/Components Sampler/"
59
- # c2=Sketchup.find_support_file "Fence.skp",
60
- # "Components/Components Sampler/"
61
- # if c1 == c2
62
- # UI.messagebox("These definitions are the same.")
63
- # end
64
- #
65
- # @param [Sketchup::ComponentDefinition] compdef2
66
- # The second component definition in the comparison.
67
- #
68
- # @return [Boolean] true if the ComponentDefinition objects are
69
- # the same object. False if the objects are not the same.
70
- #
71
- # @version SketchUp 6.0
72
- def ==(compdef2)
73
- end
74
-
75
- # The add_classification method is used to add a given classification to
76
- # the component.
77
- #
78
- # Note that you cannot classify image definitions.
79
- #
80
- # @example
81
- # definition = Sketchup.active_model.definitions.first
82
- # success = definition.add_classification("IFC 2x3", "IfcDoor")
83
- #
84
- # @param [String] schema_name
85
- # a String - Schema name to add
86
- #
87
- # @param [String] schema_type
88
- # a String - Schema type to add
89
- #
90
- # @return [Boolean] true if the classification succeeds. Otherwise false.
91
- #
92
- # @version SketchUp 2015
93
- def add_classification(schema_name, schema_type)
94
- end
95
-
96
- # The add_observer method is used to add an observer to the current object.
97
- #
98
- # @example
99
- # componentdefinition = Sketchup.active_model.definitions[0]
100
- # status = componentdefinition.add_observer observer
101
- #
102
- # @param [Object] observer
103
- # An observer.
104
- #
105
- # @return [Boolean] true if successful, false if unsuccessful.
106
- #
107
- # @version SketchUp 6.0
108
- def add_observer(observer)
109
- end
110
-
111
- # The behavior method is used to retrieve the Behavior object associated with
112
- # a component definition.
113
- #
114
- # @example
115
- # path = Sketchup.find_support_file "Bed.skp",
116
- # "Components/Components Sampler/"
117
- # model = Sketchup.active_model
118
- # definitions = model.definitions
119
- # componentdefinition = definitions.load path
120
- # behavior = componentdefinition.behavior
121
- #
122
- # @return [Sketchup::Behavior] a Behavior object if successful
123
- #
124
- # @version SketchUp 6.0
125
- def behavior
126
- end
127
-
128
- # The count_instances method is used to count the number of unique component
129
- # instances in a model using this component definition. This does not represent
130
- # the total number of instances placed in the model as it doesn't take into
131
- # account instances inside unused definitions.
132
- #
133
- # @example
134
- # path = Sketchup.find_support_file('Bed.skp',
135
- # 'Components/Components Sampler/')
136
- # definitions = Sketchup.active_model.definitions
137
- # definition = definitions.load(path)
138
- # number = definition.count_instances
139
- #
140
- # @return [Integer] the number of component instances of this
141
- # component definition (if successful)
142
- #
143
- # @version SketchUp 6.0
144
- def count_instances
145
- end
146
-
147
- # The count_used_instances method is used to count the total number of
148
- # component instances in a model using this component definition. This method
149
- # takes into account the full hierarchy of the model.
150
- #
151
- # @example
152
- # path = Sketchup.find_support_file('Bed.skp',
153
- # 'Components/Components Sampler/')
154
- # definitions = Sketchup.active_model.definitions
155
- # definition = definitions.load(path)
156
- # number = definition.count_used_instances
157
- #
158
- # @return [Integer] the number of component instances of this
159
- # component definition (if successful)
160
- #
161
- # @version SketchUp 2016
162
- def count_used_instances
163
- end
164
-
165
- # The description method is used to retrieve the description of the component
166
- # definition.
167
- #
168
- # Component definitions do not have a description, by default.
169
- #
170
- # @example
171
- # # Get the description
172
- # componentdefinition = Sketchup.active_model.definitions[0]
173
- # description = componentdefinition.description
174
- #
175
- # @return [String] the description of the component definition if successful
176
- #
177
- # @version SketchUp 6.0
178
- def description
179
- end
180
-
181
- # The description= method is used to set the description for the component
182
- # definition.
183
- #
184
- # @example
185
- # componentdefinition = Sketchup.active_model.definitions[0]
186
- # componentdefinition.description = "This is a traditional bed"
187
- # description = componentdefinition.description
188
- #
189
- # @param [String] description
190
- #
191
- # @return [String] the description if successful, false if
192
- # unsuccessful
193
- #
194
- # @version SketchUp 6.0
195
- def description=(description)
196
- end
197
-
198
- # The entities method retrieves a collection of all the entities in the
199
- # component definition
200
- #
201
- # @example
202
- # componentdefinition = Sketchup.active_model.definitions[0]
203
- # entities = componentdefinition.entities
204
- #
205
- # @return [Sketchup::Entities] an Entities object if successful
206
- #
207
- # @version SketchUp 6.0
208
- def entities
209
- end
210
-
211
- # The get_classification_value method is used to retrieve the value from
212
- # a classification attribute given a key path.
213
- #
214
- # @example
215
- # definition = Sketchup.active_model.definitions.first
216
- # definition.add_classification("IFC 2x3", "IfcDoor")
217
- #
218
- # path = ["IFC 2x3", "IfcDoor", "ObjectType", "IfcLabel"]
219
- # value = definition.get_classification_value(path)
220
- #
221
- # @param [Array<String>] path
222
- # An array composed of the key path to the value.
223
- #
224
- # @return [Object, nil] a Ruby object if successful, nil otherwise.
225
- #
226
- # @version SketchUp 2015
227
- def get_classification_value(path)
228
- end
229
-
230
- # The group? method is used to determine if this component definition is used
231
- # to hold the elements of a group.
232
- #
233
- # @example
234
- # path = Sketchup.find_support_file "Bed.skp",
235
- # "Components/Components Sampler/"
236
- # model = Sketchup.active_model
237
- # definitions = model.definitions
238
- # componentdefinition = definitions.load path
239
- # status = componentdefinition.group?
240
- #
241
- # @return [Boolean]
242
- #
243
- # @version SketchUp 6.0
244
- def group?
245
- end
246
-
247
- # The guid method is used to retrieve the unique identifier of this component
248
- # definition. The guid changes after the component definition is modified and
249
- # the component edit is exited.
250
- #
251
- # @example
252
- # componentdefinition = Sketchup.active_model.definitions[0]
253
- # guid = componentdefinition.guid
254
- #
255
- # @return [String] a string guid if successful
256
- #
257
- # @version SketchUp 6.0
258
- def guid
259
- end
260
-
261
- # The hidden method is used to determine if this component definition should
262
- # be hidden on the component browser.
263
- #
264
- # @example
265
- # componentdefinition = Sketchup.active_model.definitions[0]
266
- # status = componentdefinition.hidden?
267
- #
268
- # @return [Boolean]
269
- #
270
- # @version SketchUp 6.0
271
- def hidden?
272
- end
273
-
274
- # The image? method is used to determine if this component definition is used
275
- # to define an image.
276
- #
277
- # @example
278
- # componentdefinition = Sketchup.active_model.definitions[0]
279
- # status = componentdefinition.image?
280
- # if (status)
281
- # UI.messagebox "Component definition defines an image"
282
- # else
283
- # UI.messagebox status.to_s
284
- # UI.messagebox "Component definition does not define an image"
285
- # end
286
- #
287
- # @return [Boolean]
288
- #
289
- # @version SketchUp 6.0
290
- def image?
291
- end
292
-
293
- # The insertion_point method is used to retrieve the Point3d object where the
294
- # component was inserted.
295
- #
296
- # @deprecated SketchUp 2020.0 removed the insertion point feature.
297
- # The getter will always return the origin point and the
298
- # setter becomes a no-op.
299
- #
300
- # @example
301
- # point = Geom::Point3d.new 10,20,30
302
- # transform = Geom::Transformation.new point
303
- # model = Sketchup.active_model
304
- # entities = model.active_entities
305
- # path = Sketchup.find_support_file "Bed.skp",
306
- # "Components/Components Sampler/"
307
- # definitions = model.definitions
308
- # componentdefinition = definitions.load path
309
- # instance = entities.add_instance componentdefinition, transform
310
- # point = componentdefinition.insertion_point
311
- #
312
- # @return [Geom::Point3d] the Point3d where the component was inserted if
313
- # successful. False if unsuccessful.
314
- #
315
- # @version SketchUp 6.0
316
- def insertion_point
317
- end
318
-
319
- # Sets the insertion point of your definition.
320
- #
321
- # @deprecated SketchUp 2020.0 removed the insertion point feature.
322
- # The getter will always return the origin point and the
323
- # setter becomes a no-op.
324
- #
325
- # @example
326
- # point = Geom::Point3d.new(10, 20, 0)
327
- # componentdefinition = Sketchup.active_model.definitions[0]
328
- # componentdefinition.insertion_point = point
329
- #
330
- # @param [Geom::Point3d] point
331
- # The Point3d object to use as the
332
- # insertion point.
333
- #
334
- # @return [Geom::Point3d] The Point3d object used as the insertion point.
335
- #
336
- # @version SketchUp 6.0
337
- def insertion_point=(point)
338
- end
339
-
340
- # The instances method is used to return any array of ComponentInstancesfor
341
- # this ComponentDefinition.
342
- #
343
- # @example
344
- # componentdefinition = Sketchup.active_model.definitions[0]
345
- # instances = componentdefinition.instances
346
- #
347
- # @return [Array<Sketchup::ComponentInstance>] an array of ComponentInstances
348
- # (if successful)
349
- #
350
- # @version SketchUp 6.0
351
- def instances
352
- end
353
-
354
- # The internal? method is used to determine if the component definition is
355
- # internal to the Component Browser
356
- #
357
- # @example
358
- # point = Geom::Point3d.new 10,20,30
359
- # transform = Geom::Transformation.new point
360
- # model = Sketchup.active_model
361
- # entities = model.active_entities
362
- # path = Sketchup.find_support_file "Bed.skp",
363
- # "Components/Components Sampler/"
364
- # definitions = model.definitions
365
- # componentdefinition = definitions.load path
366
- # status = componentdefinition.internal?
367
- #
368
- # @return [Boolean]
369
- #
370
- # @version SketchUp 6.0
371
- def internal?
372
- end
373
-
374
- # Invalidates the bounding box of your definition. This command forces the
375
- # update of the bounding box of definition while inside an operation.
376
- # See Model.start_operation for how to start an operation.
377
- #
378
- # This method is useful if you make changes to your geometry using the Ruby
379
- # API and then need to know your bounding box size. This method forces
380
- # SketchUp to recalculate the definition's bounding box when you choose.
381
- #
382
- # @example
383
- # componentdefinition = Sketchup.active_model.definitions[0]
384
- # componentdefinition.invalidate_bounds
385
- #
386
- # @return [Boolean] true if successful
387
- #
388
- # @version SketchUp 6.0
389
- def invalidate_bounds
390
- end
391
-
392
- # The name method retrieves the name of the component definition.
393
- #
394
- # @example
395
- # path = Sketchup.find_support_file "Bed.skp",
396
- # "Components/Components Sampler/"
397
- # model = Sketchup.active_model
398
- # definitions = model.definitions
399
- # componentdefinition = definitions.load path
400
- # name = componentdefinition.name
401
- #
402
- # @return [String] the component definition's name if successful
403
- #
404
- # @version SketchUp 6.0
405
- def name
406
- end
407
-
408
- # The name= method is used to set the name of the component definition.
409
- #
410
- # @example
411
- # path = Sketchup.find_support_file "Bed.skp",
412
- # "Components/Components Sampler/"
413
- # model = Sketchup.active_model
414
- # definitions = model.definitions
415
- # componentdefinition = definitions.load path
416
- # name = componentdefinition.name="Bed"
417
- #
418
- # @param [String] name
419
- #
420
- # @return [String] the name assigned to the component definition if
421
- # successful
422
- #
423
- # @version SketchUp 6.0
424
- def name=(name)
425
- end
426
-
427
- # The path method is used to retrieve the path where the component was loaded.
428
- #
429
- # Returns nil if it is an internal component.
430
- #
431
- # @example
432
- # path = Sketchup.find_support_file "Bed.skp",
433
- # "Components/Components Sampler/"
434
- # model = Sketchup.active_model
435
- # definitions = model.definitions
436
- # componentdefinition = definitions.load path
437
- # path = componentdefinition.path
438
- #
439
- # @return [String, false] a valid path if successful, false if
440
- # unsuccessful
441
- #
442
- # @version SketchUp 6.0
443
- def path
444
- end
445
-
446
- # The refresh_thumbnail method is used to force SketchUp to regenerate the
447
- # thumbnail image that appears in the component browser. This is useful if
448
- # you've used the API to change the geometry of your component and would
449
- # like the thumbnail to match.
450
- #
451
- # @example
452
- # componentdefinition = Sketchup.active_model.definitions[0]
453
- # componentdefinition.refresh_thumbnail
454
- #
455
- # @return [nil]
456
- #
457
- # @version SketchUp 7.0
458
- def refresh_thumbnail
459
- end
460
-
461
- # The remove_classification method is used to remove a given classification
462
- # from the component.
463
- #
464
- # Note that you cannot classify image definitions.
465
- #
466
- # @example
467
- # definition = Sketchup.active_model.definitions.first
468
- # success = definition.remove_classification("IFC 2x3", "IfcDoor")
469
- #
470
- # @param [String] schema_name
471
- # Schema name to remove
472
- #
473
- # @param [String] schema_type
474
- # Schema type to remove. If not provided or an
475
- # empty string, the currently applied schema type for the
476
- # given schema name will be removed.
477
- #
478
- # @return [Boolean] true if the removal succeeds. Otherwise false.
479
- #
480
- # @version SketchUp 2015
481
- def remove_classification(schema_name, schema_type)
482
- end
483
-
484
- # The remove_observer method is used to remove an observer from the current
485
- # object.
486
- #
487
- # @example
488
- # componentdefinition = Sketchup.active_model.definitions[0]
489
- # status = componentdefinition.remove_observer observer
490
- #
491
- # @param [Object] observer
492
- # An observer.
493
- #
494
- # @return [Boolean] true if successful, false if unsuccessful.
495
- #
496
- # @version SketchUp 6.0
497
- def remove_observer(observer)
498
- end
499
-
500
- # The save_as method is used to save your definition as a SketchUp file at the
501
- # specified file destination.
502
- #
503
- # @example
504
- # my_definition = Sketchup.active_model.definitions[0]
505
- # success = my_definition.save_as "c:\\myComponent.skp"
506
- #
507
- # @param [String] file_path
508
- # Local file path to save the .skp file to.
509
- #
510
- # @return [Boolean] true if successful
511
- #
512
- # @version SketchUp 7.0
513
- def save_as(file_path)
514
- end
515
-
516
- # Saves a component thumbnail image. The image format is specified by the
517
- # file extension of filePath. Supported image formats are bmp, jpg, png,
518
- # tif, pct, and gif.
519
- #
520
- # @example
521
- # componentdefinition = Sketchup.active_model.definitions[0]
522
- # componentdefinition.save_thumbnail "test_thumb.png"
523
- #
524
- # @param [String] filename
525
- #
526
- # @return [Boolean] true if successful, false otherwise.
527
- #
528
- # @version SketchUp 7.0
529
- def save_thumbnail(filename)
530
- end
531
-
532
- # The set_classification_value method is used to set the value of a
533
- # classification attribute given a key path.
534
- #
535
- # @example
536
- # definition = Sketchup.active_model.definitions.first
537
- # definition.add_classification("IFC 2x3", "IfcDoor")
538
- #
539
- # path = ["IFC 2x3", "IfcDoor", "ObjectType", "IfcLabel"]
540
- # success = definition.set_classification_value(path, "Room 101")
541
- #
542
- # @param [Array<String>] path
543
- # An array composed of the key path to the value.
544
- #
545
- # @param [Object] value
546
- # A value valid for that specific attribute.
547
- #
548
- # @raise [NotImplementedError] when trying to set the value of "choice"
549
- # attributes.
550
- #
551
- # @raise [RuntimeError] if the attributes being set are corrupt.
552
- #
553
- # @raise [TypeError] when trying to set a value that is not valid for the
554
- # attribute.
555
- #
556
- # @return [Boolean] true if the path was valid, false otherwise.
557
- #
558
- # @version SketchUp 2015
559
- def set_classification_value(path, value)
560
- end
561
-
562
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The {Sketchup::ComponentDefinition} class is used to define the contents for
5
+ # a SketchUp component. Components are a collection of entities that can be
6
+ # instanced and reused multiple times throughout a model. For example, you
7
+ # could draw a chair once, turn it into a component, and then use 6 instances
8
+ # of it to surround a table. Edits to the original "definition" will then
9
+ # propagate across all of its instances.
10
+ #
11
+ # The ComponentDefinition class contains the global entities and settings for
12
+ # each definition. See the {Sketchup::ComponentInstance} class for how each
13
+ # copy is defined.
14
+ #
15
+ # Starting from SketchUp 2018+, the {Sketchup::ComponentDefinition} class
16
+ # contains a new default attribute dictionary named "SU_DefinitionSet" with
17
+ # default keys named named "Price", "Size", "Url". See the
18
+ # {https://help.sketchup.com/en/article/3000124 Help article} for more
19
+ # information. The dictionary cannot be deleted via ruby and an ArgumentError
20
+ # will be raised. The key/value pairs in the dictionary can be deleted safely.
21
+ #
22
+ # @version SketchUp 6.0
23
+ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
24
+
25
+ # Includes
26
+
27
+ include Comparable
28
+
29
+ # Instance Methods
30
+
31
+ # The <=> method is used to compare two ComponentDefinition objects for
32
+ # sorting. The comparison is done based on the component name.
33
+ #
34
+ # @example
35
+ # c1=Sketchup.find_support_file "Bed.skp",
36
+ # "Components/Components Sampler/"
37
+ # c2=Sketchup.find_support_file "Fence.skp",
38
+ # "Components/Components Sampler/"
39
+ # if c1 <=> c2
40
+ # UI.messagebox("c1 sorts before c2")
41
+ # end
42
+ #
43
+ # @param [Sketchup::ComponentDefinition] compdef2
44
+ # The second component definition in the comparison.
45
+ #
46
+ # @return [Integer] a -1 if component1 is less then component2. A 1
47
+ # if component1 greater than component2
48
+ #
49
+ # @version SketchUp 6.0
50
+ def <=>(compdef2)
51
+ end
52
+
53
+ # The == method is used to test if two ComponentDefinition objects are the
54
+ # same (based on their address in memory).
55
+ #
56
+ # @example
57
+ # c1=Sketchup.find_support_file "Bed.skp",
58
+ # "Components/Components Sampler/"
59
+ # c2=Sketchup.find_support_file "Fence.skp",
60
+ # "Components/Components Sampler/"
61
+ # if c1 == c2
62
+ # UI.messagebox("These definitions are the same.")
63
+ # end
64
+ #
65
+ # @param [Sketchup::ComponentDefinition] compdef2
66
+ # The second component definition in the comparison.
67
+ #
68
+ # @return [Boolean] true if the ComponentDefinition objects are
69
+ # the same object. False if the objects are not the same.
70
+ #
71
+ # @version SketchUp 6.0
72
+ def ==(compdef2)
73
+ end
74
+
75
+ # The add_classification method is used to add a given classification to
76
+ # the component.
77
+ #
78
+ # Note that you cannot classify image definitions.
79
+ #
80
+ # @example
81
+ # definition = Sketchup.active_model.definitions.first
82
+ # success = definition.add_classification("IFC 2x3", "IfcDoor")
83
+ #
84
+ # @param [String] schema_name
85
+ # a String - Schema name to add
86
+ #
87
+ # @param [String] schema_type
88
+ # a String - Schema type to add
89
+ #
90
+ # @return [Boolean] true if the classification succeeds. Otherwise false.
91
+ #
92
+ # @version SketchUp 2015
93
+ def add_classification(schema_name, schema_type)
94
+ end
95
+
96
+ # The add_observer method is used to add an observer to the current object.
97
+ #
98
+ # @example
99
+ # componentdefinition = Sketchup.active_model.definitions[0]
100
+ # status = componentdefinition.add_observer observer
101
+ #
102
+ # @param [Object] observer
103
+ # An observer.
104
+ #
105
+ # @return [Boolean] true if successful, false if unsuccessful.
106
+ #
107
+ # @version SketchUp 6.0
108
+ def add_observer(observer)
109
+ end
110
+
111
+ # The behavior method is used to retrieve the Behavior object associated with
112
+ # a component definition.
113
+ #
114
+ # @example
115
+ # path = Sketchup.find_support_file "Bed.skp",
116
+ # "Components/Components Sampler/"
117
+ # model = Sketchup.active_model
118
+ # definitions = model.definitions
119
+ # componentdefinition = definitions.load path
120
+ # behavior = componentdefinition.behavior
121
+ #
122
+ # @return [Sketchup::Behavior] a Behavior object if successful
123
+ #
124
+ # @version SketchUp 6.0
125
+ def behavior
126
+ end
127
+
128
+ # The count_instances method is used to count the number of unique component
129
+ # instances in a model using this component definition. This does not represent
130
+ # the total number of instances placed in the model as it doesn't take into
131
+ # account instances inside unused definitions.
132
+ #
133
+ # @example
134
+ # path = Sketchup.find_support_file('Bed.skp',
135
+ # 'Components/Components Sampler/')
136
+ # definitions = Sketchup.active_model.definitions
137
+ # definition = definitions.load(path)
138
+ # number = definition.count_instances
139
+ #
140
+ # @return [Integer] the number of component instances of this
141
+ # component definition (if successful)
142
+ #
143
+ # @version SketchUp 6.0
144
+ def count_instances
145
+ end
146
+
147
+ # The count_used_instances method is used to count the total number of
148
+ # component instances in a model using this component definition. This method
149
+ # takes into account the full hierarchy of the model.
150
+ #
151
+ # @example
152
+ # path = Sketchup.find_support_file('Bed.skp',
153
+ # 'Components/Components Sampler/')
154
+ # definitions = Sketchup.active_model.definitions
155
+ # definition = definitions.load(path)
156
+ # number = definition.count_used_instances
157
+ #
158
+ # @return [Integer] the number of component instances of this
159
+ # component definition (if successful)
160
+ #
161
+ # @version SketchUp 2016
162
+ def count_used_instances
163
+ end
164
+
165
+ # The description method is used to retrieve the description of the component
166
+ # definition.
167
+ #
168
+ # Component definitions do not have a description, by default.
169
+ #
170
+ # @example
171
+ # # Get the description
172
+ # componentdefinition = Sketchup.active_model.definitions[0]
173
+ # description = componentdefinition.description
174
+ #
175
+ # @return [String] the description of the component definition if successful
176
+ #
177
+ # @version SketchUp 6.0
178
+ def description
179
+ end
180
+
181
+ # The description= method is used to set the description for the component
182
+ # definition.
183
+ #
184
+ # @example
185
+ # componentdefinition = Sketchup.active_model.definitions[0]
186
+ # componentdefinition.description = "This is a traditional bed"
187
+ # description = componentdefinition.description
188
+ #
189
+ # @param [String] description
190
+ #
191
+ # @return [String] the description if successful, false if
192
+ # unsuccessful
193
+ #
194
+ # @version SketchUp 6.0
195
+ def description=(description)
196
+ end
197
+
198
+ # The entities method retrieves a collection of all the entities in the
199
+ # component definition
200
+ #
201
+ # @example
202
+ # componentdefinition = Sketchup.active_model.definitions[0]
203
+ # entities = componentdefinition.entities
204
+ #
205
+ # @return [Sketchup::Entities] an Entities object if successful
206
+ #
207
+ # @version SketchUp 6.0
208
+ def entities
209
+ end
210
+
211
+ # The get_classification_value method is used to retrieve the value from
212
+ # a classification attribute given a key path.
213
+ #
214
+ # @example
215
+ # definition = Sketchup.active_model.definitions.first
216
+ # definition.add_classification("IFC 2x3", "IfcDoor")
217
+ #
218
+ # path = ["IFC 2x3", "IfcDoor", "ObjectType", "IfcLabel"]
219
+ # value = definition.get_classification_value(path)
220
+ #
221
+ # @param [Array<String>] path
222
+ # An array composed of the key path to the value.
223
+ #
224
+ # @return [Object, nil] a Ruby object if successful, nil otherwise.
225
+ #
226
+ # @version SketchUp 2015
227
+ def get_classification_value(path)
228
+ end
229
+
230
+ # The group? method is used to determine if this component definition is used
231
+ # to hold the elements of a group.
232
+ #
233
+ # @example
234
+ # path = Sketchup.find_support_file "Bed.skp",
235
+ # "Components/Components Sampler/"
236
+ # model = Sketchup.active_model
237
+ # definitions = model.definitions
238
+ # componentdefinition = definitions.load path
239
+ # status = componentdefinition.group?
240
+ #
241
+ # @return [Boolean]
242
+ #
243
+ # @version SketchUp 6.0
244
+ def group?
245
+ end
246
+
247
+ # The guid method is used to retrieve the unique identifier of this component
248
+ # definition. The guid changes after the component definition is modified and
249
+ # the component edit is exited.
250
+ #
251
+ # @example
252
+ # componentdefinition = Sketchup.active_model.definitions[0]
253
+ # guid = componentdefinition.guid
254
+ #
255
+ # @return [String] a string guid if successful
256
+ #
257
+ # @version SketchUp 6.0
258
+ def guid
259
+ end
260
+
261
+ # The hidden method is used to determine if this component definition should
262
+ # be hidden on the component browser.
263
+ #
264
+ # @example
265
+ # componentdefinition = Sketchup.active_model.definitions[0]
266
+ # status = componentdefinition.hidden?
267
+ #
268
+ # @return [Boolean]
269
+ #
270
+ # @version SketchUp 6.0
271
+ def hidden?
272
+ end
273
+
274
+ # The image? method is used to determine if this component definition is used
275
+ # to define an image.
276
+ #
277
+ # @example
278
+ # componentdefinition = Sketchup.active_model.definitions[0]
279
+ # status = componentdefinition.image?
280
+ # if (status)
281
+ # UI.messagebox "Component definition defines an image"
282
+ # else
283
+ # UI.messagebox status.to_s
284
+ # UI.messagebox "Component definition does not define an image"
285
+ # end
286
+ #
287
+ # @return [Boolean]
288
+ #
289
+ # @version SketchUp 6.0
290
+ def image?
291
+ end
292
+
293
+ # The insertion_point method is used to retrieve the Point3d object where the
294
+ # component was inserted.
295
+ #
296
+ # @deprecated SketchUp 2020.0 removed the insertion point feature.
297
+ # The getter will always return the origin point and the
298
+ # setter becomes a no-op.
299
+ #
300
+ # @example
301
+ # point = Geom::Point3d.new 10,20,30
302
+ # transform = Geom::Transformation.new point
303
+ # model = Sketchup.active_model
304
+ # entities = model.active_entities
305
+ # path = Sketchup.find_support_file "Bed.skp",
306
+ # "Components/Components Sampler/"
307
+ # definitions = model.definitions
308
+ # componentdefinition = definitions.load path
309
+ # instance = entities.add_instance componentdefinition, transform
310
+ # point = componentdefinition.insertion_point
311
+ #
312
+ # @return [Geom::Point3d] the Point3d where the component was inserted if
313
+ # successful. False if unsuccessful.
314
+ #
315
+ # @version SketchUp 6.0
316
+ def insertion_point
317
+ end
318
+
319
+ # Sets the insertion point of your definition.
320
+ #
321
+ # @deprecated SketchUp 2020.0 removed the insertion point feature.
322
+ # The getter will always return the origin point and the
323
+ # setter becomes a no-op.
324
+ #
325
+ # @example
326
+ # point = Geom::Point3d.new(10, 20, 0)
327
+ # componentdefinition = Sketchup.active_model.definitions[0]
328
+ # componentdefinition.insertion_point = point
329
+ #
330
+ # @param [Geom::Point3d] point
331
+ # The Point3d object to use as the
332
+ # insertion point.
333
+ #
334
+ # @return [Geom::Point3d] The Point3d object used as the insertion point.
335
+ #
336
+ # @version SketchUp 6.0
337
+ def insertion_point=(point)
338
+ end
339
+
340
+ # The instances method is used to return any array of ComponentInstancesfor
341
+ # this ComponentDefinition.
342
+ #
343
+ # @example
344
+ # componentdefinition = Sketchup.active_model.definitions[0]
345
+ # instances = componentdefinition.instances
346
+ #
347
+ # @return [Array<Sketchup::ComponentInstance>] an array of ComponentInstances
348
+ # (if successful)
349
+ #
350
+ # @version SketchUp 6.0
351
+ def instances
352
+ end
353
+
354
+ # The internal? method is used to determine if the component definition is
355
+ # internal to the Component Browser
356
+ #
357
+ # @example
358
+ # point = Geom::Point3d.new 10,20,30
359
+ # transform = Geom::Transformation.new point
360
+ # model = Sketchup.active_model
361
+ # entities = model.active_entities
362
+ # path = Sketchup.find_support_file "Bed.skp",
363
+ # "Components/Components Sampler/"
364
+ # definitions = model.definitions
365
+ # componentdefinition = definitions.load path
366
+ # status = componentdefinition.internal?
367
+ #
368
+ # @return [Boolean]
369
+ #
370
+ # @version SketchUp 6.0
371
+ def internal?
372
+ end
373
+
374
+ # Invalidates the bounding box of your definition. This command forces the
375
+ # update of the bounding box of definition while inside an operation.
376
+ # See Model.start_operation for how to start an operation.
377
+ #
378
+ # This method is useful if you make changes to your geometry using the Ruby
379
+ # API and then need to know your bounding box size. This method forces
380
+ # SketchUp to recalculate the definition's bounding box when you choose.
381
+ #
382
+ # @example
383
+ # componentdefinition = Sketchup.active_model.definitions[0]
384
+ # componentdefinition.invalidate_bounds
385
+ #
386
+ # @return [Boolean] true if successful
387
+ #
388
+ # @version SketchUp 6.0
389
+ def invalidate_bounds
390
+ end
391
+
392
+ # The {#live_component?} method is used to identify Live Components and
393
+ # sub-definitions of Live Components.
394
+ #
395
+ # @example Skipping Live Components
396
+ # model = Sketchup.active_model
397
+ # model.definitions.each { |definition|
398
+ # next if definition.live_component?
399
+ # puts definition.name
400
+ # }
401
+ #
402
+ # @note These components are parametrically generated and API users should not
403
+ # modify them.
404
+ #
405
+ # @return [Boolean]
406
+ #
407
+ # @version SketchUp 2021.0
408
+ def live_component?
409
+ end
410
+
411
+ # The name method retrieves the name of the component definition.
412
+ #
413
+ # @example
414
+ # path = Sketchup.find_support_file "Bed.skp",
415
+ # "Components/Components Sampler/"
416
+ # model = Sketchup.active_model
417
+ # definitions = model.definitions
418
+ # componentdefinition = definitions.load path
419
+ # name = componentdefinition.name
420
+ #
421
+ # @return [String] the component definition's name if successful
422
+ #
423
+ # @version SketchUp 6.0
424
+ def name
425
+ end
426
+
427
+ # The name= method is used to set the name of the component definition.
428
+ #
429
+ # @example
430
+ # path = Sketchup.find_support_file "Bed.skp",
431
+ # "Components/Components Sampler/"
432
+ # model = Sketchup.active_model
433
+ # definitions = model.definitions
434
+ # componentdefinition = definitions.load path
435
+ # name = componentdefinition.name="Bed"
436
+ #
437
+ # @param [String] name
438
+ #
439
+ # @return [String] the name assigned to the component definition if
440
+ # successful
441
+ #
442
+ # @version SketchUp 6.0
443
+ def name=(name)
444
+ end
445
+
446
+ # The path method is used to retrieve the path where the component was loaded.
447
+ #
448
+ # @example
449
+ # path = Sketchup.find_support_file("Bed.skp", "Components/Components Sampler/")
450
+ # model = Sketchup.active_model
451
+ # definitions = model.definitions
452
+ # componentdefinition = definitions.load(path)
453
+ # path = componentdefinition.path
454
+ #
455
+ # @return [String] Returns empty string if it is an internal component.
456
+ #
457
+ # @version SketchUp 6.0
458
+ def path
459
+ end
460
+
461
+ # The refresh_thumbnail method is used to force SketchUp to regenerate the
462
+ # thumbnail image that appears in the component browser. This is useful if
463
+ # you've used the API to change the geometry of your component and would
464
+ # like the thumbnail to match.
465
+ #
466
+ # @example
467
+ # componentdefinition = Sketchup.active_model.definitions[0]
468
+ # componentdefinition.refresh_thumbnail
469
+ #
470
+ # @return [nil]
471
+ #
472
+ # @version SketchUp 7.0
473
+ def refresh_thumbnail
474
+ end
475
+
476
+ # The remove_classification method is used to remove a given classification
477
+ # from the component.
478
+ #
479
+ # Note that you cannot classify image definitions.
480
+ #
481
+ # @example
482
+ # definition = Sketchup.active_model.definitions.first
483
+ # success = definition.remove_classification("IFC 2x3", "IfcDoor")
484
+ #
485
+ # @param [String] schema_name
486
+ # Schema name to remove
487
+ #
488
+ # @param [String] schema_type
489
+ # Schema type to remove. If not provided or an
490
+ # empty string, the currently applied schema type for the
491
+ # given schema name will be removed.
492
+ #
493
+ # @return [Boolean] true if the removal succeeds. Otherwise false.
494
+ #
495
+ # @version SketchUp 2015
496
+ def remove_classification(schema_name, schema_type)
497
+ end
498
+
499
+ # The remove_observer method is used to remove an observer from the current
500
+ # object.
501
+ #
502
+ # @example
503
+ # componentdefinition = Sketchup.active_model.definitions[0]
504
+ # status = componentdefinition.remove_observer observer
505
+ #
506
+ # @param [Object] observer
507
+ # An observer.
508
+ #
509
+ # @return [Boolean] true if successful, false if unsuccessful.
510
+ #
511
+ # @version SketchUp 6.0
512
+ def remove_observer(observer)
513
+ end
514
+
515
+ # The save_as method is used to save your definition as a SketchUp file at the
516
+ # specified file destination.
517
+ #
518
+ # @example
519
+ # my_definition = Sketchup.active_model.definitions[0]
520
+ # success = my_definition.save_as "c:\\myComponent.skp"
521
+ #
522
+ # @param [String] file_path
523
+ # Local file path to save the .skp file to.
524
+ #
525
+ # @return [Boolean] true if successful
526
+ #
527
+ # @version SketchUp 7.0
528
+ def save_as(file_path)
529
+ end
530
+
531
+ # Saves a component thumbnail image. The image format is specified by the
532
+ # file extension of filePath. Supported image formats are bmp, jpg, png,
533
+ # tif, pct, and gif.
534
+ #
535
+ # @example
536
+ # componentdefinition = Sketchup.active_model.definitions[0]
537
+ # componentdefinition.save_thumbnail "test_thumb.png"
538
+ #
539
+ # @param [String] filename
540
+ #
541
+ # @return [Boolean] true if successful, false otherwise.
542
+ #
543
+ # @version SketchUp 7.0
544
+ def save_thumbnail(filename)
545
+ end
546
+
547
+ # The set_classification_value method is used to set the value of a
548
+ # classification attribute given a key path.
549
+ #
550
+ # @example
551
+ # definition = Sketchup.active_model.definitions.first
552
+ # definition.add_classification("IFC 2x3", "IfcDoor")
553
+ #
554
+ # path = ["IFC 2x3", "IfcDoor", "ObjectType", "IfcLabel"]
555
+ # success = definition.set_classification_value(path, "Room 101")
556
+ #
557
+ # @param [Array<String>] path
558
+ # An array composed of the key path to the value.
559
+ #
560
+ # @param [Object] value
561
+ # A value valid for that specific attribute.
562
+ #
563
+ # @raise [NotImplementedError] when trying to set the value of "choice"
564
+ # attributes.
565
+ #
566
+ # @raise [RuntimeError] if the attributes being set are corrupt.
567
+ #
568
+ # @raise [TypeError] when trying to set a value that is not valid for the
569
+ # attribute.
570
+ #
571
+ # @return [Boolean] true if the path was valid, false otherwise.
572
+ #
573
+ # @version SketchUp 2015
574
+ def set_classification_value(path, value)
575
+ end
576
+
577
+ end