sketchup-api-stubs 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +151 -148
- data/lib/sketchup-api-stubs/stubs/Array.rb +741 -741
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -322
- 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 +509 -523
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +476 -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 -693
- data/lib/sketchup-api-stubs/stubs/Geom.rb +351 -351
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +595 -595
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +747 -698
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +517 -516
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -148
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +354 -354
- 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 -370
- 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 -225
- 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 -209
- 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/ReferenceEntity.rb +82 -0
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +692 -692
- 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 +278 -278
- data/lib/sketchup-api-stubs/stubs/Numeric.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -144
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +169 -169
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +150 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -286
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -302
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +121 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -294
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +659 -619
- 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 -201
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +449 -426
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -74
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -42
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +406 -396
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +397 -502
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1239 -1205
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +261 -272
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -127
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -545
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -60
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -126
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +937 -937
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +102 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +750 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +282 -292
- 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 -468
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -266
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -189
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +406 -407
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -84
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -306
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +326 -326
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -422
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -427
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -249
- 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 +114 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -414
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +317 -318
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -93
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1652 -1651
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -357
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +130 -131
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +271 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +490 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +116 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -797
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +361 -363
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -77
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -477
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +361 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +458 -459
- 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 +255 -260
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -217
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +834 -837
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -156
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +75 -75
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1311 -1317
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +1377 -1360
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/String.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +389 -389
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +494 -496
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +269 -269
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +241 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +635 -635
- data/lib/sketchup-api-stubs/stubs/UI.rb +683 -683
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +303 -311
- data/lib/sketchup-api-stubs.rb +1 -1
- metadata +10 -7
@@ -1,750 +1,750 @@
|
|
1
|
-
# Copyright:: Copyright
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# A Group class contains methods for manipulating groups of entities.
|
5
|
-
#
|
6
|
-
# Groups in SketchUp are very similar to components, but can from a user point
|
7
|
-
# of view be thought of as unique objects. Groups can be instanced when copied
|
8
|
-
# but are silently made unique when edited through the GUI. To honor this
|
9
|
-
# behavior, make sure to call {#make_unique} before modifying a group through
|
10
|
-
# the API.
|
11
|
-
#
|
12
|
-
# @version SketchUp 6.0
|
13
|
-
class Sketchup::Group < Sketchup::Drawingelement
|
14
|
-
|
15
|
-
# Instance Methods
|
16
|
-
|
17
|
-
# The add_observer method is used to add a ComponentInstance observer to the
|
18
|
-
# group.
|
19
|
-
#
|
20
|
-
# @example
|
21
|
-
# # Add a group to the model.
|
22
|
-
# group = Sketchup.active_model.entities.add_group
|
23
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
24
|
-
# status = group.add_observer observer
|
25
|
-
#
|
26
|
-
# @param [Object] observer
|
27
|
-
# An observer.
|
28
|
-
#
|
29
|
-
# @return [Boolean] true if successful, false if unsuccessful.
|
30
|
-
#
|
31
|
-
# @version SketchUp 6.0
|
32
|
-
def add_observer(observer)
|
33
|
-
end
|
34
|
-
|
35
|
-
# The copy method is used to create a new Group object that is a copy of the
|
36
|
-
# group.
|
37
|
-
#
|
38
|
-
# @example
|
39
|
-
# # Add a group to the model.
|
40
|
-
# group = Sketchup.active_model.entities.add_group
|
41
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
42
|
-
# group2 = group.copy
|
43
|
-
#
|
44
|
-
# @return [Sketchup::Group] a new Group object
|
45
|
-
#
|
46
|
-
# @version SketchUp 6.0
|
47
|
-
def copy
|
48
|
-
end
|
49
|
-
|
50
|
-
# The definition method is used to retrieve the component definition for this
|
51
|
-
# group.
|
52
|
-
#
|
53
|
-
# @example
|
54
|
-
# group = Sketchup.active_model.entities.add_group
|
55
|
-
# definition = group.definition
|
56
|
-
#
|
57
|
-
# @return [Sketchup::ComponentDefinition] a ComponentDefinition object if
|
58
|
-
# successful
|
59
|
-
#
|
60
|
-
# @version SketchUp 2015
|
61
|
-
def definition
|
62
|
-
end
|
63
|
-
|
64
|
-
# The description method is used to retrieve the description for the group.
|
65
|
-
#
|
66
|
-
# @example
|
67
|
-
# depth = 100
|
68
|
-
# width = 100
|
69
|
-
# model = Sketchup.active_model
|
70
|
-
# entities = model.active_entities
|
71
|
-
# pts = []
|
72
|
-
# pts[0] = [0, 0, 0]
|
73
|
-
# pts[1] = [width, 0, 0]
|
74
|
-
# pts[2] = [width, depth, 0]
|
75
|
-
# pts[3] = [0, depth, 0]
|
76
|
-
# # Add the group to the entities in the model
|
77
|
-
# group = entities.add_group
|
78
|
-
#
|
79
|
-
# # Get the entities within the group
|
80
|
-
# entities2 = group.entities
|
81
|
-
#
|
82
|
-
# # Add a face to within the group
|
83
|
-
# face = entities2.add_face pts
|
84
|
-
# group.description = "This is a Group with a 2d Face"
|
85
|
-
# description = group.description
|
86
|
-
#
|
87
|
-
# @return [String] a string description if successful
|
88
|
-
#
|
89
|
-
# @version SketchUp 6.0
|
90
|
-
def description
|
91
|
-
end
|
92
|
-
|
93
|
-
# The description= method is used to set the description for the group.
|
94
|
-
#
|
95
|
-
# @example
|
96
|
-
# depth = 100
|
97
|
-
# width = 100
|
98
|
-
# model = Sketchup.active_model
|
99
|
-
# entities = model.active_entities
|
100
|
-
# pts = []
|
101
|
-
# pts[0] = [0, 0, 0]
|
102
|
-
# pts[1] = [width, 0, 0]
|
103
|
-
# pts[2] = [width, depth, 0]
|
104
|
-
# pts[3] = [0, depth, 0]
|
105
|
-
#
|
106
|
-
# # Add the group to the entities in the model
|
107
|
-
# group = entities.add_group
|
108
|
-
#
|
109
|
-
# # Get the entities within the group
|
110
|
-
# entities2 = group.entities
|
111
|
-
#
|
112
|
-
# # Add a face to within the group
|
113
|
-
# face = entities2.add_face pts
|
114
|
-
# group.description = "This is a Group with a 2d Face"
|
115
|
-
# description = group.description
|
116
|
-
# if (description)
|
117
|
-
# UI.messagebox description
|
118
|
-
# else
|
119
|
-
# UI.messagebox "Failure"
|
120
|
-
# end
|
121
|
-
#
|
122
|
-
# @param [String] description
|
123
|
-
# A string description.
|
124
|
-
#
|
125
|
-
# @return [String] the new description if successful
|
126
|
-
#
|
127
|
-
# @version SketchUp 6.0
|
128
|
-
def description=(description)
|
129
|
-
end
|
130
|
-
|
131
|
-
# The entities method is used to retrieve a collection of entities in the
|
132
|
-
# group.
|
133
|
-
#
|
134
|
-
# @example
|
135
|
-
# depth = 100
|
136
|
-
# width = 100
|
137
|
-
# model = Sketchup.active_model
|
138
|
-
# entities = model.active_entities
|
139
|
-
# pts = []
|
140
|
-
# pts[0] = [0, 0, 0]
|
141
|
-
# pts[1] = [width, 0, 0]
|
142
|
-
# pts[2] = [width, depth, 0]
|
143
|
-
# pts[3] = [0, depth, 0]
|
144
|
-
# # Add the group to the entities in the model
|
145
|
-
# group = entities.add_group
|
146
|
-
#
|
147
|
-
# # Get the entities within the group
|
148
|
-
# entities2 = group.entities
|
149
|
-
#
|
150
|
-
# # Add a face to within the group
|
151
|
-
# face = entities2.add_face pts
|
152
|
-
# entities = group.entities
|
153
|
-
# if (entities)
|
154
|
-
# UI.messagebox entities
|
155
|
-
# else
|
156
|
-
# UI.messagebox "Failure"
|
157
|
-
# end
|
158
|
-
#
|
159
|
-
# @return [Sketchup::Entities] an Entities object if successful
|
160
|
-
#
|
161
|
-
# @version SketchUp 6.0
|
162
|
-
def entities
|
163
|
-
end
|
164
|
-
|
165
|
-
# The equals? method is used to determine if a group is geometrically
|
166
|
-
# equivalent to another group.
|
167
|
-
#
|
168
|
-
# @example
|
169
|
-
# entities = Sketchup.active_model.entities
|
170
|
-
# group1 = entities[0]
|
171
|
-
# group2 = entities[1]
|
172
|
-
# status = group1.equals?(group2)
|
173
|
-
#
|
174
|
-
# @param [Sketchup::Group] group
|
175
|
-
# The group to compare this group with.
|
176
|
-
#
|
177
|
-
# @return [Boolean]
|
178
|
-
#
|
179
|
-
# @version SketchUp 8.0
|
180
|
-
def equals?(group)
|
181
|
-
end
|
182
|
-
|
183
|
-
# The explode method is used to explode the group into individual entities.
|
184
|
-
#
|
185
|
-
# @example
|
186
|
-
# # Add a group to the model.
|
187
|
-
# group = Sketchup.active_model.entities.add_group
|
188
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
189
|
-
#
|
190
|
-
# array = group.explode
|
191
|
-
# if array
|
192
|
-
# UI.messagebox "Exploded the group"
|
193
|
-
# else
|
194
|
-
# UI.messagebox "Failure"
|
195
|
-
# end
|
196
|
-
#
|
197
|
-
# @return [Array<Sketchup::Drawingelement>] An array of entity objects if successful, false if
|
198
|
-
# unsuccessful.
|
199
|
-
#
|
200
|
-
# @version SketchUp 6.0
|
201
|
-
def explode
|
202
|
-
end
|
203
|
-
|
204
|
-
# The {#glued_to} method is used to retrieve the entity that this group is
|
205
|
-
# glued to.
|
206
|
-
#
|
207
|
-
# @example
|
208
|
-
# point = Geom::Point3d.new(10, 20, 30)
|
209
|
-
# transform = Geom::Transformation.new(point)
|
210
|
-
# model = Sketchup.active_model
|
211
|
-
# entities = model.active_entities
|
212
|
-
# group = entities.add_group
|
213
|
-
# group.entities.add_face([[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]])
|
214
|
-
# status = group.glued_to
|
215
|
-
#
|
216
|
-
# @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil]
|
217
|
-
#
|
218
|
-
# @version SketchUp 2021.1
|
219
|
-
def glued_to
|
220
|
-
end
|
221
|
-
|
222
|
-
# The {glued_to=} method glues this group to a drawing element.
|
223
|
-
# When moving this other drawing elment with the Move tool, the glued group moves with it.
|
224
|
-
#
|
225
|
-
# @example
|
226
|
-
# model = Sketchup.active_model
|
227
|
-
# entities = model.active_entities
|
228
|
-
#
|
229
|
-
# # Create a face
|
230
|
-
# face = entities.add_face([[0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0]])
|
231
|
-
#
|
232
|
-
# # Create a group
|
233
|
-
# definitions = model.definitions
|
234
|
-
# group = entities.add_group
|
235
|
-
# group.entities.add_face([[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]])
|
236
|
-
#
|
237
|
-
# # Make group "gluable"
|
238
|
-
# group.definition.behavior.is2d = true
|
239
|
-
#
|
240
|
-
# # Glue the group to the face.
|
241
|
-
# # If you now move the face, the group will follow.
|
242
|
-
# group.glued_to = face
|
243
|
-
#
|
244
|
-
# @param [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] drawing_element
|
245
|
-
#
|
246
|
-
# @raise ArgumentError if the {Sketchup::Behavior} for this group doesn't allow gluing,
|
247
|
-
# if the alignment is wrong, or if this would lead to cyclic gluing.
|
248
|
-
#
|
249
|
-
# @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] the entity the group was glued to.
|
250
|
-
#
|
251
|
-
# @version SketchUp 2021.1
|
252
|
-
def glued_to=(drawing_element)
|
253
|
-
end
|
254
|
-
|
255
|
-
# The guid method is used to get the base 64 encoded unique id
|
256
|
-
# for this SketchUp object.
|
257
|
-
#
|
258
|
-
# @example
|
259
|
-
# # Add a group to the model.
|
260
|
-
# group = Sketchup.active_model.entities.add_group
|
261
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
262
|
-
# guid = group.guid
|
263
|
-
#
|
264
|
-
# @return [String] a unique 22 character string
|
265
|
-
#
|
266
|
-
# @version SketchUp 2014
|
267
|
-
def guid
|
268
|
-
end
|
269
|
-
|
270
|
-
# The intersect method is used to compute the boolean intersection of two
|
271
|
-
# groups representing manifold solid volumes (this & arg). If the specified
|
272
|
-
# objects (this and arg) do not represent manifold volumes, this method fails.
|
273
|
-
#
|
274
|
-
# @example
|
275
|
-
# entities = Sketchup.active_model.entities
|
276
|
-
# group1 = entities[0]
|
277
|
-
# group2 = entities[1]
|
278
|
-
# result = group1.intersect(group2)
|
279
|
-
#
|
280
|
-
# @note This method is not available in SketchUp Make.
|
281
|
-
#
|
282
|
-
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
283
|
-
# The group to intersect this group with.
|
284
|
-
#
|
285
|
-
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
286
|
-
# (this and arg) represent manifold solids and the
|
287
|
-
# operation succeeds. Otherwise nil is returned.
|
288
|
-
#
|
289
|
-
# @version SketchUp 8.0
|
290
|
-
def intersect(group)
|
291
|
-
end
|
292
|
-
|
293
|
-
# The {#local_bounds} method is used to retrieve the {Geom::BoundingBox}
|
294
|
-
# bounding the contents of a {Sketchup::Group}, in the group's own internal
|
295
|
-
# coordinate system.
|
296
|
-
#
|
297
|
-
# @deprecated In favor of `group.definition.bounds`.
|
298
|
-
#
|
299
|
-
# @example
|
300
|
-
# # Add a group to the model.
|
301
|
-
# group = Sketchup.active_model.entities.add_group
|
302
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
303
|
-
# transformation = Geom::Transformation.new([100,0,0])
|
304
|
-
#
|
305
|
-
# # Note that local_bounds_1 and local_bounds_2 will be identical, since
|
306
|
-
# # they both find the bounding box in group's untransformed state.
|
307
|
-
# local_bounds_1 = group.local_bounds
|
308
|
-
# group.transform! transformation
|
309
|
-
# local_bounds_2 = group.local_bounds
|
310
|
-
#
|
311
|
-
# @return [Geom::BoundingBox]
|
312
|
-
#
|
313
|
-
# @version SketchUp 7.0
|
314
|
-
def local_bounds
|
315
|
-
end
|
316
|
-
|
317
|
-
# The locked= method is used to lock a group.
|
318
|
-
#
|
319
|
-
# @example
|
320
|
-
# # Add a group to the model.
|
321
|
-
# group = Sketchup.active_model.entities.add_group
|
322
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
323
|
-
# status = group.locked = true
|
324
|
-
#
|
325
|
-
# @param [Boolean] lock
|
326
|
-
#
|
327
|
-
# @return [Boolean] true if the group is locked, false if not
|
328
|
-
#
|
329
|
-
# @version SketchUp 6.0
|
330
|
-
def locked=(lock)
|
331
|
-
end
|
332
|
-
|
333
|
-
# The locked? method is used to determine if a group is locked.
|
334
|
-
#
|
335
|
-
# @example
|
336
|
-
# depth = 100
|
337
|
-
# width = 100
|
338
|
-
# model = Sketchup.active_model
|
339
|
-
# entities = model.active_entities
|
340
|
-
# pts = []
|
341
|
-
# pts[0] = [0, 0, 0]
|
342
|
-
# pts[1] = [width, 0, 0]
|
343
|
-
# pts[2] = [width, depth, 0]
|
344
|
-
# pts[3] = [0, depth, 0]
|
345
|
-
#
|
346
|
-
# # Add the group to the entities in the model
|
347
|
-
# group = entities.add_group
|
348
|
-
# status = group.locked?
|
349
|
-
# UI.messagebox status
|
350
|
-
#
|
351
|
-
# @return [Boolean]
|
352
|
-
#
|
353
|
-
# @version SketchUp 6.0
|
354
|
-
def locked?
|
355
|
-
end
|
356
|
-
|
357
|
-
# The {#make_unique} method is used to force a group to have a unique
|
358
|
-
# definition. If the group is already unique in the model, nothing happens.
|
359
|
-
#
|
360
|
-
# Copying a group in SketchUp will create a group that shares the same
|
361
|
-
# definition. SketchUp implicitly makes group unique when edited from the GUI,
|
362
|
-
# and from a user point of view groups could be thought of as always being
|
363
|
-
# unique. To honor this behavior, call this method before editing a group
|
364
|
-
# through the API.
|
365
|
-
#
|
366
|
-
# @example
|
367
|
-
# # Assume we have 2 groups, one copied from the other and sharing definitions
|
368
|
-
# groups = Sketchup.active_model.entities.grep(Sketchup::Group)
|
369
|
-
# groups[0].make_unique
|
370
|
-
# if (groups[0].entities.to_a == groups[1].entities.to_a)
|
371
|
-
# puts "This should not happen since we made the groups unique"
|
372
|
-
# end
|
373
|
-
#
|
374
|
-
# @return [Sketchup::Group] the unique group
|
375
|
-
#
|
376
|
-
# @version SketchUp 6.0
|
377
|
-
def make_unique
|
378
|
-
end
|
379
|
-
|
380
|
-
# The manifold? method is used to determine if a group is manifold.
|
381
|
-
#
|
382
|
-
# @example
|
383
|
-
# entities = Sketchup.active_model.entities
|
384
|
-
# definition = Sketchup.active_model.definitions[0]
|
385
|
-
# transformation = Geom::Transformation.new([0,0,0])
|
386
|
-
# group = entities.add_instance(definition, transformation)
|
387
|
-
# status = group.manifold?
|
388
|
-
#
|
389
|
-
# @return [Boolean]
|
390
|
-
#
|
391
|
-
# @version SketchUp 8.0
|
392
|
-
def manifold?
|
393
|
-
end
|
394
|
-
|
395
|
-
# The {#move!} method is used to set the transformation of this group
|
396
|
-
# instance, similarly to {#transformation=} but without recording to the undo
|
397
|
-
# stack.
|
398
|
-
#
|
399
|
-
# This method is useful for moving entities inside of an animation or page
|
400
|
-
# transition.
|
401
|
-
#
|
402
|
-
# @example
|
403
|
-
# point = Geom::Point3d.new 500,500,500
|
404
|
-
# transformation = Geom::Transformation.new point
|
405
|
-
# depth = 100
|
406
|
-
# width = 100
|
407
|
-
# model = Sketchup.active_model
|
408
|
-
# entities = model.active_entities
|
409
|
-
# pts = []
|
410
|
-
# pts[0] = [0, 0, 0]
|
411
|
-
# pts[1] = [width, 0, 0]
|
412
|
-
# pts[2] = [width, depth, 0]
|
413
|
-
# pts[3] = [0, depth, 0]
|
414
|
-
#
|
415
|
-
# # Add the group to the entities in the model
|
416
|
-
# group = entities.add_group
|
417
|
-
#
|
418
|
-
# # Get the entities within the group
|
419
|
-
# entities2 = group.entities
|
420
|
-
#
|
421
|
-
# # Add a face to within the group
|
422
|
-
# face = entities2.add_face pts
|
423
|
-
# UI.messagebox "Group before Move"
|
424
|
-
# group = group.move!(transformation)
|
425
|
-
#
|
426
|
-
# @note Despite the name being similar to {#transform!}, this method closer
|
427
|
-
# corresponds to {#transformation=}.
|
428
|
-
#
|
429
|
-
# @param [Geom::Transformation] transformation
|
430
|
-
#
|
431
|
-
# @return [Sketchup::Group] the transformed Group object if successful
|
432
|
-
#
|
433
|
-
# @version SketchUp 6.0
|
434
|
-
def move!(transformation)
|
435
|
-
end
|
436
|
-
|
437
|
-
# The name method is used to retrieve the name of the group.
|
438
|
-
#
|
439
|
-
# @example
|
440
|
-
# # Add a group to the model.
|
441
|
-
# group = Sketchup.active_model.entities.add_group
|
442
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
443
|
-
# group.name = "A Line"
|
444
|
-
# name = group.name
|
445
|
-
#
|
446
|
-
# @return [String] The name of the group if successful
|
447
|
-
#
|
448
|
-
# @version SketchUp 6.0
|
449
|
-
def name
|
450
|
-
end
|
451
|
-
|
452
|
-
# The name= method is used to set the description for the group.
|
453
|
-
#
|
454
|
-
# @example
|
455
|
-
# # Add a group to the model.
|
456
|
-
# group = Sketchup.active_model.entities.add_group
|
457
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
458
|
-
# group.name = "A Line"
|
459
|
-
# name = group.name
|
460
|
-
#
|
461
|
-
# @param [String] name
|
462
|
-
# A string name.
|
463
|
-
#
|
464
|
-
# @return [String] a new name if successful
|
465
|
-
#
|
466
|
-
# @version SketchUp 6.0
|
467
|
-
def name=(name)
|
468
|
-
end
|
469
|
-
|
470
|
-
# The outer_shell method is used to compute the outer shell of the two groups
|
471
|
-
# representing manifold solid volumes (this || arg). If the specified objects
|
472
|
-
# (this and arg) do not represent manifold volumes, this method fails.
|
473
|
-
#
|
474
|
-
# @example
|
475
|
-
# entities = Sketchup.active_model.entities
|
476
|
-
# group1 = entities[0]
|
477
|
-
# group2 = entities[1]
|
478
|
-
# result = group1.outer_shell(group2)
|
479
|
-
#
|
480
|
-
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
481
|
-
# The group to outer shell this group with.
|
482
|
-
#
|
483
|
-
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
484
|
-
# (this and arg) represent manifold solids and the
|
485
|
-
# operation succeeds otherwise nil is returned.
|
486
|
-
#
|
487
|
-
# @version SketchUp 8.0
|
488
|
-
def outer_shell(group)
|
489
|
-
end
|
490
|
-
|
491
|
-
# The remove_observer method is used to remove a ComponentInstance observer
|
492
|
-
# from the group.
|
493
|
-
#
|
494
|
-
# @example
|
495
|
-
# group = Sketchup.active_model.entities[0]
|
496
|
-
# if group != nil
|
497
|
-
# if group.is_a? Sketchup::Group
|
498
|
-
# status = group.remove_observer observer
|
499
|
-
# end
|
500
|
-
# end
|
501
|
-
#
|
502
|
-
# @param [Object] observer
|
503
|
-
# An observer.
|
504
|
-
#
|
505
|
-
# @return [Boolean] true if successful, false if unsuccessful.
|
506
|
-
#
|
507
|
-
# @version SketchUp 6.0
|
508
|
-
def remove_observer(observer)
|
509
|
-
end
|
510
|
-
|
511
|
-
# The show_differences method is used to determine if a group is
|
512
|
-
# geometrically equivalent to another group and in addition move the non-
|
513
|
-
# matching and matching geometry to new layers.
|
514
|
-
#
|
515
|
-
# This method will move both groups to Layer0. Geometry that is the same
|
516
|
-
# in both groups will be moved to a new layer named group_name + "_same".
|
517
|
-
# Geometry that is not the same will be moved to a layer named group_name +
|
518
|
-
# "_diff".
|
519
|
-
#
|
520
|
-
# If verbose is true, a list of all the geometry that is different
|
521
|
-
# from one group to the other is displayed texturally in the Ruby Console.
|
522
|
-
#
|
523
|
-
# @example
|
524
|
-
# entities = Sketchup.active_model.entities
|
525
|
-
# group1 = entities[0]
|
526
|
-
# group2 = entities[1]
|
527
|
-
# status = group1.show_differences(group2, true)
|
528
|
-
#
|
529
|
-
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
530
|
-
# The group to be compared with.
|
531
|
-
#
|
532
|
-
# @param [Boolean] verbose
|
533
|
-
# A boolean flag indicating whether to display a textural
|
534
|
-
# report of the found differences to the Ruby console.
|
535
|
-
#
|
536
|
-
# @return [Boolean] true if the groups are geometrically
|
537
|
-
# equivalent. Otherwise false.
|
538
|
-
#
|
539
|
-
# @version SketchUp 8.0
|
540
|
-
def show_differences(group, verbose)
|
541
|
-
end
|
542
|
-
|
543
|
-
# The split method is used to compute the boolean split (map overlay) of the
|
544
|
-
# two groups representing manifold solid volumes (this ^ arg). If the
|
545
|
-
# specified objects (this and arg) do not represent manifold volumes,
|
546
|
-
# this method fails.
|
547
|
-
#
|
548
|
-
# @example
|
549
|
-
# entities = Sketchup.active_model.entities
|
550
|
-
# group1 = entities[0]
|
551
|
-
# group2 = entities[1]
|
552
|
-
# result = group1.split(group2)
|
553
|
-
#
|
554
|
-
# @note This method is not available in SketchUp Make.
|
555
|
-
#
|
556
|
-
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
557
|
-
# The group to split this group with.
|
558
|
-
#
|
559
|
-
# @return [Array(Sketchup::Group, Sketchup::Group, Sketchup::Group), nil] A vector (array) of the three resultant groups
|
560
|
-
# If the two objects (this and arg) represent manifold
|
561
|
-
# solids and the operation succeeds otherwise nil is
|
562
|
-
# returned. The 3 groups are as follows:
|
563
|
-
# The intersection of volume 1 & volume 2,
|
564
|
-
# the difference of volume 1 minus volume 2,
|
565
|
-
# and the reverse difference of volume 2 minus volume 1.
|
566
|
-
#
|
567
|
-
# @version SketchUp 8.0
|
568
|
-
def split(group)
|
569
|
-
end
|
570
|
-
|
571
|
-
# The subtract method is used to compute the boolean difference of the two
|
572
|
-
# groups representing manifold solid volumes (this - arg). If the specified
|
573
|
-
# objects (this and arg) do not represent manifold volumes, this method fails.
|
574
|
-
#
|
575
|
-
# @example
|
576
|
-
# entities = Sketchup.active_model.entities
|
577
|
-
# group1 = entities[0]
|
578
|
-
# group2 = entities[1]
|
579
|
-
# result = group1.subtract(group2)
|
580
|
-
#
|
581
|
-
# @note This method is not available in SketchUp Make.
|
582
|
-
#
|
583
|
-
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
584
|
-
# The group to subtract this group from.
|
585
|
-
#
|
586
|
-
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
587
|
-
# (this and arg) represent manifold solids and the
|
588
|
-
# operation succeeds. Otherwise nil is returned.
|
589
|
-
#
|
590
|
-
# @version SketchUp 8.0
|
591
|
-
def subtract(group)
|
592
|
-
end
|
593
|
-
|
594
|
-
# The to_component method is used to convert the group to a component
|
595
|
-
# instance.
|
596
|
-
#
|
597
|
-
# @example
|
598
|
-
# # Add a group to the model.
|
599
|
-
# group = Sketchup.active_model.entities.add_group
|
600
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
601
|
-
#
|
602
|
-
# # change the group to a component instance
|
603
|
-
# group.to_component
|
604
|
-
#
|
605
|
-
# @return [Sketchup::ComponentInstance] the new ComponentInstance object
|
606
|
-
#
|
607
|
-
# @version SketchUp 6.0
|
608
|
-
def to_component
|
609
|
-
end
|
610
|
-
|
611
|
-
# The transform! method is used to apply a transformation to a group.
|
612
|
-
#
|
613
|
-
# @example
|
614
|
-
# point = Geom::Point3d.new 500,500,500
|
615
|
-
# t = Geom::Transformation.new point
|
616
|
-
# depth = 100
|
617
|
-
# width = 100
|
618
|
-
# model = Sketchup.active_model
|
619
|
-
# entities = model.active_entities
|
620
|
-
# pts = []
|
621
|
-
# pts[0] = [0, 0, 0]
|
622
|
-
# pts[1] = [width, 0, 0]
|
623
|
-
# pts[2] = [width, depth, 0]
|
624
|
-
# pts[3] = [0, depth, 0]
|
625
|
-
#
|
626
|
-
# # Add the group to the entities in the model
|
627
|
-
# group = entities.add_group
|
628
|
-
#
|
629
|
-
# # Get the entities within the group
|
630
|
-
# entities2 = group.entities
|
631
|
-
#
|
632
|
-
# # Add a face to within the group
|
633
|
-
# face = entities2.add_face pts
|
634
|
-
# UI.messagebox "Group before Move"
|
635
|
-
# group = group.transform! t
|
636
|
-
# if (group)
|
637
|
-
# UI.messagebox "Group after move"
|
638
|
-
# UI.messagebox group
|
639
|
-
# else
|
640
|
-
# UI.messagebox "Failure"
|
641
|
-
# end
|
642
|
-
#
|
643
|
-
# @param [Geom::Transformation] transform
|
644
|
-
# A Transformation object.
|
645
|
-
#
|
646
|
-
# @return [Sketchup::Group] a transformed group object if successful
|
647
|
-
#
|
648
|
-
# @version SketchUp 6.0
|
649
|
-
def transform!(transform)
|
650
|
-
end
|
651
|
-
|
652
|
-
# The transformation method is used to retrieve the transformation for the
|
653
|
-
# group.
|
654
|
-
#
|
655
|
-
# @example
|
656
|
-
# # Add a group to the model.
|
657
|
-
# group = Sketchup.active_model.entities.add_group
|
658
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
659
|
-
#
|
660
|
-
# trans = group.transformation
|
661
|
-
#
|
662
|
-
# @return [Geom::Transformation] a Transformation object if successful
|
663
|
-
#
|
664
|
-
# @version SketchUp 6.0
|
665
|
-
def transformation
|
666
|
-
end
|
667
|
-
|
668
|
-
# The {#transformation=} method is used to set the transformation of this
|
669
|
-
# group
|
670
|
-
#
|
671
|
-
# @example
|
672
|
-
# # Add a group to the model.
|
673
|
-
# group = Sketchup.active_model.entities.add_group
|
674
|
-
# group.entities.add_line([0,0,0],[100,100,100])
|
675
|
-
#
|
676
|
-
# new_transformation = Geom::Transformation.new([100,0,0])
|
677
|
-
# group.transformation = new_transformation
|
678
|
-
#
|
679
|
-
# @param [Geom::Transformation] transformation
|
680
|
-
#
|
681
|
-
# @version SketchUp 6.0
|
682
|
-
def transformation=(transformation)
|
683
|
-
end
|
684
|
-
|
685
|
-
# The trim method is used to compute the (non-destructive) boolean difference
|
686
|
-
# of the two groups representing manifold solid volumes (this - arg). If
|
687
|
-
# the specified objects (this and arg) do not represent manifold volumes, this
|
688
|
-
# method fails.
|
689
|
-
#
|
690
|
-
# @example
|
691
|
-
# entities = Sketchup.active_model.entities
|
692
|
-
# group1 = entities[0]
|
693
|
-
# group2 = entities[1]
|
694
|
-
# result = group1.trim(group2)
|
695
|
-
#
|
696
|
-
# @note This method is not available in SketchUp Make.
|
697
|
-
#
|
698
|
-
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
699
|
-
# The group to trim this group against.
|
700
|
-
#
|
701
|
-
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
702
|
-
# (this and arg) represent manifold solids and the
|
703
|
-
# operation succeeds otherwise nil is returned.
|
704
|
-
#
|
705
|
-
# @version SketchUp 8.0
|
706
|
-
def trim(group)
|
707
|
-
end
|
708
|
-
|
709
|
-
# The union method is used to compute the boolean union of the two groups
|
710
|
-
# representing manifold solid volumes (this | arg). If the specified
|
711
|
-
# objects (this and arg) do not represent manifold volumes, this method fails.
|
712
|
-
#
|
713
|
-
# @example
|
714
|
-
# entities = Sketchup.active_model.entities
|
715
|
-
# group1 = entities[0]
|
716
|
-
# group2 = entities[1]
|
717
|
-
# result = group1.union(group2)
|
718
|
-
#
|
719
|
-
# @note This method is not available in SketchUp Make.
|
720
|
-
#
|
721
|
-
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
722
|
-
# The group to union this group with.
|
723
|
-
#
|
724
|
-
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
725
|
-
# (this and arg) represent manifold solids and the
|
726
|
-
# operation succeeds. Otherwise nil is returned.
|
727
|
-
#
|
728
|
-
# @version SketchUp 8.0
|
729
|
-
def union(group)
|
730
|
-
end
|
731
|
-
|
732
|
-
# The volume method is used to compute the volume of this group if and only
|
733
|
-
# if this group is manifold.
|
734
|
-
#
|
735
|
-
# @example
|
736
|
-
# entities = Sketchup.active_model.entities
|
737
|
-
# definition = Sketchup.active_model.definitions[0]
|
738
|
-
# transformation = Geom::Transformation.new([0,0,0])
|
739
|
-
# group = entities.add_instance(definition, transformation)
|
740
|
-
# volume = group.volume
|
741
|
-
#
|
742
|
-
# @return [Float] If the group represents a manifold volume,
|
743
|
-
# volume will be a positive value. If volume is negative,
|
744
|
-
# the group is not manifold.
|
745
|
-
#
|
746
|
-
# @version SketchUp 8.0
|
747
|
-
def volume
|
748
|
-
end
|
749
|
-
|
750
|
-
end
|
1
|
+
# Copyright:: Copyright 2023 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# A Group class contains methods for manipulating groups of entities.
|
5
|
+
#
|
6
|
+
# Groups in SketchUp are very similar to components, but can from a user point
|
7
|
+
# of view be thought of as unique objects. Groups can be instanced when copied
|
8
|
+
# but are silently made unique when edited through the GUI. To honor this
|
9
|
+
# behavior, make sure to call {#make_unique} before modifying a group through
|
10
|
+
# the API.
|
11
|
+
#
|
12
|
+
# @version SketchUp 6.0
|
13
|
+
class Sketchup::Group < Sketchup::Drawingelement
|
14
|
+
|
15
|
+
# Instance Methods
|
16
|
+
|
17
|
+
# The add_observer method is used to add a ComponentInstance observer to the
|
18
|
+
# group.
|
19
|
+
#
|
20
|
+
# @example
|
21
|
+
# # Add a group to the model.
|
22
|
+
# group = Sketchup.active_model.entities.add_group
|
23
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
24
|
+
# status = group.add_observer observer
|
25
|
+
#
|
26
|
+
# @param [Object] observer
|
27
|
+
# An observer.
|
28
|
+
#
|
29
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
30
|
+
#
|
31
|
+
# @version SketchUp 6.0
|
32
|
+
def add_observer(observer)
|
33
|
+
end
|
34
|
+
|
35
|
+
# The copy method is used to create a new Group object that is a copy of the
|
36
|
+
# group.
|
37
|
+
#
|
38
|
+
# @example
|
39
|
+
# # Add a group to the model.
|
40
|
+
# group = Sketchup.active_model.entities.add_group
|
41
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
42
|
+
# group2 = group.copy
|
43
|
+
#
|
44
|
+
# @return [Sketchup::Group] a new Group object
|
45
|
+
#
|
46
|
+
# @version SketchUp 6.0
|
47
|
+
def copy
|
48
|
+
end
|
49
|
+
|
50
|
+
# The definition method is used to retrieve the component definition for this
|
51
|
+
# group.
|
52
|
+
#
|
53
|
+
# @example
|
54
|
+
# group = Sketchup.active_model.entities.add_group
|
55
|
+
# definition = group.definition
|
56
|
+
#
|
57
|
+
# @return [Sketchup::ComponentDefinition] a ComponentDefinition object if
|
58
|
+
# successful
|
59
|
+
#
|
60
|
+
# @version SketchUp 2015
|
61
|
+
def definition
|
62
|
+
end
|
63
|
+
|
64
|
+
# The description method is used to retrieve the description for the group.
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# depth = 100
|
68
|
+
# width = 100
|
69
|
+
# model = Sketchup.active_model
|
70
|
+
# entities = model.active_entities
|
71
|
+
# pts = []
|
72
|
+
# pts[0] = [0, 0, 0]
|
73
|
+
# pts[1] = [width, 0, 0]
|
74
|
+
# pts[2] = [width, depth, 0]
|
75
|
+
# pts[3] = [0, depth, 0]
|
76
|
+
# # Add the group to the entities in the model
|
77
|
+
# group = entities.add_group
|
78
|
+
#
|
79
|
+
# # Get the entities within the group
|
80
|
+
# entities2 = group.entities
|
81
|
+
#
|
82
|
+
# # Add a face to within the group
|
83
|
+
# face = entities2.add_face pts
|
84
|
+
# group.description = "This is a Group with a 2d Face"
|
85
|
+
# description = group.description
|
86
|
+
#
|
87
|
+
# @return [String] a string description if successful
|
88
|
+
#
|
89
|
+
# @version SketchUp 6.0
|
90
|
+
def description
|
91
|
+
end
|
92
|
+
|
93
|
+
# The description= method is used to set the description for the group.
|
94
|
+
#
|
95
|
+
# @example
|
96
|
+
# depth = 100
|
97
|
+
# width = 100
|
98
|
+
# model = Sketchup.active_model
|
99
|
+
# entities = model.active_entities
|
100
|
+
# pts = []
|
101
|
+
# pts[0] = [0, 0, 0]
|
102
|
+
# pts[1] = [width, 0, 0]
|
103
|
+
# pts[2] = [width, depth, 0]
|
104
|
+
# pts[3] = [0, depth, 0]
|
105
|
+
#
|
106
|
+
# # Add the group to the entities in the model
|
107
|
+
# group = entities.add_group
|
108
|
+
#
|
109
|
+
# # Get the entities within the group
|
110
|
+
# entities2 = group.entities
|
111
|
+
#
|
112
|
+
# # Add a face to within the group
|
113
|
+
# face = entities2.add_face pts
|
114
|
+
# group.description = "This is a Group with a 2d Face"
|
115
|
+
# description = group.description
|
116
|
+
# if (description)
|
117
|
+
# UI.messagebox description
|
118
|
+
# else
|
119
|
+
# UI.messagebox "Failure"
|
120
|
+
# end
|
121
|
+
#
|
122
|
+
# @param [String] description
|
123
|
+
# A string description.
|
124
|
+
#
|
125
|
+
# @return [String] the new description if successful
|
126
|
+
#
|
127
|
+
# @version SketchUp 6.0
|
128
|
+
def description=(description)
|
129
|
+
end
|
130
|
+
|
131
|
+
# The entities method is used to retrieve a collection of entities in the
|
132
|
+
# group.
|
133
|
+
#
|
134
|
+
# @example
|
135
|
+
# depth = 100
|
136
|
+
# width = 100
|
137
|
+
# model = Sketchup.active_model
|
138
|
+
# entities = model.active_entities
|
139
|
+
# pts = []
|
140
|
+
# pts[0] = [0, 0, 0]
|
141
|
+
# pts[1] = [width, 0, 0]
|
142
|
+
# pts[2] = [width, depth, 0]
|
143
|
+
# pts[3] = [0, depth, 0]
|
144
|
+
# # Add the group to the entities in the model
|
145
|
+
# group = entities.add_group
|
146
|
+
#
|
147
|
+
# # Get the entities within the group
|
148
|
+
# entities2 = group.entities
|
149
|
+
#
|
150
|
+
# # Add a face to within the group
|
151
|
+
# face = entities2.add_face pts
|
152
|
+
# entities = group.entities
|
153
|
+
# if (entities)
|
154
|
+
# UI.messagebox entities
|
155
|
+
# else
|
156
|
+
# UI.messagebox "Failure"
|
157
|
+
# end
|
158
|
+
#
|
159
|
+
# @return [Sketchup::Entities] an Entities object if successful
|
160
|
+
#
|
161
|
+
# @version SketchUp 6.0
|
162
|
+
def entities
|
163
|
+
end
|
164
|
+
|
165
|
+
# The equals? method is used to determine if a group is geometrically
|
166
|
+
# equivalent to another group.
|
167
|
+
#
|
168
|
+
# @example
|
169
|
+
# entities = Sketchup.active_model.entities
|
170
|
+
# group1 = entities[0]
|
171
|
+
# group2 = entities[1]
|
172
|
+
# status = group1.equals?(group2)
|
173
|
+
#
|
174
|
+
# @param [Sketchup::Group] group
|
175
|
+
# The group to compare this group with.
|
176
|
+
#
|
177
|
+
# @return [Boolean]
|
178
|
+
#
|
179
|
+
# @version SketchUp 8.0
|
180
|
+
def equals?(group)
|
181
|
+
end
|
182
|
+
|
183
|
+
# The explode method is used to explode the group into individual entities.
|
184
|
+
#
|
185
|
+
# @example
|
186
|
+
# # Add a group to the model.
|
187
|
+
# group = Sketchup.active_model.entities.add_group
|
188
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
189
|
+
#
|
190
|
+
# array = group.explode
|
191
|
+
# if array
|
192
|
+
# UI.messagebox "Exploded the group"
|
193
|
+
# else
|
194
|
+
# UI.messagebox "Failure"
|
195
|
+
# end
|
196
|
+
#
|
197
|
+
# @return [Array<Sketchup::Drawingelement>] An array of entity objects if successful, false if
|
198
|
+
# unsuccessful.
|
199
|
+
#
|
200
|
+
# @version SketchUp 6.0
|
201
|
+
def explode
|
202
|
+
end
|
203
|
+
|
204
|
+
# The {#glued_to} method is used to retrieve the entity that this group is
|
205
|
+
# glued to.
|
206
|
+
#
|
207
|
+
# @example
|
208
|
+
# point = Geom::Point3d.new(10, 20, 30)
|
209
|
+
# transform = Geom::Transformation.new(point)
|
210
|
+
# model = Sketchup.active_model
|
211
|
+
# entities = model.active_entities
|
212
|
+
# group = entities.add_group
|
213
|
+
# group.entities.add_face([[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]])
|
214
|
+
# status = group.glued_to
|
215
|
+
#
|
216
|
+
# @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil]
|
217
|
+
#
|
218
|
+
# @version SketchUp 2021.1
|
219
|
+
def glued_to
|
220
|
+
end
|
221
|
+
|
222
|
+
# The {glued_to=} method glues this group to a drawing element.
|
223
|
+
# When moving this other drawing elment with the Move tool, the glued group moves with it.
|
224
|
+
#
|
225
|
+
# @example
|
226
|
+
# model = Sketchup.active_model
|
227
|
+
# entities = model.active_entities
|
228
|
+
#
|
229
|
+
# # Create a face
|
230
|
+
# face = entities.add_face([[0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0]])
|
231
|
+
#
|
232
|
+
# # Create a group
|
233
|
+
# definitions = model.definitions
|
234
|
+
# group = entities.add_group
|
235
|
+
# group.entities.add_face([[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]])
|
236
|
+
#
|
237
|
+
# # Make group "gluable"
|
238
|
+
# group.definition.behavior.is2d = true
|
239
|
+
#
|
240
|
+
# # Glue the group to the face.
|
241
|
+
# # If you now move the face, the group will follow.
|
242
|
+
# group.glued_to = face
|
243
|
+
#
|
244
|
+
# @param [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] drawing_element
|
245
|
+
#
|
246
|
+
# @raise ArgumentError if the {Sketchup::Behavior} for this group doesn't allow gluing,
|
247
|
+
# if the alignment is wrong, or if this would lead to cyclic gluing.
|
248
|
+
#
|
249
|
+
# @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] the entity the group was glued to.
|
250
|
+
#
|
251
|
+
# @version SketchUp 2021.1
|
252
|
+
def glued_to=(drawing_element)
|
253
|
+
end
|
254
|
+
|
255
|
+
# The guid method is used to get the base 64 encoded unique id
|
256
|
+
# for this SketchUp object.
|
257
|
+
#
|
258
|
+
# @example
|
259
|
+
# # Add a group to the model.
|
260
|
+
# group = Sketchup.active_model.entities.add_group
|
261
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
262
|
+
# guid = group.guid
|
263
|
+
#
|
264
|
+
# @return [String] a unique 22 character string
|
265
|
+
#
|
266
|
+
# @version SketchUp 2014
|
267
|
+
def guid
|
268
|
+
end
|
269
|
+
|
270
|
+
# The intersect method is used to compute the boolean intersection of two
|
271
|
+
# groups representing manifold solid volumes (this & arg). If the specified
|
272
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
273
|
+
#
|
274
|
+
# @example
|
275
|
+
# entities = Sketchup.active_model.entities
|
276
|
+
# group1 = entities[0]
|
277
|
+
# group2 = entities[1]
|
278
|
+
# result = group1.intersect(group2)
|
279
|
+
#
|
280
|
+
# @note This method is not available in SketchUp Make.
|
281
|
+
#
|
282
|
+
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
283
|
+
# The group to intersect this group with.
|
284
|
+
#
|
285
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
286
|
+
# (this and arg) represent manifold solids and the
|
287
|
+
# operation succeeds. Otherwise nil is returned.
|
288
|
+
#
|
289
|
+
# @version SketchUp 8.0
|
290
|
+
def intersect(group)
|
291
|
+
end
|
292
|
+
|
293
|
+
# The {#local_bounds} method is used to retrieve the {Geom::BoundingBox}
|
294
|
+
# bounding the contents of a {Sketchup::Group}, in the group's own internal
|
295
|
+
# coordinate system.
|
296
|
+
#
|
297
|
+
# @deprecated In favor of `group.definition.bounds`.
|
298
|
+
#
|
299
|
+
# @example
|
300
|
+
# # Add a group to the model.
|
301
|
+
# group = Sketchup.active_model.entities.add_group
|
302
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
303
|
+
# transformation = Geom::Transformation.new([100,0,0])
|
304
|
+
#
|
305
|
+
# # Note that local_bounds_1 and local_bounds_2 will be identical, since
|
306
|
+
# # they both find the bounding box in group's untransformed state.
|
307
|
+
# local_bounds_1 = group.local_bounds
|
308
|
+
# group.transform! transformation
|
309
|
+
# local_bounds_2 = group.local_bounds
|
310
|
+
#
|
311
|
+
# @return [Geom::BoundingBox]
|
312
|
+
#
|
313
|
+
# @version SketchUp 7.0
|
314
|
+
def local_bounds
|
315
|
+
end
|
316
|
+
|
317
|
+
# The locked= method is used to lock a group.
|
318
|
+
#
|
319
|
+
# @example
|
320
|
+
# # Add a group to the model.
|
321
|
+
# group = Sketchup.active_model.entities.add_group
|
322
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
323
|
+
# status = group.locked = true
|
324
|
+
#
|
325
|
+
# @param [Boolean] lock
|
326
|
+
#
|
327
|
+
# @return [Boolean] true if the group is locked, false if not
|
328
|
+
#
|
329
|
+
# @version SketchUp 6.0
|
330
|
+
def locked=(lock)
|
331
|
+
end
|
332
|
+
|
333
|
+
# The locked? method is used to determine if a group is locked.
|
334
|
+
#
|
335
|
+
# @example
|
336
|
+
# depth = 100
|
337
|
+
# width = 100
|
338
|
+
# model = Sketchup.active_model
|
339
|
+
# entities = model.active_entities
|
340
|
+
# pts = []
|
341
|
+
# pts[0] = [0, 0, 0]
|
342
|
+
# pts[1] = [width, 0, 0]
|
343
|
+
# pts[2] = [width, depth, 0]
|
344
|
+
# pts[3] = [0, depth, 0]
|
345
|
+
#
|
346
|
+
# # Add the group to the entities in the model
|
347
|
+
# group = entities.add_group
|
348
|
+
# status = group.locked?
|
349
|
+
# UI.messagebox status
|
350
|
+
#
|
351
|
+
# @return [Boolean]
|
352
|
+
#
|
353
|
+
# @version SketchUp 6.0
|
354
|
+
def locked?
|
355
|
+
end
|
356
|
+
|
357
|
+
# The {#make_unique} method is used to force a group to have a unique
|
358
|
+
# definition. If the group is already unique in the model, nothing happens.
|
359
|
+
#
|
360
|
+
# Copying a group in SketchUp will create a group that shares the same
|
361
|
+
# definition. SketchUp implicitly makes group unique when edited from the GUI,
|
362
|
+
# and from a user point of view groups could be thought of as always being
|
363
|
+
# unique. To honor this behavior, call this method before editing a group
|
364
|
+
# through the API.
|
365
|
+
#
|
366
|
+
# @example
|
367
|
+
# # Assume we have 2 groups, one copied from the other and sharing definitions
|
368
|
+
# groups = Sketchup.active_model.entities.grep(Sketchup::Group)
|
369
|
+
# groups[0].make_unique
|
370
|
+
# if (groups[0].entities.to_a == groups[1].entities.to_a)
|
371
|
+
# puts "This should not happen since we made the groups unique"
|
372
|
+
# end
|
373
|
+
#
|
374
|
+
# @return [Sketchup::Group] the unique group
|
375
|
+
#
|
376
|
+
# @version SketchUp 6.0
|
377
|
+
def make_unique
|
378
|
+
end
|
379
|
+
|
380
|
+
# The manifold? method is used to determine if a group is manifold.
|
381
|
+
#
|
382
|
+
# @example
|
383
|
+
# entities = Sketchup.active_model.entities
|
384
|
+
# definition = Sketchup.active_model.definitions[0]
|
385
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
386
|
+
# group = entities.add_instance(definition, transformation)
|
387
|
+
# status = group.manifold?
|
388
|
+
#
|
389
|
+
# @return [Boolean]
|
390
|
+
#
|
391
|
+
# @version SketchUp 8.0
|
392
|
+
def manifold?
|
393
|
+
end
|
394
|
+
|
395
|
+
# The {#move!} method is used to set the transformation of this group
|
396
|
+
# instance, similarly to {#transformation=} but without recording to the undo
|
397
|
+
# stack.
|
398
|
+
#
|
399
|
+
# This method is useful for moving entities inside of an animation or page
|
400
|
+
# transition.
|
401
|
+
#
|
402
|
+
# @example
|
403
|
+
# point = Geom::Point3d.new 500,500,500
|
404
|
+
# transformation = Geom::Transformation.new point
|
405
|
+
# depth = 100
|
406
|
+
# width = 100
|
407
|
+
# model = Sketchup.active_model
|
408
|
+
# entities = model.active_entities
|
409
|
+
# pts = []
|
410
|
+
# pts[0] = [0, 0, 0]
|
411
|
+
# pts[1] = [width, 0, 0]
|
412
|
+
# pts[2] = [width, depth, 0]
|
413
|
+
# pts[3] = [0, depth, 0]
|
414
|
+
#
|
415
|
+
# # Add the group to the entities in the model
|
416
|
+
# group = entities.add_group
|
417
|
+
#
|
418
|
+
# # Get the entities within the group
|
419
|
+
# entities2 = group.entities
|
420
|
+
#
|
421
|
+
# # Add a face to within the group
|
422
|
+
# face = entities2.add_face pts
|
423
|
+
# UI.messagebox "Group before Move"
|
424
|
+
# group = group.move!(transformation)
|
425
|
+
#
|
426
|
+
# @note Despite the name being similar to {#transform!}, this method closer
|
427
|
+
# corresponds to {#transformation=}.
|
428
|
+
#
|
429
|
+
# @param [Geom::Transformation] transformation
|
430
|
+
#
|
431
|
+
# @return [Sketchup::Group] the transformed Group object if successful
|
432
|
+
#
|
433
|
+
# @version SketchUp 6.0
|
434
|
+
def move!(transformation)
|
435
|
+
end
|
436
|
+
|
437
|
+
# The name method is used to retrieve the name of the group.
|
438
|
+
#
|
439
|
+
# @example
|
440
|
+
# # Add a group to the model.
|
441
|
+
# group = Sketchup.active_model.entities.add_group
|
442
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
443
|
+
# group.name = "A Line"
|
444
|
+
# name = group.name
|
445
|
+
#
|
446
|
+
# @return [String] The name of the group if successful
|
447
|
+
#
|
448
|
+
# @version SketchUp 6.0
|
449
|
+
def name
|
450
|
+
end
|
451
|
+
|
452
|
+
# The name= method is used to set the description for the group.
|
453
|
+
#
|
454
|
+
# @example
|
455
|
+
# # Add a group to the model.
|
456
|
+
# group = Sketchup.active_model.entities.add_group
|
457
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
458
|
+
# group.name = "A Line"
|
459
|
+
# name = group.name
|
460
|
+
#
|
461
|
+
# @param [String] name
|
462
|
+
# A string name.
|
463
|
+
#
|
464
|
+
# @return [String] a new name if successful
|
465
|
+
#
|
466
|
+
# @version SketchUp 6.0
|
467
|
+
def name=(name)
|
468
|
+
end
|
469
|
+
|
470
|
+
# The outer_shell method is used to compute the outer shell of the two groups
|
471
|
+
# representing manifold solid volumes (this || arg). If the specified objects
|
472
|
+
# (this and arg) do not represent manifold volumes, this method fails.
|
473
|
+
#
|
474
|
+
# @example
|
475
|
+
# entities = Sketchup.active_model.entities
|
476
|
+
# group1 = entities[0]
|
477
|
+
# group2 = entities[1]
|
478
|
+
# result = group1.outer_shell(group2)
|
479
|
+
#
|
480
|
+
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
481
|
+
# The group to outer shell this group with.
|
482
|
+
#
|
483
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
484
|
+
# (this and arg) represent manifold solids and the
|
485
|
+
# operation succeeds otherwise nil is returned.
|
486
|
+
#
|
487
|
+
# @version SketchUp 8.0
|
488
|
+
def outer_shell(group)
|
489
|
+
end
|
490
|
+
|
491
|
+
# The remove_observer method is used to remove a ComponentInstance observer
|
492
|
+
# from the group.
|
493
|
+
#
|
494
|
+
# @example
|
495
|
+
# group = Sketchup.active_model.entities[0]
|
496
|
+
# if group != nil
|
497
|
+
# if group.is_a? Sketchup::Group
|
498
|
+
# status = group.remove_observer observer
|
499
|
+
# end
|
500
|
+
# end
|
501
|
+
#
|
502
|
+
# @param [Object] observer
|
503
|
+
# An observer.
|
504
|
+
#
|
505
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
506
|
+
#
|
507
|
+
# @version SketchUp 6.0
|
508
|
+
def remove_observer(observer)
|
509
|
+
end
|
510
|
+
|
511
|
+
# The show_differences method is used to determine if a group is
|
512
|
+
# geometrically equivalent to another group and in addition move the non-
|
513
|
+
# matching and matching geometry to new layers.
|
514
|
+
#
|
515
|
+
# This method will move both groups to Layer0. Geometry that is the same
|
516
|
+
# in both groups will be moved to a new layer named group_name + "_same".
|
517
|
+
# Geometry that is not the same will be moved to a layer named group_name +
|
518
|
+
# "_diff".
|
519
|
+
#
|
520
|
+
# If verbose is true, a list of all the geometry that is different
|
521
|
+
# from one group to the other is displayed texturally in the Ruby Console.
|
522
|
+
#
|
523
|
+
# @example
|
524
|
+
# entities = Sketchup.active_model.entities
|
525
|
+
# group1 = entities[0]
|
526
|
+
# group2 = entities[1]
|
527
|
+
# status = group1.show_differences(group2, true)
|
528
|
+
#
|
529
|
+
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
530
|
+
# The group to be compared with.
|
531
|
+
#
|
532
|
+
# @param [Boolean] verbose
|
533
|
+
# A boolean flag indicating whether to display a textural
|
534
|
+
# report of the found differences to the Ruby console.
|
535
|
+
#
|
536
|
+
# @return [Boolean] true if the groups are geometrically
|
537
|
+
# equivalent. Otherwise false.
|
538
|
+
#
|
539
|
+
# @version SketchUp 8.0
|
540
|
+
def show_differences(group, verbose)
|
541
|
+
end
|
542
|
+
|
543
|
+
# The split method is used to compute the boolean split (map overlay) of the
|
544
|
+
# two groups representing manifold solid volumes (this ^ arg). If the
|
545
|
+
# specified objects (this and arg) do not represent manifold volumes,
|
546
|
+
# this method fails.
|
547
|
+
#
|
548
|
+
# @example
|
549
|
+
# entities = Sketchup.active_model.entities
|
550
|
+
# group1 = entities[0]
|
551
|
+
# group2 = entities[1]
|
552
|
+
# result = group1.split(group2)
|
553
|
+
#
|
554
|
+
# @note This method is not available in SketchUp Make.
|
555
|
+
#
|
556
|
+
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
557
|
+
# The group to split this group with.
|
558
|
+
#
|
559
|
+
# @return [Array(Sketchup::Group, Sketchup::Group, Sketchup::Group), nil] A vector (array) of the three resultant groups
|
560
|
+
# If the two objects (this and arg) represent manifold
|
561
|
+
# solids and the operation succeeds otherwise nil is
|
562
|
+
# returned. The 3 groups are as follows:
|
563
|
+
# The intersection of volume 1 & volume 2,
|
564
|
+
# the difference of volume 1 minus volume 2,
|
565
|
+
# and the reverse difference of volume 2 minus volume 1.
|
566
|
+
#
|
567
|
+
# @version SketchUp 8.0
|
568
|
+
def split(group)
|
569
|
+
end
|
570
|
+
|
571
|
+
# The subtract method is used to compute the boolean difference of the two
|
572
|
+
# groups representing manifold solid volumes (this - arg). If the specified
|
573
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
574
|
+
#
|
575
|
+
# @example
|
576
|
+
# entities = Sketchup.active_model.entities
|
577
|
+
# group1 = entities[0]
|
578
|
+
# group2 = entities[1]
|
579
|
+
# result = group1.subtract(group2)
|
580
|
+
#
|
581
|
+
# @note This method is not available in SketchUp Make.
|
582
|
+
#
|
583
|
+
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
584
|
+
# The group to subtract this group from.
|
585
|
+
#
|
586
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
587
|
+
# (this and arg) represent manifold solids and the
|
588
|
+
# operation succeeds. Otherwise nil is returned.
|
589
|
+
#
|
590
|
+
# @version SketchUp 8.0
|
591
|
+
def subtract(group)
|
592
|
+
end
|
593
|
+
|
594
|
+
# The to_component method is used to convert the group to a component
|
595
|
+
# instance.
|
596
|
+
#
|
597
|
+
# @example
|
598
|
+
# # Add a group to the model.
|
599
|
+
# group = Sketchup.active_model.entities.add_group
|
600
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
601
|
+
#
|
602
|
+
# # change the group to a component instance
|
603
|
+
# group.to_component
|
604
|
+
#
|
605
|
+
# @return [Sketchup::ComponentInstance] the new ComponentInstance object
|
606
|
+
#
|
607
|
+
# @version SketchUp 6.0
|
608
|
+
def to_component
|
609
|
+
end
|
610
|
+
|
611
|
+
# The transform! method is used to apply a transformation to a group.
|
612
|
+
#
|
613
|
+
# @example
|
614
|
+
# point = Geom::Point3d.new 500,500,500
|
615
|
+
# t = Geom::Transformation.new point
|
616
|
+
# depth = 100
|
617
|
+
# width = 100
|
618
|
+
# model = Sketchup.active_model
|
619
|
+
# entities = model.active_entities
|
620
|
+
# pts = []
|
621
|
+
# pts[0] = [0, 0, 0]
|
622
|
+
# pts[1] = [width, 0, 0]
|
623
|
+
# pts[2] = [width, depth, 0]
|
624
|
+
# pts[3] = [0, depth, 0]
|
625
|
+
#
|
626
|
+
# # Add the group to the entities in the model
|
627
|
+
# group = entities.add_group
|
628
|
+
#
|
629
|
+
# # Get the entities within the group
|
630
|
+
# entities2 = group.entities
|
631
|
+
#
|
632
|
+
# # Add a face to within the group
|
633
|
+
# face = entities2.add_face pts
|
634
|
+
# UI.messagebox "Group before Move"
|
635
|
+
# group = group.transform! t
|
636
|
+
# if (group)
|
637
|
+
# UI.messagebox "Group after move"
|
638
|
+
# UI.messagebox group
|
639
|
+
# else
|
640
|
+
# UI.messagebox "Failure"
|
641
|
+
# end
|
642
|
+
#
|
643
|
+
# @param [Geom::Transformation] transform
|
644
|
+
# A Transformation object.
|
645
|
+
#
|
646
|
+
# @return [Sketchup::Group] a transformed group object if successful
|
647
|
+
#
|
648
|
+
# @version SketchUp 6.0
|
649
|
+
def transform!(transform)
|
650
|
+
end
|
651
|
+
|
652
|
+
# The transformation method is used to retrieve the transformation for the
|
653
|
+
# group.
|
654
|
+
#
|
655
|
+
# @example
|
656
|
+
# # Add a group to the model.
|
657
|
+
# group = Sketchup.active_model.entities.add_group
|
658
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
659
|
+
#
|
660
|
+
# trans = group.transformation
|
661
|
+
#
|
662
|
+
# @return [Geom::Transformation] a Transformation object if successful
|
663
|
+
#
|
664
|
+
# @version SketchUp 6.0
|
665
|
+
def transformation
|
666
|
+
end
|
667
|
+
|
668
|
+
# The {#transformation=} method is used to set the transformation of this
|
669
|
+
# group
|
670
|
+
#
|
671
|
+
# @example
|
672
|
+
# # Add a group to the model.
|
673
|
+
# group = Sketchup.active_model.entities.add_group
|
674
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
675
|
+
#
|
676
|
+
# new_transformation = Geom::Transformation.new([100,0,0])
|
677
|
+
# group.transformation = new_transformation
|
678
|
+
#
|
679
|
+
# @param [Geom::Transformation] transformation
|
680
|
+
#
|
681
|
+
# @version SketchUp 6.0
|
682
|
+
def transformation=(transformation)
|
683
|
+
end
|
684
|
+
|
685
|
+
# The trim method is used to compute the (non-destructive) boolean difference
|
686
|
+
# of the two groups representing manifold solid volumes (this - arg). If
|
687
|
+
# the specified objects (this and arg) do not represent manifold volumes, this
|
688
|
+
# method fails.
|
689
|
+
#
|
690
|
+
# @example
|
691
|
+
# entities = Sketchup.active_model.entities
|
692
|
+
# group1 = entities[0]
|
693
|
+
# group2 = entities[1]
|
694
|
+
# result = group1.trim(group2)
|
695
|
+
#
|
696
|
+
# @note This method is not available in SketchUp Make.
|
697
|
+
#
|
698
|
+
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
699
|
+
# The group to trim this group against.
|
700
|
+
#
|
701
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
702
|
+
# (this and arg) represent manifold solids and the
|
703
|
+
# operation succeeds otherwise nil is returned.
|
704
|
+
#
|
705
|
+
# @version SketchUp 8.0
|
706
|
+
def trim(group)
|
707
|
+
end
|
708
|
+
|
709
|
+
# The union method is used to compute the boolean union of the two groups
|
710
|
+
# representing manifold solid volumes (this | arg). If the specified
|
711
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
712
|
+
#
|
713
|
+
# @example
|
714
|
+
# entities = Sketchup.active_model.entities
|
715
|
+
# group1 = entities[0]
|
716
|
+
# group2 = entities[1]
|
717
|
+
# result = group1.union(group2)
|
718
|
+
#
|
719
|
+
# @note This method is not available in SketchUp Make.
|
720
|
+
#
|
721
|
+
# @param [Sketchup::Group, Sketchup::ComponentInstance] group
|
722
|
+
# The group to union this group with.
|
723
|
+
#
|
724
|
+
# @return [Sketchup::Group, nil] The resultant group if the two objects
|
725
|
+
# (this and arg) represent manifold solids and the
|
726
|
+
# operation succeeds. Otherwise nil is returned.
|
727
|
+
#
|
728
|
+
# @version SketchUp 8.0
|
729
|
+
def union(group)
|
730
|
+
end
|
731
|
+
|
732
|
+
# The volume method is used to compute the volume of this group if and only
|
733
|
+
# if this group is manifold.
|
734
|
+
#
|
735
|
+
# @example
|
736
|
+
# entities = Sketchup.active_model.entities
|
737
|
+
# definition = Sketchup.active_model.definitions[0]
|
738
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
739
|
+
# group = entities.add_instance(definition, transformation)
|
740
|
+
# volume = group.volume
|
741
|
+
#
|
742
|
+
# @return [Float] If the group represents a manifold volume,
|
743
|
+
# volume will be a positive value. If volume is negative,
|
744
|
+
# the group is not manifold.
|
745
|
+
#
|
746
|
+
# @version SketchUp 8.0
|
747
|
+
def volume
|
748
|
+
end
|
749
|
+
|
750
|
+
end
|