sketchup-api-stubs 0.7.4 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +148 -145
- data/lib/sketchup-api-stubs/stubs/{array.rb → Array.rb} +741 -741
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -318
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +523 -492
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +693 -691
- data/lib/sketchup-api-stubs/stubs/{geom.rb → Geom.rb} +351 -348
- data/lib/sketchup-api-stubs/stubs/{languagehandler.rb → LanguageHandler.rb} +93 -92
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -573
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +698 -411
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +516 -514
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -143
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -349
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -371
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -220
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -204
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +692 -694
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
- data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/{length.rb → Length.rb} +278 -278
- data/lib/sketchup-api-stubs/stubs/{numeric.rb → Numeric.rb} +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -140
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -157
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +286 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -328
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -577
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +619 -562
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -194
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +426 -329
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -72
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -102
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -312
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -38
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +396 -390
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +502 -508
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1205 -1119
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +272 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -544
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +126 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -697
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +292 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +468 -409
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -226
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -190
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +407 -393
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -82
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -303
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -244
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -136
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -416
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +318 -311
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -141
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -95
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1651 -1638
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -356
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +131 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -770
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +363 -353
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +477 -456
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -44
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +459 -454
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +260 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -57
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -225
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +837 -829
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -154
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -61
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1317 -1301
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
- data/lib/sketchup-api-stubs/stubs/{sketchup.rb → Sketchup.rb} +1360 -1310
- data/lib/sketchup-api-stubs/stubs/{sketchupextension.rb → SketchupExtension.rb} +353 -353
- data/lib/sketchup-api-stubs/stubs/{string.rb → String.rb} +24 -24
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +389 -310
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +496 -356
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -229
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -633
- data/lib/sketchup-api-stubs/stubs/{ui.rb → UI.rb} +683 -667
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +15 -12
@@ -1,593 +1,593 @@
|
|
1
|
-
# Copyright:: Copyright
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The {Sketchup::ComponentInstance} class is used to represent component
|
5
|
-
# instances of a component definition or components that have been dragged from
|
6
|
-
# the Component Browser and placed (thus, instanced) within the Model.
|
7
|
-
# Therefore, the ComponentInstance class contains a reference to a
|
8
|
-
# corresponding ComponentDefinition object and a Transformation object (which
|
9
|
-
# contains the location of the component in the Drawing Window).
|
10
|
-
#
|
11
|
-
# Starting from SketchUp 2018+, the {Sketchup::ComponentInstance} class
|
12
|
-
# contains default attributes when created or imported. The attributes
|
13
|
-
# are: "Owner", "Status". See the
|
14
|
-
# {https://help.sketchup.com/en/article/3000124 Help article} for more
|
15
|
-
# information. The dictionary cannot be deleted via ruby and an @raise ArgumentError
|
16
|
-
# will be raised. The key/value pairs in the dictionary can be deleted safely.
|
17
|
-
#
|
18
|
-
# @version SketchUp 6.0
|
19
|
-
class Sketchup::ComponentInstance < Sketchup::Drawingelement
|
20
|
-
|
21
|
-
# Instance Methods
|
22
|
-
|
23
|
-
# The add_observer method is used to add an observer to the current object.
|
24
|
-
#
|
25
|
-
# @example
|
26
|
-
# entities = Sketchup.active_model.entities
|
27
|
-
# definition = Sketchup.active_model.definitions[0]
|
28
|
-
# transformation = Geom::Transformation.new([0,0,0])
|
29
|
-
# componentinstance = entities.add_instance(definition, transformation)
|
30
|
-
# status = componentinstance.add_observer observer
|
31
|
-
#
|
32
|
-
# @param [Object] observer
|
33
|
-
# An observer.
|
34
|
-
#
|
35
|
-
# @return [Boolean] true if successful, false if unsuccessful.
|
36
|
-
#
|
37
|
-
# @version SketchUp 6.0
|
38
|
-
def add_observer(observer)
|
39
|
-
end
|
40
|
-
|
41
|
-
# The definition method is used to retrieve the component definition for this
|
42
|
-
# component instance.
|
43
|
-
#
|
44
|
-
# @example
|
45
|
-
# # First create an instance for us to look at.
|
46
|
-
# entities = Sketchup.active_model.entities
|
47
|
-
# definition = Sketchup.active_model.definitions[0]
|
48
|
-
# transformation = Geom::Transformation.new([0,0,0])
|
49
|
-
# componentinstance = entities.add_instance(definition, transformation)
|
50
|
-
#
|
51
|
-
# # You can get an instance's definition with this method.
|
52
|
-
# definition = componentinstance.definition
|
53
|
-
#
|
54
|
-
# @return [Sketchup::ComponentDefinition] a ComponentDefinition object if
|
55
|
-
# successful
|
56
|
-
#
|
57
|
-
# @version SketchUp 6.0
|
58
|
-
def definition
|
59
|
-
end
|
60
|
-
|
61
|
-
# The definition= method is used to set the component definition for this
|
62
|
-
# component.
|
63
|
-
#
|
64
|
-
# This method causes the instance to use a different definition, but it will
|
65
|
-
# use the same transformation to position it in the Model.
|
66
|
-
#
|
67
|
-
# @example
|
68
|
-
# # Assumes that the active model contains two different components.
|
69
|
-
# instance1 = Sketchup.active_model.entities[0]
|
70
|
-
# instance2 = Sketchup.active_model.entities[1]
|
71
|
-
#
|
72
|
-
# # Grab handles to our two definitions.
|
73
|
-
# definition1 = instance1.definition
|
74
|
-
# definition2 = instance2.definition
|
75
|
-
#
|
76
|
-
# # Replace 2nd instance with the 1st definition.
|
77
|
-
# instance2.definition = definition1
|
78
|
-
#
|
79
|
-
# @param [Sketchup::ComponentDefinition] definition
|
80
|
-
# A ComponentDefinition object to set.
|
81
|
-
#
|
82
|
-
# @return [Sketchup::ComponentDefinition] the ComponentDefinition object
|
83
|
-
# that was set if successful, false if unsuccessful
|
84
|
-
#
|
85
|
-
# @version SketchUp 6.0
|
86
|
-
def definition=(definition)
|
87
|
-
end
|
88
|
-
|
89
|
-
# The equals? method is used to determine if a component instance is
|
90
|
-
# geometrically equivalent to another instance.
|
91
|
-
#
|
92
|
-
# @example
|
93
|
-
# entities = Sketchup.active_model.entities
|
94
|
-
# instance1 = entities[0]
|
95
|
-
# instance2 = entities[1]
|
96
|
-
# status = instance1.equals?(instance2)
|
97
|
-
#
|
98
|
-
# @param [Sketchup::ComponentInstance] instance
|
99
|
-
# The instance to compare this instance with.
|
100
|
-
#
|
101
|
-
# @return [Boolean]
|
102
|
-
#
|
103
|
-
# @version SketchUp 8.0
|
104
|
-
def equals?(instance)
|
105
|
-
end
|
106
|
-
|
107
|
-
# The explode method is used to explode the component instance into separate
|
108
|
-
# entities.
|
109
|
-
#
|
110
|
-
# @example
|
111
|
-
# # Assuming 'instance' is a ComponentInstance object
|
112
|
-
# array = instance.explode
|
113
|
-
# if array
|
114
|
-
# UI.messagebox "Exploded the component instance"
|
115
|
-
# else
|
116
|
-
# UI.messagebox "Failure"
|
117
|
-
# end
|
118
|
-
#
|
119
|
-
# @return [Array<Sketchup:Entity>] An array of entity objects if successful, false if
|
120
|
-
# unsuccessful
|
121
|
-
#
|
122
|
-
# @version SketchUp 6.0
|
123
|
-
def explode
|
124
|
-
end
|
125
|
-
|
126
|
-
# The glued_to method is used to retrieve the entity that this instance is
|
127
|
-
# glued to.
|
128
|
-
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
#
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
# @
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
#
|
196
|
-
#
|
197
|
-
#
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
#
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
# @
|
206
|
-
#
|
207
|
-
#
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
#
|
215
|
-
#
|
216
|
-
#
|
217
|
-
#
|
218
|
-
#
|
219
|
-
#
|
220
|
-
#
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
#
|
225
|
-
#
|
226
|
-
#
|
227
|
-
#
|
228
|
-
#
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
#
|
243
|
-
#
|
244
|
-
#
|
245
|
-
#
|
246
|
-
#
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
#
|
251
|
-
#
|
252
|
-
#
|
253
|
-
#
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
#
|
258
|
-
#
|
259
|
-
#
|
260
|
-
#
|
261
|
-
# @
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
#
|
266
|
-
#
|
267
|
-
#
|
268
|
-
#
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
#
|
282
|
-
#
|
283
|
-
#
|
284
|
-
#
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
#
|
289
|
-
#
|
290
|
-
# @
|
291
|
-
#
|
292
|
-
#
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
#
|
297
|
-
#
|
298
|
-
#
|
299
|
-
#
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
#
|
304
|
-
#
|
305
|
-
#
|
306
|
-
#
|
307
|
-
#
|
308
|
-
#
|
309
|
-
#
|
310
|
-
#
|
311
|
-
#
|
312
|
-
# transformation
|
313
|
-
#
|
314
|
-
#
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
#
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
#
|
327
|
-
#
|
328
|
-
#
|
329
|
-
#
|
330
|
-
#
|
331
|
-
#
|
332
|
-
#
|
333
|
-
#
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
#
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
#
|
342
|
-
#
|
343
|
-
#
|
344
|
-
#
|
345
|
-
#
|
346
|
-
#
|
347
|
-
#
|
348
|
-
#
|
349
|
-
#
|
350
|
-
#
|
351
|
-
#
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
#
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
#
|
360
|
-
#
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
365
|
-
#
|
366
|
-
#
|
367
|
-
#
|
368
|
-
#
|
369
|
-
#
|
370
|
-
#
|
371
|
-
#
|
372
|
-
# @
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
#
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
#
|
384
|
-
#
|
385
|
-
#
|
386
|
-
#
|
387
|
-
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
#
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
#
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
#
|
400
|
-
#
|
401
|
-
#
|
402
|
-
#
|
403
|
-
#
|
404
|
-
#
|
405
|
-
#
|
406
|
-
#
|
407
|
-
#
|
408
|
-
#
|
409
|
-
#
|
410
|
-
#
|
411
|
-
#
|
412
|
-
#
|
413
|
-
#
|
414
|
-
#
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
# @
|
421
|
-
#
|
422
|
-
#
|
423
|
-
#
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
#
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
#
|
432
|
-
#
|
433
|
-
#
|
434
|
-
#
|
435
|
-
#
|
436
|
-
#
|
437
|
-
#
|
438
|
-
#
|
439
|
-
#
|
440
|
-
#
|
441
|
-
#
|
442
|
-
#
|
443
|
-
#
|
444
|
-
# @
|
445
|
-
#
|
446
|
-
#
|
447
|
-
#
|
448
|
-
#
|
449
|
-
#
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
#
|
457
|
-
#
|
458
|
-
#
|
459
|
-
#
|
460
|
-
#
|
461
|
-
#
|
462
|
-
#
|
463
|
-
#
|
464
|
-
#
|
465
|
-
#
|
466
|
-
#
|
467
|
-
#
|
468
|
-
#
|
469
|
-
#
|
470
|
-
#
|
471
|
-
#
|
472
|
-
#
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
#
|
478
|
-
#
|
479
|
-
#
|
480
|
-
#
|
481
|
-
#
|
482
|
-
#
|
483
|
-
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
#
|
487
|
-
#
|
488
|
-
#
|
489
|
-
#
|
490
|
-
#
|
491
|
-
#
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
#
|
497
|
-
#
|
498
|
-
#
|
499
|
-
#
|
500
|
-
#
|
501
|
-
#
|
502
|
-
#
|
503
|
-
#
|
504
|
-
#
|
505
|
-
#
|
506
|
-
#
|
507
|
-
#
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
#
|
513
|
-
#
|
514
|
-
#
|
515
|
-
#
|
516
|
-
#
|
517
|
-
#
|
518
|
-
#
|
519
|
-
#
|
520
|
-
#
|
521
|
-
#
|
522
|
-
#
|
523
|
-
#
|
524
|
-
#
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
#
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
#
|
533
|
-
#
|
534
|
-
#
|
535
|
-
#
|
536
|
-
#
|
537
|
-
#
|
538
|
-
#
|
539
|
-
#
|
540
|
-
#
|
541
|
-
#
|
542
|
-
#
|
543
|
-
#
|
544
|
-
#
|
545
|
-
#
|
546
|
-
#
|
547
|
-
#
|
548
|
-
#
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
#
|
555
|
-
#
|
556
|
-
#
|
557
|
-
#
|
558
|
-
#
|
559
|
-
#
|
560
|
-
#
|
561
|
-
#
|
562
|
-
#
|
563
|
-
#
|
564
|
-
# @param [Sketchup::ComponentInstance] instance
|
565
|
-
# The instance to union this instance with.
|
566
|
-
#
|
567
|
-
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
568
|
-
# (this and arg) represent manifold solids and the
|
569
|
-
# operation succeeds otherwise nil is returned.
|
570
|
-
#
|
571
|
-
# @version SketchUp 8.0
|
572
|
-
def union(instance)
|
573
|
-
end
|
574
|
-
|
575
|
-
# The volume method is used to compute the volume of this instance if and only
|
576
|
-
# if this instance is manifold.
|
577
|
-
#
|
578
|
-
# @example
|
579
|
-
# entities = Sketchup.active_model.entities
|
580
|
-
# definition = Sketchup.active_model.definitions[0]
|
581
|
-
# transformation = Geom::Transformation.new([0,0,0])
|
582
|
-
# componentinstance = entities.add_instance(definition, transformation)
|
583
|
-
# volume = componentinstance.volume
|
584
|
-
#
|
585
|
-
# @return [Float] If the instance represents a manifold volume,
|
586
|
-
# volume will be a positive value. If volume is negative,
|
587
|
-
# the instance is not manifold.
|
588
|
-
#
|
589
|
-
# @version SketchUp 8.0
|
590
|
-
def volume
|
591
|
-
end
|
592
|
-
|
593
|
-
end
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The {Sketchup::ComponentInstance} class is used to represent component
|
5
|
+
# instances of a component definition or components that have been dragged from
|
6
|
+
# the Component Browser and placed (thus, instanced) within the Model.
|
7
|
+
# Therefore, the ComponentInstance class contains a reference to a
|
8
|
+
# corresponding ComponentDefinition object and a Transformation object (which
|
9
|
+
# contains the location of the component in the Drawing Window).
|
10
|
+
#
|
11
|
+
# Starting from SketchUp 2018+, the {Sketchup::ComponentInstance} class
|
12
|
+
# contains default attributes when created or imported. The attributes
|
13
|
+
# are: "Owner", "Status". See the
|
14
|
+
# {https://help.sketchup.com/en/article/3000124 Help article} for more
|
15
|
+
# information. The dictionary cannot be deleted via ruby and an @raise ArgumentError
|
16
|
+
# will be raised. The key/value pairs in the dictionary can be deleted safely.
|
17
|
+
#
|
18
|
+
# @version SketchUp 6.0
|
19
|
+
class Sketchup::ComponentInstance < Sketchup::Drawingelement
|
20
|
+
|
21
|
+
# Instance Methods
|
22
|
+
|
23
|
+
# The add_observer method is used to add an observer to the current object.
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# entities = Sketchup.active_model.entities
|
27
|
+
# definition = Sketchup.active_model.definitions[0]
|
28
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
29
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
30
|
+
# status = componentinstance.add_observer observer
|
31
|
+
#
|
32
|
+
# @param [Object] observer
|
33
|
+
# An observer.
|
34
|
+
#
|
35
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
36
|
+
#
|
37
|
+
# @version SketchUp 6.0
|
38
|
+
def add_observer(observer)
|
39
|
+
end
|
40
|
+
|
41
|
+
# The definition method is used to retrieve the component definition for this
|
42
|
+
# component instance.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
# # First create an instance for us to look at.
|
46
|
+
# entities = Sketchup.active_model.entities
|
47
|
+
# definition = Sketchup.active_model.definitions[0]
|
48
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
49
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
50
|
+
#
|
51
|
+
# # You can get an instance's definition with this method.
|
52
|
+
# definition = componentinstance.definition
|
53
|
+
#
|
54
|
+
# @return [Sketchup::ComponentDefinition] a ComponentDefinition object if
|
55
|
+
# successful
|
56
|
+
#
|
57
|
+
# @version SketchUp 6.0
|
58
|
+
def definition
|
59
|
+
end
|
60
|
+
|
61
|
+
# The definition= method is used to set the component definition for this
|
62
|
+
# component.
|
63
|
+
#
|
64
|
+
# This method causes the instance to use a different definition, but it will
|
65
|
+
# use the same transformation to position it in the Model.
|
66
|
+
#
|
67
|
+
# @example
|
68
|
+
# # Assumes that the active model contains two different components.
|
69
|
+
# instance1 = Sketchup.active_model.entities[0]
|
70
|
+
# instance2 = Sketchup.active_model.entities[1]
|
71
|
+
#
|
72
|
+
# # Grab handles to our two definitions.
|
73
|
+
# definition1 = instance1.definition
|
74
|
+
# definition2 = instance2.definition
|
75
|
+
#
|
76
|
+
# # Replace 2nd instance with the 1st definition.
|
77
|
+
# instance2.definition = definition1
|
78
|
+
#
|
79
|
+
# @param [Sketchup::ComponentDefinition] definition
|
80
|
+
# A ComponentDefinition object to set.
|
81
|
+
#
|
82
|
+
# @return [Sketchup::ComponentDefinition] the ComponentDefinition object
|
83
|
+
# that was set if successful, false if unsuccessful
|
84
|
+
#
|
85
|
+
# @version SketchUp 6.0
|
86
|
+
def definition=(definition)
|
87
|
+
end
|
88
|
+
|
89
|
+
# The equals? method is used to determine if a component instance is
|
90
|
+
# geometrically equivalent to another instance.
|
91
|
+
#
|
92
|
+
# @example
|
93
|
+
# entities = Sketchup.active_model.entities
|
94
|
+
# instance1 = entities[0]
|
95
|
+
# instance2 = entities[1]
|
96
|
+
# status = instance1.equals?(instance2)
|
97
|
+
#
|
98
|
+
# @param [Sketchup::ComponentInstance] instance
|
99
|
+
# The instance to compare this instance with.
|
100
|
+
#
|
101
|
+
# @return [Boolean]
|
102
|
+
#
|
103
|
+
# @version SketchUp 8.0
|
104
|
+
def equals?(instance)
|
105
|
+
end
|
106
|
+
|
107
|
+
# The explode method is used to explode the component instance into separate
|
108
|
+
# entities.
|
109
|
+
#
|
110
|
+
# @example
|
111
|
+
# # Assuming 'instance' is a ComponentInstance object
|
112
|
+
# array = instance.explode
|
113
|
+
# if array
|
114
|
+
# UI.messagebox "Exploded the component instance"
|
115
|
+
# else
|
116
|
+
# UI.messagebox "Failure"
|
117
|
+
# end
|
118
|
+
#
|
119
|
+
# @return [Array<Sketchup:Entity>] An array of entity objects if successful, false if
|
120
|
+
# unsuccessful
|
121
|
+
#
|
122
|
+
# @version SketchUp 6.0
|
123
|
+
def explode
|
124
|
+
end
|
125
|
+
|
126
|
+
# The {#glued_to} method is used to retrieve the entity that this instance is
|
127
|
+
# glued to.
|
128
|
+
#
|
129
|
+
# @example
|
130
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
131
|
+
# transform = Geom::Transformation.new(point)
|
132
|
+
# model = Sketchup.active_model
|
133
|
+
# entities = model.active_entities
|
134
|
+
# path = Sketchup.find_support_file("Bed.skp", "Components/Components Sampler/")
|
135
|
+
# definitions = model.definitions
|
136
|
+
# componentdefinition = definitions.load(path)
|
137
|
+
# instance = entities.add_instance(componentdefinition, transform)
|
138
|
+
# status = instance.glued_to
|
139
|
+
#
|
140
|
+
# @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil]
|
141
|
+
#
|
142
|
+
# @version SketchUp 6.0
|
143
|
+
def glued_to
|
144
|
+
end
|
145
|
+
|
146
|
+
# The {glued_to=} method glues this instance to a drawing element.
|
147
|
+
# When moving this other drawing elment with the Move tool, the glued instance moves with it.
|
148
|
+
#
|
149
|
+
# In SketchUp 2021.1 support for passing {Sketchup::Group}, {Sketchup::ComponentInstance} and
|
150
|
+
# {Sketchup::Image} was added.
|
151
|
+
#
|
152
|
+
# @example
|
153
|
+
# model = Sketchup.active_model
|
154
|
+
# entities = model.active_entities
|
155
|
+
#
|
156
|
+
# # Create a face
|
157
|
+
# face = entities.add_face([[0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0]])
|
158
|
+
#
|
159
|
+
# # Add component
|
160
|
+
# path = Sketchup.find_support_file("Bed.skp", "Components/Components Sampler/")
|
161
|
+
# point = Geom::Point3d.new(10, 10, 0)
|
162
|
+
# transformation = Geom::Transformation.new(point)
|
163
|
+
# definitions = model.definitions
|
164
|
+
# definition = definitions.load(path)
|
165
|
+
# instance = entities.add_instance(definition, transformation)
|
166
|
+
#
|
167
|
+
# # Make component "gluable"
|
168
|
+
# definition.behavior.is2d = true
|
169
|
+
#
|
170
|
+
# # Glue the component to the face.
|
171
|
+
# # If you now move the face, the component will follow.
|
172
|
+
# instance.glued_to = face
|
173
|
+
#
|
174
|
+
# @param [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] drawing_element
|
175
|
+
#
|
176
|
+
# @raise ArgumentError if the {Sketchup::Behavior} for this component doesn't allow gluing,
|
177
|
+
# if the alignment is wrong, or if this would lead to cyclic gluing.
|
178
|
+
#
|
179
|
+
# @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] the entity the instance was glued to.
|
180
|
+
#
|
181
|
+
# @version SketchUp 6.0
|
182
|
+
def glued_to=(drawing_element)
|
183
|
+
end
|
184
|
+
|
185
|
+
# The guid method is used to get the base 64 encoded unique id
|
186
|
+
# for this SketchUp object.
|
187
|
+
#
|
188
|
+
# @example
|
189
|
+
# entities = Sketchup.active_model.entities
|
190
|
+
# definition = Sketchup.active_model.definitions[0]
|
191
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
192
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
193
|
+
# guid = componentinstance.guid
|
194
|
+
#
|
195
|
+
# @return [String] a unique 22 character string
|
196
|
+
#
|
197
|
+
# @version SketchUp 2014
|
198
|
+
def guid
|
199
|
+
end
|
200
|
+
|
201
|
+
# The intersect method is used to compute the boolean intersection of two
|
202
|
+
# instances representing manifold solid volumes (this - arg). If the specified
|
203
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
204
|
+
#
|
205
|
+
# @example
|
206
|
+
# entities = Sketchup.active_model.entities
|
207
|
+
# instance1 = entities[0]
|
208
|
+
# instance2 = entities[1]
|
209
|
+
# result = instance1.intersect(instance2)
|
210
|
+
#
|
211
|
+
# @note This method is not available in SketchUp Make.
|
212
|
+
#
|
213
|
+
# @param [Sketchup::ComponentInstance] instance
|
214
|
+
# The instance to intersect this instance with.
|
215
|
+
#
|
216
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
217
|
+
# (this and arg) represent manifold solids and the
|
218
|
+
# operation succeeds otherwise nil is returned.
|
219
|
+
#
|
220
|
+
# @version SketchUp 8.0
|
221
|
+
def intersect(instance)
|
222
|
+
end
|
223
|
+
|
224
|
+
# The locked= method is used to lock a component instance.
|
225
|
+
#
|
226
|
+
# @example
|
227
|
+
# entities = Sketchup.active_model.entities
|
228
|
+
# definition = Sketchup.active_model.definitions[0]
|
229
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
230
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
231
|
+
# status = componentinstance.locked = true
|
232
|
+
#
|
233
|
+
# @param [Boolean] lock
|
234
|
+
#
|
235
|
+
# @return [Boolean] true if the component instance is locked.
|
236
|
+
# False if the instance is not locked.
|
237
|
+
#
|
238
|
+
# @version SketchUp 6.0
|
239
|
+
def locked=(lock)
|
240
|
+
end
|
241
|
+
|
242
|
+
# The locked? method is used to determine if a component instance is locked.
|
243
|
+
#
|
244
|
+
# @example
|
245
|
+
# entities = Sketchup.active_model.entities
|
246
|
+
# definition = Sketchup.active_model.definitions[0]
|
247
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
248
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
249
|
+
# status = componentinstance.locked?
|
250
|
+
#
|
251
|
+
# @return [Boolean]
|
252
|
+
#
|
253
|
+
# @version SketchUp 6.0
|
254
|
+
def locked?
|
255
|
+
end
|
256
|
+
|
257
|
+
# The {#make_unique} method is used to create a component definition for this
|
258
|
+
# instance that is not used by any other instances. If the component is already
|
259
|
+
# unique in the model, nothing happens.
|
260
|
+
#
|
261
|
+
# @example
|
262
|
+
# point = Geom::Point3d.new(10,20,30)
|
263
|
+
# transform = Geom::Transformation.new(point)
|
264
|
+
# model = Sketchup.active_model
|
265
|
+
# entities = model.active_entities
|
266
|
+
#
|
267
|
+
# path = Sketchup.find_support_file("Bed.skp",
|
268
|
+
# "Components/Components Sampler/")
|
269
|
+
# definitions = model.definitions
|
270
|
+
# componentdefinition = definitions.load(path)
|
271
|
+
# instance = entities.add_instance(componentdefinition, transform)
|
272
|
+
# # Returns unique component instance
|
273
|
+
# instance.make_unique
|
274
|
+
#
|
275
|
+
# @return [Sketchup::ComponentInstance] returns itself
|
276
|
+
#
|
277
|
+
# @version SketchUp 6.0
|
278
|
+
def make_unique
|
279
|
+
end
|
280
|
+
|
281
|
+
# The manifold? method is used to determine if an instance is manifold.
|
282
|
+
#
|
283
|
+
# @example
|
284
|
+
# entities = Sketchup.active_model.entities
|
285
|
+
# definition = Sketchup.active_model.definitions[0]
|
286
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
287
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
288
|
+
# status = componentinstance.manifold?
|
289
|
+
#
|
290
|
+
# @return [Boolean]
|
291
|
+
#
|
292
|
+
# @version SketchUp 8.0
|
293
|
+
def manifold?
|
294
|
+
end
|
295
|
+
|
296
|
+
# The {#move!} method is used to set the transformation of this component
|
297
|
+
# instance, similarly to {#transformation=} but without recording to the undo
|
298
|
+
# stack.
|
299
|
+
#
|
300
|
+
# This method is useful for moving entities inside of an animation or page
|
301
|
+
# transition.
|
302
|
+
#
|
303
|
+
# @example
|
304
|
+
# entities = Sketchup.active_model.entities
|
305
|
+
# definition = Sketchup.active_model.definitions[0]
|
306
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
307
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
308
|
+
# new_transformation = Geom::Transformation.new([100,0,0])
|
309
|
+
# componentinstance.move!(new_transformation)
|
310
|
+
#
|
311
|
+
# @note Despite the name being similar to {#transform!}, this method closer
|
312
|
+
# corresponds to {#transformation=}.
|
313
|
+
#
|
314
|
+
# @param [Geom::Transformation] transformation
|
315
|
+
#
|
316
|
+
# @return [Boolean] true if successful, false if unsuccessful
|
317
|
+
#
|
318
|
+
# @version SketchUp 6.0
|
319
|
+
def move!(transformation)
|
320
|
+
end
|
321
|
+
|
322
|
+
# The name method is used to get the name of this instance.
|
323
|
+
#
|
324
|
+
# @example
|
325
|
+
# entities = Sketchup.active_model.entities
|
326
|
+
# definition = Sketchup.active_model.definitions[0]
|
327
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
328
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
329
|
+
# name = componentinstance.name
|
330
|
+
#
|
331
|
+
# @return [String] the string name of the ComponentInstance
|
332
|
+
#
|
333
|
+
# @version SketchUp 6.0
|
334
|
+
def name
|
335
|
+
end
|
336
|
+
|
337
|
+
# The name method is used to set the name of this instance.
|
338
|
+
#
|
339
|
+
# @example
|
340
|
+
# entities = Sketchup.active_model.entities
|
341
|
+
# definition = Sketchup.active_model.definitions[0]
|
342
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
343
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
344
|
+
# componentinstance.name = "Sang"
|
345
|
+
#
|
346
|
+
# @param [String] name
|
347
|
+
# the string name to set
|
348
|
+
#
|
349
|
+
# @return [Sketchup::ComponentInstance] the newly named ComponentInstance
|
350
|
+
#
|
351
|
+
# @version SketchUp 6.0
|
352
|
+
def name=(name)
|
353
|
+
end
|
354
|
+
|
355
|
+
# The outer_shell method is used to compute the outer shell of the two
|
356
|
+
# instances representing manifold solid volumes (this || arg). If the specified
|
357
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
358
|
+
#
|
359
|
+
# @example
|
360
|
+
# entities = Sketchup.active_model.entities
|
361
|
+
# instance1 = entities[0]
|
362
|
+
# instance2 = entities[1]
|
363
|
+
# result = instance1.outer_shell(instance2)
|
364
|
+
#
|
365
|
+
# @param [Sketchup::ComponentInstance] instance
|
366
|
+
# The instance to outer shell this instance with.
|
367
|
+
#
|
368
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
369
|
+
# (this and arg) represent manifold solids and the
|
370
|
+
# operation succeeds otherwise nil is returned.
|
371
|
+
#
|
372
|
+
# @version SketchUp 8.0
|
373
|
+
def outer_shell(instance)
|
374
|
+
end
|
375
|
+
|
376
|
+
# The remove_observer method is used to remove an observer from the current
|
377
|
+
# object.
|
378
|
+
#
|
379
|
+
# @example
|
380
|
+
# entities = Sketchup.active_model.entities
|
381
|
+
# definition = Sketchup.active_model.definitions[0]
|
382
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
383
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
384
|
+
# status = componentinstance.remove_observer observer
|
385
|
+
#
|
386
|
+
# @param [Object] observer
|
387
|
+
# An observer.
|
388
|
+
#
|
389
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
390
|
+
#
|
391
|
+
# @version SketchUp 6.0
|
392
|
+
def remove_observer(observer)
|
393
|
+
end
|
394
|
+
|
395
|
+
# The show_differences method is used to determine if a component instance is
|
396
|
+
# geometrically equivalent to another instance and in addition move the non-
|
397
|
+
# matching and matching geometry to new layers.
|
398
|
+
#
|
399
|
+
# This method will move both instances to Layer0. Geometry that is the same
|
400
|
+
# in both components will be moved to a new layer named def_name + "_same".
|
401
|
+
# Geometry that is not the same will be moved to a layer named def_name +
|
402
|
+
# "_diff".
|
403
|
+
#
|
404
|
+
# If verbose is true, a list of all the geometry that is different
|
405
|
+
# from one component to the other is displayed texturally in the Ruby Console.
|
406
|
+
#
|
407
|
+
# @example
|
408
|
+
# entities = Sketchup.active_model.entities
|
409
|
+
# instance1 = entities[0]
|
410
|
+
# instance2 = entities[1]
|
411
|
+
# status = instance1.show_differences(instance2, true)
|
412
|
+
#
|
413
|
+
# @param [Sketchup::ComponentInstance] instance
|
414
|
+
# The instance to be compared with.
|
415
|
+
#
|
416
|
+
# @param [Boolean] verbose
|
417
|
+
# A boolean flag indicating whether to display a textural
|
418
|
+
# report of the found differences to the Ruby console.
|
419
|
+
#
|
420
|
+
# @return [Boolean] true if the instances are geometrically
|
421
|
+
# equivalent, otherwise false.
|
422
|
+
#
|
423
|
+
# @version SketchUp 8.0
|
424
|
+
def show_differences(instance, verbose)
|
425
|
+
end
|
426
|
+
|
427
|
+
# The split method is used to compute the boolean split (map overlay)of the two
|
428
|
+
# instances representing manifold solid volumes (this - arg). If the specified
|
429
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
430
|
+
#
|
431
|
+
# resultant groups if the two objects (this and arg) represent manifold solids and the operation
|
432
|
+
# succeeds otherwise nil is returned. The 3 groups are as follows: The intersection of volume 1 &
|
433
|
+
# volume 2, the difference of volume 1 minus volume 2, and the reverse difference of volume 2 minus
|
434
|
+
# volume 1.
|
435
|
+
#
|
436
|
+
# @example
|
437
|
+
# entities = Sketchup.active_model.entities
|
438
|
+
# instance1 = entities[0]
|
439
|
+
# instance2 = entities[1]
|
440
|
+
# result = instance1.split(instance2)
|
441
|
+
#
|
442
|
+
# @note This method is not available in SketchUp Make.
|
443
|
+
#
|
444
|
+
# @param [Sketchup::ComponentInstance, nil] instance
|
445
|
+
# The instance to split this instance with.
|
446
|
+
#
|
447
|
+
# @return [Array(Sketchup::Group, Sketchup::Group, Sketchup::Group)] A vector (array) of the three
|
448
|
+
#
|
449
|
+
# @version SketchUp 8.0
|
450
|
+
def split(instance)
|
451
|
+
end
|
452
|
+
|
453
|
+
# The subtract method is used to compute the boolean difference of the two
|
454
|
+
# instances representing manifold solid volumes (this - arg). If the specified
|
455
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
456
|
+
#
|
457
|
+
# @example
|
458
|
+
# entities = Sketchup.active_model.entities
|
459
|
+
# instance1 = entities[0]
|
460
|
+
# instance2 = entities[1]
|
461
|
+
# result = instance1.subtract(instance2)
|
462
|
+
#
|
463
|
+
# @note This method is not available in SketchUp Make.
|
464
|
+
#
|
465
|
+
# @param [Sketchup::ComponentInstance] instance
|
466
|
+
# The instance to subtract this instance from.
|
467
|
+
#
|
468
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
469
|
+
# (this and arg) represent manifold solids and the
|
470
|
+
# operation succeeds otherwise nil is returned.
|
471
|
+
#
|
472
|
+
# @version SketchUp 8.0
|
473
|
+
def subtract(instance)
|
474
|
+
end
|
475
|
+
|
476
|
+
# Apply a {Geom::Transformation} to a component instance.
|
477
|
+
#
|
478
|
+
# @example
|
479
|
+
# entities = Sketchup.active_model.entities
|
480
|
+
# definition = Sketchup.active_model.definitions[0]
|
481
|
+
# transformation = Geom::Transformation.new([0, 0, 0])
|
482
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
483
|
+
# new_transformation = Geom::Transformation.new([100, 0, 0])
|
484
|
+
# componentinstance.transform! new_transformation
|
485
|
+
#
|
486
|
+
# @param [Geom::Transformation] transform
|
487
|
+
# The transformation object to apply to the component instance.
|
488
|
+
#
|
489
|
+
# @return [Boolean]
|
490
|
+
#
|
491
|
+
# @version SketchUp 6.0
|
492
|
+
def transform!(transform)
|
493
|
+
end
|
494
|
+
|
495
|
+
# The transformation method is used to retrieve the transformation of this
|
496
|
+
# instance.
|
497
|
+
#
|
498
|
+
# @example
|
499
|
+
# entities = Sketchup.active_model.entities
|
500
|
+
# definition = Sketchup.active_model.definitions[0]
|
501
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
502
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
503
|
+
# t = componentinstance.transformation
|
504
|
+
#
|
505
|
+
# @return [Geom::Transformation] the Transformation object if successful
|
506
|
+
#
|
507
|
+
# @version SketchUp 6.0
|
508
|
+
def transformation
|
509
|
+
end
|
510
|
+
|
511
|
+
# The {#transformation=} method is used to set the transformation of this
|
512
|
+
# component instance.
|
513
|
+
#
|
514
|
+
# @example
|
515
|
+
# entities = Sketchup.active_model.entities
|
516
|
+
# definition = Sketchup.active_model.definitions[0]
|
517
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
518
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
519
|
+
# new_transformation = Geom::Transformation.new([100,0,0])
|
520
|
+
# componentinstance.transformation = new_transformation
|
521
|
+
#
|
522
|
+
# @param [Geom::Transformation] transformation
|
523
|
+
#
|
524
|
+
# @version SketchUp 6.0
|
525
|
+
def transformation=(transformation)
|
526
|
+
end
|
527
|
+
|
528
|
+
# The trim method is used to compute the (non-destructive) boolean difference
|
529
|
+
# of the two instances representing manifold solid volumes (this - arg). If
|
530
|
+
# the specified objects (this and arg) do not represent manifold volumes, this
|
531
|
+
# method fails.
|
532
|
+
#
|
533
|
+
# @example
|
534
|
+
# entities = Sketchup.active_model.entities
|
535
|
+
# instance1 = entities[0]
|
536
|
+
# instance2 = entities[1]
|
537
|
+
# result = instance1.trim(instance2)
|
538
|
+
#
|
539
|
+
# @note This method is not available in SketchUp Make.
|
540
|
+
#
|
541
|
+
# @param [Sketchup::ComponentInstance] instance
|
542
|
+
# The instance to trim this instance against.
|
543
|
+
#
|
544
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
545
|
+
# (this and arg) represent manifold solids and the
|
546
|
+
# operation succeeds otherwise nil is returned.
|
547
|
+
#
|
548
|
+
# @version SketchUp 8.0
|
549
|
+
def trim(instance)
|
550
|
+
end
|
551
|
+
|
552
|
+
# The union method is used to compute the boolean union of the two instances
|
553
|
+
# representing manifold solid volumes (this | arg). If the specified
|
554
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
555
|
+
#
|
556
|
+
# @example
|
557
|
+
# entities = Sketchup.active_model.entities
|
558
|
+
# instance1 = entities[0]
|
559
|
+
# instance2 = entities[1]
|
560
|
+
# result = instance1.union(instance2)
|
561
|
+
#
|
562
|
+
# @note This method is not available in SketchUp Make.
|
563
|
+
#
|
564
|
+
# @param [Sketchup::ComponentInstance] instance
|
565
|
+
# The instance to union this instance with.
|
566
|
+
#
|
567
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
568
|
+
# (this and arg) represent manifold solids and the
|
569
|
+
# operation succeeds otherwise nil is returned.
|
570
|
+
#
|
571
|
+
# @version SketchUp 8.0
|
572
|
+
def union(instance)
|
573
|
+
end
|
574
|
+
|
575
|
+
# The volume method is used to compute the volume of this instance if and only
|
576
|
+
# if this instance is manifold.
|
577
|
+
#
|
578
|
+
# @example
|
579
|
+
# entities = Sketchup.active_model.entities
|
580
|
+
# definition = Sketchup.active_model.definitions[0]
|
581
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
582
|
+
# componentinstance = entities.add_instance(definition, transformation)
|
583
|
+
# volume = componentinstance.volume
|
584
|
+
#
|
585
|
+
# @return [Float] If the instance represents a manifold volume,
|
586
|
+
# volume will be a positive value. If volume is negative,
|
587
|
+
# the instance is not manifold.
|
588
|
+
#
|
589
|
+
# @version SketchUp 8.0
|
590
|
+
def volume
|
591
|
+
end
|
592
|
+
|
593
|
+
end
|