sketchup-api-stubs 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +5 -5
  2. data/.yardopts +9 -9
  3. data/lib/sketchup-api-stubs.rb +1 -1
  4. data/lib/sketchup-api-stubs/sketchup.rb +145 -145
  5. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +318 -318
  6. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
  7. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
  8. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
  10. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
  11. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +492 -492
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
  13. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
  14. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
  16. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +691 -691
  17. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -573
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +174 -186
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  22. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +514 -514
  23. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +143 -155
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  30. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +371 -371
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  32. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  33. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +220 -232
  34. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  37. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  38. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
  39. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +204 -216
  40. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  41. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  42. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -694
  43. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  44. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +140 -140
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -281
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +328 -328
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +577 -577
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +281 -281
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +562 -562
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +194 -194
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +329 -329
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +72 -72
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +102 -102
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +312 -312
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +38 -38
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +390 -390
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +508 -508
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1119 -1119
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +125 -125
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +544 -544
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +59 -59
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -125
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +750 -750
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +697 -697
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +409 -409
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +226 -226
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +190 -190
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +393 -393
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +82 -82
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +303 -303
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +285 -280
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +244 -231
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +136 -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 -123
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +416 -416
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +311 -311
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +141 -141
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +95 -95
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1638 -1601
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +356 -356
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +132 -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 +770 -770
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +353 -353
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +76 -76
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +456 -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 +44 -44
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +454 -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 +57 -57
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +211 -211
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +225 -225
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +829 -829
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +154 -154
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +61 -61
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1301 -1301
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +43 -43
  134. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +310 -310
  135. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +356 -356
  136. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +229 -229
  137. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
  138. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
  139. data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
  140. data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
  141. data/lib/sketchup-api-stubs/stubs/geom.rb +348 -348
  142. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
  143. data/lib/sketchup-api-stubs/stubs/length.rb +278 -278
  144. data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
  145. data/lib/sketchup-api-stubs/stubs/sketchup.rb +1310 -1310
  146. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
  147. data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
  148. data/lib/sketchup-api-stubs/stubs/ui.rb +667 -667
  149. metadata +3 -4
@@ -1,562 +1,562 @@
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 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