sketchup-api-stubs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/SketchUp/Geom/BoundingBox.rb +335 -0
- data/SketchUp/Geom/LatLong.rb +123 -0
- data/SketchUp/Geom/Point3d.rb +643 -0
- data/SketchUp/Geom/PolygonMesh.rb +478 -0
- data/SketchUp/Geom/Transformation.rb +476 -0
- data/SketchUp/Geom/UTM.rb +135 -0
- data/SketchUp/Geom/Vector3d.rb +684 -0
- data/SketchUp/Sketchup/Animation.rb +137 -0
- data/SketchUp/Sketchup/AppObserver.rb +157 -0
- data/SketchUp/Sketchup/ArcCurve.rb +209 -0
- data/SketchUp/Sketchup/AttributeDictionaries.rb +146 -0
- data/SketchUp/Sketchup/AttributeDictionary.rb +280 -0
- data/SketchUp/Sketchup/Axes.rb +149 -0
- data/SketchUp/Sketchup/Behavior.rb +338 -0
- data/SketchUp/Sketchup/Camera.rb +594 -0
- data/SketchUp/Sketchup/ClassificationSchema.rb +63 -0
- data/SketchUp/Sketchup/Classifications.rb +118 -0
- data/SketchUp/Sketchup/Color.rb +291 -0
- data/SketchUp/Sketchup/ComponentDefinition.rb +562 -0
- data/SketchUp/Sketchup/ComponentInstance.rb +597 -0
- data/SketchUp/Sketchup/Console.rb +78 -0
- data/SketchUp/Sketchup/ConstructionLine.rb +257 -0
- data/SketchUp/Sketchup/ConstructionPoint.rb +32 -0
- data/SketchUp/Sketchup/Curve.rb +196 -0
- data/SketchUp/Sketchup/DefinitionList.rb +312 -0
- data/SketchUp/Sketchup/DefinitionObserver.rb +73 -0
- data/SketchUp/Sketchup/DefinitionsObserver.rb +102 -0
- data/SketchUp/Sketchup/Dimension.rb +167 -0
- data/SketchUp/Sketchup/DimensionLinear.rb +232 -0
- data/SketchUp/Sketchup/DimensionObserver.rb +38 -0
- data/SketchUp/Sketchup/DimensionRadial.rb +87 -0
- data/SketchUp/Sketchup/Drawingelement.rb +400 -0
- data/SketchUp/Sketchup/Edge.rb +517 -0
- data/SketchUp/Sketchup/EdgeUse.rb +213 -0
- data/SketchUp/Sketchup/Entities.rb +1011 -0
- data/SketchUp/Sketchup/EntitiesObserver.rb +125 -0
- data/SketchUp/Sketchup/Entity.rb +522 -0
- data/SketchUp/Sketchup/EntityObserver.rb +59 -0
- data/SketchUp/Sketchup/ExtensionsManager.rb +129 -0
- data/SketchUp/Sketchup/Face.rb +737 -0
- data/SketchUp/Sketchup/FrameChangeObserver.rb +104 -0
- data/SketchUp/Sketchup/Group.rb +705 -0
- data/SketchUp/Sketchup/Http.rb +27 -0
- data/SketchUp/Sketchup/Http/Request.rb +285 -0
- data/SketchUp/Sketchup/Http/Response.rb +62 -0
- data/SketchUp/Sketchup/Image.rb +393 -0
- data/SketchUp/Sketchup/Importer.rb +192 -0
- data/SketchUp/Sketchup/InputPoint.rb +393 -0
- data/SketchUp/Sketchup/InstanceObserver.rb +82 -0
- data/SketchUp/Sketchup/InstancePath.rb +297 -0
- data/SketchUp/Sketchup/Layer.rb +240 -0
- data/SketchUp/Sketchup/Layers.rb +235 -0
- data/SketchUp/Sketchup/LayersObserver.rb +136 -0
- data/SketchUp/Sketchup/Licensing.rb +47 -0
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +88 -0
- data/SketchUp/Sketchup/Loop.rb +141 -0
- data/SketchUp/Sketchup/Material.rb +384 -0
- data/SketchUp/Sketchup/Materials.rb +283 -0
- data/SketchUp/Sketchup/MaterialsObserver.rb +141 -0
- data/SketchUp/Sketchup/Menu.rb +97 -0
- data/SketchUp/Sketchup/Model.rb +1459 -0
- data/SketchUp/Sketchup/ModelObserver.rb +356 -0
- data/SketchUp/Sketchup/OptionsManager.rb +135 -0
- data/SketchUp/Sketchup/OptionsProvider.rb +277 -0
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +58 -0
- data/SketchUp/Sketchup/Page.rb +636 -0
- data/SketchUp/Sketchup/Pages.rb +349 -0
- data/SketchUp/Sketchup/PagesObserver.rb +76 -0
- data/SketchUp/Sketchup/PickHelper.rb +457 -0
- data/SketchUp/Sketchup/RegionalSettings.rb +43 -0
- data/SketchUp/Sketchup/RenderingOptions.rb +337 -0
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +44 -0
- data/SketchUp/Sketchup/SectionPlane.rb +88 -0
- data/SketchUp/Sketchup/Selection.rb +470 -0
- data/SketchUp/Sketchup/SelectionObserver.rb +115 -0
- data/SketchUp/Sketchup/Set.rb +253 -0
- data/SketchUp/Sketchup/ShadowInfo.rb +257 -0
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +57 -0
- data/SketchUp/Sketchup/Style.rb +77 -0
- data/SketchUp/Sketchup/Styles.rb +204 -0
- data/SketchUp/Sketchup/Text.rb +241 -0
- data/SketchUp/Sketchup/Texture.rb +211 -0
- data/SketchUp/Sketchup/TextureWriter.rb +237 -0
- data/SketchUp/Sketchup/Tool.rb +808 -0
- data/SketchUp/Sketchup/Tools.rb +120 -0
- data/SketchUp/Sketchup/ToolsObserver.rb +154 -0
- data/SketchUp/Sketchup/UVHelper.rb +61 -0
- data/SketchUp/Sketchup/Vertex.rb +143 -0
- data/SketchUp/Sketchup/View.rb +965 -0
- data/SketchUp/Sketchup/ViewObserver.rb +40 -0
- data/SketchUp/UI/Command.rb +307 -0
- data/SketchUp/UI/HtmlDialog.rb +346 -0
- data/SketchUp/UI/Notification.rb +229 -0
- data/SketchUp/UI/Toolbar.rb +243 -0
- data/SketchUp/UI/WebDialog.rb +623 -0
- data/SketchUp/_top_level.rb +193 -0
- data/SketchUp/array.rb +593 -0
- data/SketchUp/geom.rb +231 -0
- data/SketchUp/languagehandler.rb +92 -0
- data/SketchUp/length.rb +210 -0
- data/SketchUp/numeric.rb +249 -0
- data/SketchUp/sketchup.rb +1290 -0
- data/SketchUp/sketchupextension.rb +355 -0
- data/SketchUp/string.rb +24 -0
- data/SketchUp/ui.rb +637 -0
- metadata +176 -0
@@ -0,0 +1,562 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The ComponentDefinition class is used to define the contents for a SketchUp
|
5
|
+
# component. Components are a collection of entities that can be instanced
|
6
|
+
# and reused multiple times throughout a model. For example, you could
|
7
|
+
# draw a chair once, turn it into a component, and then use 6 instances of
|
8
|
+
# 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
|
12
|
+
# for each definition. See the ComponentInstance class for how each copy
|
13
|
+
# is defined.
|
14
|
+
#
|
15
|
+
# @version SketchUp 6.0
|
16
|
+
class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
17
|
+
|
18
|
+
# Includes
|
19
|
+
|
20
|
+
include Comparable
|
21
|
+
|
22
|
+
# Instance Methods
|
23
|
+
|
24
|
+
# The <=> method is used to compare two ComponentDefinition objects for
|
25
|
+
# sorting. The comparison is done based on the component name.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# c1=Sketchup.find_support_file "Bed.skp",
|
29
|
+
# "Components/Components Sampler/"
|
30
|
+
# c2=Sketchup.find_support_file "Fence.skp",
|
31
|
+
# "Components/Components Sampler/"
|
32
|
+
# if c1 <=> c2
|
33
|
+
# UI.messagebox("c1 sorts before c2")
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# @param compdef2
|
37
|
+
# The second component definition in the comparison.
|
38
|
+
#
|
39
|
+
# @return status - a -1 if component1 is less then component2. A 1
|
40
|
+
# if component1 greater than component2
|
41
|
+
#
|
42
|
+
# @version SketchUp 6.0
|
43
|
+
def <=>(compdef2)
|
44
|
+
end
|
45
|
+
|
46
|
+
# The == method is used to test if two ComponentDefinition objects are the
|
47
|
+
# same (based on their address in memory).
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
# c1=Sketchup.find_support_file "Bed.skp",
|
51
|
+
# "Components/Components Sampler/"
|
52
|
+
# c2=Sketchup.find_support_file "Fence.skp",
|
53
|
+
# "Components/Components Sampler/"
|
54
|
+
# if c1 == c2
|
55
|
+
# UI.messagebox("These definitions are the same.")
|
56
|
+
# end
|
57
|
+
#
|
58
|
+
# @param compdef2
|
59
|
+
# The second component definition in the comparison.
|
60
|
+
#
|
61
|
+
# @return status - true if the ComponentDefinition objects are
|
62
|
+
# the same object. False if the objects are not the same.
|
63
|
+
#
|
64
|
+
# @version SketchUp 6.0
|
65
|
+
def ==(compdef2)
|
66
|
+
end
|
67
|
+
|
68
|
+
# The add_classification method is used to add a given classification to
|
69
|
+
# the component.
|
70
|
+
#
|
71
|
+
# Note that you cannot classify image definitions.
|
72
|
+
#
|
73
|
+
# @example
|
74
|
+
# definition = Sketchup.active_model.definitions.first
|
75
|
+
# success = definition.add_classification("IFC 2x3", "IfcDoor")
|
76
|
+
#
|
77
|
+
# @param schema_name
|
78
|
+
# a String - Schema name to add
|
79
|
+
#
|
80
|
+
# @param schema_type
|
81
|
+
# a String - Schema type to add
|
82
|
+
#
|
83
|
+
# @return true if the classification succeeds. Otherwise false.
|
84
|
+
#
|
85
|
+
# @version SketchUp 2015
|
86
|
+
def add_classification(schema_name, schema_type)
|
87
|
+
end
|
88
|
+
|
89
|
+
# The add_observer method is used to add an observer to the current object.
|
90
|
+
#
|
91
|
+
# @example
|
92
|
+
# componentdefinition = Sketchup.active_model.definitions[0]
|
93
|
+
# status = componentdefinition.add_observer observer
|
94
|
+
#
|
95
|
+
# @param observer
|
96
|
+
# An observer.
|
97
|
+
#
|
98
|
+
# @return true if successful, false if unsuccessful.
|
99
|
+
#
|
100
|
+
# @version SketchUp 6.0
|
101
|
+
def add_observer(observer)
|
102
|
+
end
|
103
|
+
|
104
|
+
# The behavior method is used to retrieve the Behavior object associated with
|
105
|
+
# a component definition.
|
106
|
+
#
|
107
|
+
# @example
|
108
|
+
# path = Sketchup.find_support_file "Bed.skp",
|
109
|
+
# "Components/Components Sampler/"
|
110
|
+
# model = Sketchup.active_model
|
111
|
+
# definitions = model.definitions
|
112
|
+
# componentdefinition = definitions.load path
|
113
|
+
# behavior = componentdefinition.behavior
|
114
|
+
#
|
115
|
+
# @return behavior - a Behavior object if successful
|
116
|
+
#
|
117
|
+
# @version SketchUp 6.0
|
118
|
+
def behavior
|
119
|
+
end
|
120
|
+
|
121
|
+
# The count_instances method is used to count the number of unique component
|
122
|
+
# instances in a model using this component definition. This does not represent
|
123
|
+
# the total number of instances placed in the model as it doesn't take into
|
124
|
+
# account instances inside unused definitions.
|
125
|
+
#
|
126
|
+
# @example
|
127
|
+
# path = Sketchup.find_support_file('Bed.skp',
|
128
|
+
# 'Components/Components Sampler/')
|
129
|
+
# definitions = Sketchup.active_model.definitions
|
130
|
+
# definition = definitions.load(path)
|
131
|
+
# number = definition.count_instances
|
132
|
+
#
|
133
|
+
# @return count - the number of component instances of this
|
134
|
+
# component definition (if successful)
|
135
|
+
#
|
136
|
+
# @version SketchUp 6.0
|
137
|
+
def count_instances
|
138
|
+
end
|
139
|
+
|
140
|
+
# The count_used_instances method is used to count the total number of
|
141
|
+
# component instances in a model using this component definition. This method
|
142
|
+
# takes into account the full hierarchy of the model.
|
143
|
+
#
|
144
|
+
# @example
|
145
|
+
# path = Sketchup.find_support_file('Bed.skp',
|
146
|
+
# 'Components/Components Sampler/')
|
147
|
+
# definitions = Sketchup.active_model.definitions
|
148
|
+
# definition = definitions.load(path)
|
149
|
+
# number = definition.count_used_instances
|
150
|
+
#
|
151
|
+
# @return count - the number of component instances of this
|
152
|
+
# component definition (if successful)
|
153
|
+
#
|
154
|
+
# @version SketchUp 2016
|
155
|
+
def count_used_instances
|
156
|
+
end
|
157
|
+
|
158
|
+
# The description method is used to retrieve the description of the component
|
159
|
+
# definition.
|
160
|
+
#
|
161
|
+
# Component definitions do not have a description, by default.
|
162
|
+
#
|
163
|
+
# @example
|
164
|
+
# # Get the description
|
165
|
+
# componentdefinition = Sketchup.active_model.definitions[0]
|
166
|
+
# description = componentdefinition.description
|
167
|
+
#
|
168
|
+
# @return description - the description of the component
|
169
|
+
# definition if successful
|
170
|
+
#
|
171
|
+
# @version SketchUp 6.0
|
172
|
+
def description
|
173
|
+
end
|
174
|
+
|
175
|
+
# The description= method is used to set the description for the component
|
176
|
+
# definition.
|
177
|
+
#
|
178
|
+
# @example
|
179
|
+
# componentdefinition = Sketchup.active_model.definitions[0]
|
180
|
+
# componentdefinition.description = "This is a traditional bed"
|
181
|
+
# description = componentdefinition.description
|
182
|
+
#
|
183
|
+
# @param [String] description
|
184
|
+
#
|
185
|
+
# @return status - the description if successful, false if
|
186
|
+
# unsuccessful
|
187
|
+
#
|
188
|
+
# @version SketchUp 6.0
|
189
|
+
def description=(description)
|
190
|
+
end
|
191
|
+
|
192
|
+
# The entities method retrieves a collection of all the entities in the
|
193
|
+
# component definition
|
194
|
+
#
|
195
|
+
# @example
|
196
|
+
# componentdefinition = Sketchup.active_model.definitions[0]
|
197
|
+
# entities = componentdefinition.entities
|
198
|
+
#
|
199
|
+
# @return entities - an Entities object if successful
|
200
|
+
#
|
201
|
+
# @version SketchUp 6.0
|
202
|
+
def entities
|
203
|
+
end
|
204
|
+
|
205
|
+
# The get_classification_value method is used to retrieve the value from
|
206
|
+
# a classification attribute given a key path.
|
207
|
+
#
|
208
|
+
# @example
|
209
|
+
# definition = Sketchup.active_model.definitions.first
|
210
|
+
# definition.add_classification("IFC 2x3", "IfcDoor")
|
211
|
+
#
|
212
|
+
# path = ["IFC 2x3", "IfcDoor", "ObjectType", "IfcLabel"]
|
213
|
+
# value = definition.get_classification_value(path)
|
214
|
+
#
|
215
|
+
# @param path
|
216
|
+
# An array composed of the key path to the value.
|
217
|
+
#
|
218
|
+
# @return mixed - a Ruby object if successful, nil otherwise.
|
219
|
+
#
|
220
|
+
# @version SketchUp 2015
|
221
|
+
def get_classification_value(path)
|
222
|
+
end
|
223
|
+
|
224
|
+
# The group? method is used to determine if this component definition is used
|
225
|
+
# to hold the elements of a group.
|
226
|
+
#
|
227
|
+
# @example
|
228
|
+
# path = Sketchup.find_support_file "Bed.skp",
|
229
|
+
# "Components/Components Sampler/"
|
230
|
+
# model = Sketchup.active_model
|
231
|
+
# definitions = model.definitions
|
232
|
+
# componentdefinition = definitions.load path
|
233
|
+
# status = componentdefinition.group?
|
234
|
+
#
|
235
|
+
# @return status - true if the definition is used to hold a
|
236
|
+
# group, false if the definition does not hold a group.
|
237
|
+
#
|
238
|
+
# @return [Boolean]
|
239
|
+
#
|
240
|
+
# @version SketchUp 6.0
|
241
|
+
def group?
|
242
|
+
end
|
243
|
+
|
244
|
+
# The guid method is used to retrieve the unique identifier of this component
|
245
|
+
# definition. The guid changes after the component definition is modified and
|
246
|
+
# the component edit is exited.
|
247
|
+
#
|
248
|
+
# @example
|
249
|
+
# componentdefinition = Sketchup.active_model.definitions[0]
|
250
|
+
# guid = componentdefinition.guid
|
251
|
+
#
|
252
|
+
# @return guid - a string guid if successful
|
253
|
+
#
|
254
|
+
# @version SketchUp 6.0
|
255
|
+
def guid
|
256
|
+
end
|
257
|
+
|
258
|
+
# The hidden method is used to determine if this component definition should
|
259
|
+
# be hidden on the component browser.
|
260
|
+
#
|
261
|
+
# @example
|
262
|
+
# componentdefinition = Sketchup.active_model.definitions[0]
|
263
|
+
# status = componentdefinition.hidden?
|
264
|
+
#
|
265
|
+
# @return status - true if the definition should be hidden, false
|
266
|
+
# if the definition should not be 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 status - true if the component definition defines an
|
288
|
+
# image, false if the component definition does not
|
289
|
+
# define an image.
|
290
|
+
#
|
291
|
+
# @return [Boolean]
|
292
|
+
#
|
293
|
+
# @version SketchUp 6.0
|
294
|
+
def image?
|
295
|
+
end
|
296
|
+
|
297
|
+
# The insertion_point method is used to retrieve the Point3d object where the
|
298
|
+
# component was inserted.
|
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 point - 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
|
+
# @example
|
322
|
+
# point = Geom::Point3d.new(10, 20, 0)
|
323
|
+
# componentdefinition = Sketchup.active_model.definitions[0]
|
324
|
+
# componentdefinition.insertion_point = point
|
325
|
+
#
|
326
|
+
# @param [Geom::Point3d] point
|
327
|
+
# The Point3d object to use as the
|
328
|
+
# insertion point.
|
329
|
+
#
|
330
|
+
# @return [Geom::Point3d] The Point3d object used as the insertion point.
|
331
|
+
#
|
332
|
+
# @version SketchUp 6.0
|
333
|
+
def insertion_point=(point)
|
334
|
+
end
|
335
|
+
|
336
|
+
# The instances method is used to return any array of ComponentInstancesfor
|
337
|
+
# this ComponentDefinition.
|
338
|
+
#
|
339
|
+
# @example
|
340
|
+
# componentdefinition = Sketchup.active_model.definitions[0]
|
341
|
+
# instances = componentdefinition.instances
|
342
|
+
#
|
343
|
+
# @return instances - an array of ComponentInstances (if
|
344
|
+
# successful)
|
345
|
+
#
|
346
|
+
# @version SketchUp 6.0
|
347
|
+
def instances
|
348
|
+
end
|
349
|
+
|
350
|
+
# The internal? method is used to determine if the component definition is
|
351
|
+
# internal to the Component Browser
|
352
|
+
#
|
353
|
+
# @example
|
354
|
+
# point = Geom::Point3d.new 10,20,30
|
355
|
+
# transform = Geom::Transformation.new point
|
356
|
+
# model = Sketchup.active_model
|
357
|
+
# entities = model.active_entities
|
358
|
+
# path = Sketchup.find_support_file "Bed.skp",
|
359
|
+
# "Components/Components Sampler/"
|
360
|
+
# definitions = model.definitions
|
361
|
+
# componentdefinition = definitions.load path
|
362
|
+
# status = componentdefinition.internal?
|
363
|
+
#
|
364
|
+
# @return status - true if the component definition is internal
|
365
|
+
# to SketchUp's Component Browser. False if the
|
366
|
+
# component definition is not internal to SketchUp.
|
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 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 name - 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 name - 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 path - 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 schema_name
|
471
|
+
# a String - Schema name to remove
|
472
|
+
#
|
473
|
+
# @param schema_type
|
474
|
+
# a String - 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 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 observer
|
492
|
+
# An observer.
|
493
|
+
#
|
494
|
+
# @return 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 file_path
|
508
|
+
# Local file path to save the .skp file to.
|
509
|
+
#
|
510
|
+
# @return 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 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 value
|
543
|
+
# A value valid for that specific attribute.
|
544
|
+
#
|
545
|
+
# @param path
|
546
|
+
# An array composed of the key path to the value.
|
547
|
+
#
|
548
|
+
# @raise [NotImplementedError] when trying to set the value of "choice"
|
549
|
+
# attributes.
|
550
|
+
#
|
551
|
+
# @raise [TypeError] when trying to set a value that is not valid for the
|
552
|
+
# attribute.
|
553
|
+
#
|
554
|
+
# @raise [RuntimeError] if the attributes being set are corrupt.
|
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
|