sketchup-api-stubs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/SketchUp/Geom/BoundingBox.rb +335 -0
- data/SketchUp/Geom/LatLong.rb +123 -0
- data/SketchUp/Geom/Point3d.rb +643 -0
- data/SketchUp/Geom/PolygonMesh.rb +478 -0
- data/SketchUp/Geom/Transformation.rb +476 -0
- data/SketchUp/Geom/UTM.rb +135 -0
- data/SketchUp/Geom/Vector3d.rb +684 -0
- data/SketchUp/Sketchup/Animation.rb +137 -0
- data/SketchUp/Sketchup/AppObserver.rb +157 -0
- data/SketchUp/Sketchup/ArcCurve.rb +209 -0
- data/SketchUp/Sketchup/AttributeDictionaries.rb +146 -0
- data/SketchUp/Sketchup/AttributeDictionary.rb +280 -0
- data/SketchUp/Sketchup/Axes.rb +149 -0
- data/SketchUp/Sketchup/Behavior.rb +338 -0
- data/SketchUp/Sketchup/Camera.rb +594 -0
- data/SketchUp/Sketchup/ClassificationSchema.rb +63 -0
- data/SketchUp/Sketchup/Classifications.rb +118 -0
- data/SketchUp/Sketchup/Color.rb +291 -0
- data/SketchUp/Sketchup/ComponentDefinition.rb +562 -0
- data/SketchUp/Sketchup/ComponentInstance.rb +597 -0
- data/SketchUp/Sketchup/Console.rb +78 -0
- data/SketchUp/Sketchup/ConstructionLine.rb +257 -0
- data/SketchUp/Sketchup/ConstructionPoint.rb +32 -0
- data/SketchUp/Sketchup/Curve.rb +196 -0
- data/SketchUp/Sketchup/DefinitionList.rb +312 -0
- data/SketchUp/Sketchup/DefinitionObserver.rb +73 -0
- data/SketchUp/Sketchup/DefinitionsObserver.rb +102 -0
- data/SketchUp/Sketchup/Dimension.rb +167 -0
- data/SketchUp/Sketchup/DimensionLinear.rb +232 -0
- data/SketchUp/Sketchup/DimensionObserver.rb +38 -0
- data/SketchUp/Sketchup/DimensionRadial.rb +87 -0
- data/SketchUp/Sketchup/Drawingelement.rb +400 -0
- data/SketchUp/Sketchup/Edge.rb +517 -0
- data/SketchUp/Sketchup/EdgeUse.rb +213 -0
- data/SketchUp/Sketchup/Entities.rb +1011 -0
- data/SketchUp/Sketchup/EntitiesObserver.rb +125 -0
- data/SketchUp/Sketchup/Entity.rb +522 -0
- data/SketchUp/Sketchup/EntityObserver.rb +59 -0
- data/SketchUp/Sketchup/ExtensionsManager.rb +129 -0
- data/SketchUp/Sketchup/Face.rb +737 -0
- data/SketchUp/Sketchup/FrameChangeObserver.rb +104 -0
- data/SketchUp/Sketchup/Group.rb +705 -0
- data/SketchUp/Sketchup/Http.rb +27 -0
- data/SketchUp/Sketchup/Http/Request.rb +285 -0
- data/SketchUp/Sketchup/Http/Response.rb +62 -0
- data/SketchUp/Sketchup/Image.rb +393 -0
- data/SketchUp/Sketchup/Importer.rb +192 -0
- data/SketchUp/Sketchup/InputPoint.rb +393 -0
- data/SketchUp/Sketchup/InstanceObserver.rb +82 -0
- data/SketchUp/Sketchup/InstancePath.rb +297 -0
- data/SketchUp/Sketchup/Layer.rb +240 -0
- data/SketchUp/Sketchup/Layers.rb +235 -0
- data/SketchUp/Sketchup/LayersObserver.rb +136 -0
- data/SketchUp/Sketchup/Licensing.rb +47 -0
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +88 -0
- data/SketchUp/Sketchup/Loop.rb +141 -0
- data/SketchUp/Sketchup/Material.rb +384 -0
- data/SketchUp/Sketchup/Materials.rb +283 -0
- data/SketchUp/Sketchup/MaterialsObserver.rb +141 -0
- data/SketchUp/Sketchup/Menu.rb +97 -0
- data/SketchUp/Sketchup/Model.rb +1459 -0
- data/SketchUp/Sketchup/ModelObserver.rb +356 -0
- data/SketchUp/Sketchup/OptionsManager.rb +135 -0
- data/SketchUp/Sketchup/OptionsProvider.rb +277 -0
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +58 -0
- data/SketchUp/Sketchup/Page.rb +636 -0
- data/SketchUp/Sketchup/Pages.rb +349 -0
- data/SketchUp/Sketchup/PagesObserver.rb +76 -0
- data/SketchUp/Sketchup/PickHelper.rb +457 -0
- data/SketchUp/Sketchup/RegionalSettings.rb +43 -0
- data/SketchUp/Sketchup/RenderingOptions.rb +337 -0
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +44 -0
- data/SketchUp/Sketchup/SectionPlane.rb +88 -0
- data/SketchUp/Sketchup/Selection.rb +470 -0
- data/SketchUp/Sketchup/SelectionObserver.rb +115 -0
- data/SketchUp/Sketchup/Set.rb +253 -0
- data/SketchUp/Sketchup/ShadowInfo.rb +257 -0
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +57 -0
- data/SketchUp/Sketchup/Style.rb +77 -0
- data/SketchUp/Sketchup/Styles.rb +204 -0
- data/SketchUp/Sketchup/Text.rb +241 -0
- data/SketchUp/Sketchup/Texture.rb +211 -0
- data/SketchUp/Sketchup/TextureWriter.rb +237 -0
- data/SketchUp/Sketchup/Tool.rb +808 -0
- data/SketchUp/Sketchup/Tools.rb +120 -0
- data/SketchUp/Sketchup/ToolsObserver.rb +154 -0
- data/SketchUp/Sketchup/UVHelper.rb +61 -0
- data/SketchUp/Sketchup/Vertex.rb +143 -0
- data/SketchUp/Sketchup/View.rb +965 -0
- data/SketchUp/Sketchup/ViewObserver.rb +40 -0
- data/SketchUp/UI/Command.rb +307 -0
- data/SketchUp/UI/HtmlDialog.rb +346 -0
- data/SketchUp/UI/Notification.rb +229 -0
- data/SketchUp/UI/Toolbar.rb +243 -0
- data/SketchUp/UI/WebDialog.rb +623 -0
- data/SketchUp/_top_level.rb +193 -0
- data/SketchUp/array.rb +593 -0
- data/SketchUp/geom.rb +231 -0
- data/SketchUp/languagehandler.rb +92 -0
- data/SketchUp/length.rb +210 -0
- data/SketchUp/numeric.rb +249 -0
- data/SketchUp/sketchup.rb +1290 -0
- data/SketchUp/sketchupextension.rb +355 -0
- data/SketchUp/string.rb +24 -0
- data/SketchUp/ui.rb +637 -0
- metadata +176 -0
@@ -0,0 +1,104 @@
|
|
1
|
+
# Copyright:: Copyright 2017 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# This observer interface is implemented to react to changes in camera
|
5
|
+
# position (a frame) between one scene page and another. This observer's
|
6
|
+
# callback method is called when the user manually makes a scene change,
|
7
|
+
# or the internal animation feature runs.
|
8
|
+
#
|
9
|
+
# This abstract observer is any object that implements a callback method
|
10
|
+
# +frameChange+ with 3 arguments: +from_scene+ (the scene that you
|
11
|
+
# transition from), +to_scene+ (the scene that you transition toward)
|
12
|
+
# and a +percent_done+ between +0.0+ and +1.0+ (that indicates the percentage
|
13
|
+
# of transition between the two scenes.)
|
14
|
+
#
|
15
|
+
# # Basic Class Definition:
|
16
|
+
# class MyFrameChangeObserver
|
17
|
+
# def frameChange(from_scene, to_scene, percent_done)
|
18
|
+
# # Actual code here.
|
19
|
+
# end
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# The observer is attached using the {Sketchup::Pages.add_frame_change_observer}
|
23
|
+
# class method, which returns an integer id that can be stored and later
|
24
|
+
# used to detach the observer.
|
25
|
+
#
|
26
|
+
# # Attach an observer to the global Pages object:
|
27
|
+
# @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
|
28
|
+
#
|
29
|
+
# Later, detaching this observer is done by passing this +id+ reference to
|
30
|
+
# the {Sketchup::Pages.remove_frame_change_observer} class method.
|
31
|
+
#
|
32
|
+
# # Basic Observer Detachment:
|
33
|
+
# Sketchup::Pages.remove_frame_change_observer(@id)
|
34
|
+
#
|
35
|
+
# @abstract Implement the methods described in this class to create a frame
|
36
|
+
# change observer. You can not sub-class this class because it is not
|
37
|
+
# defined by the API.
|
38
|
+
#
|
39
|
+
# @example Draws a progress bar on the status line.
|
40
|
+
# class MyFrameChangeObserver
|
41
|
+
# def frameChange(from_scene, to_scene, percent_done)
|
42
|
+
# if percent_done == 0.0
|
43
|
+
# Sketchup.status_text= "% done:"
|
44
|
+
# if from_scene.nil? # PC bug!
|
45
|
+
# puts "Animating to page: '#{to_scene.name}'"
|
46
|
+
# else
|
47
|
+
# puts "From page '#{from_scene.name}' to '#{to_scene.name}'"
|
48
|
+
# end
|
49
|
+
# else
|
50
|
+
# Sketchup.status_text= "% done: #{'|'*(percent_done*100).to_i}"
|
51
|
+
# UI.messagebox("All Done!") if percent_done >= 1.0
|
52
|
+
# end
|
53
|
+
# end
|
54
|
+
# end
|
55
|
+
# @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
|
56
|
+
class Sketchup::FrameChangeObserver
|
57
|
+
|
58
|
+
# Instance Methods
|
59
|
+
|
60
|
+
# This callback method is called during a slide show or creation of an
|
61
|
+
# animation after the camera has been set up, but before the frame is
|
62
|
+
# displayed. It gives you a chance to perform your own actions during
|
63
|
+
# the animation. The arguments for +frameChange+ method are the scene
|
64
|
+
# page that you transition from (+from_scene+), the scene page that you
|
65
|
+
# transition to (+to_scene+), and a +percent_done+ between +0.0+ and +1.0+
|
66
|
+
# that tell you the percentage of the transition between the two scene
|
67
|
+
# pages.
|
68
|
+
#
|
69
|
+
# By watching for +percent_done >= 1.0+, you can activate Ruby code that
|
70
|
+
# executes as soon as the user's camera has finished animating.
|
71
|
+
#
|
72
|
+
# @example
|
73
|
+
# class MyFrameChangeObserver
|
74
|
+
# def frameChange(from_scene, to_scene, percent_done)
|
75
|
+
# if percent_done == 0.0
|
76
|
+
# puts "Animating to scene '#{to_scene.name}':"
|
77
|
+
# else
|
78
|
+
# puts format("% 7.2f %",percent_done*100)
|
79
|
+
# end
|
80
|
+
# end
|
81
|
+
# end
|
82
|
+
# @id = Sketchup::Pages.add_frame_change_observer(MyFrameChangeObserver.new)
|
83
|
+
#
|
84
|
+
# @note The +from_scene+ argument into this callback does not appear to
|
85
|
+
# be populated on the PC. You can store a variable that keeps track of
|
86
|
+
# the +to_scene+ and then use that on a subsequent Scene selection to
|
87
|
+
# determine the last Page that the user was on.
|
88
|
+
#
|
89
|
+
# @param [Sketchup::Page] to_scene
|
90
|
+
# The selected scene page the view is transitioning towards.
|
91
|
+
#
|
92
|
+
# @param [Sketchup::Page, nil] from_scene
|
93
|
+
# The previous scene page the view is transitioning from.
|
94
|
+
#
|
95
|
+
# @param [Float] percent_done
|
96
|
+
# The percentage of transition between the two scene pages.
|
97
|
+
#
|
98
|
+
# @return [void] Value can be anything, but is ignored by SketchUp.
|
99
|
+
#
|
100
|
+
# @version SketchUp 6.0
|
101
|
+
def frameChange(from_scene, to_scene, percent_done)
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
@@ -0,0 +1,705 @@
|
|
1
|
+
# Copyright:: Copyright 2017 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, except that there is no
|
7
|
+
# instancing of groups. That means that you always will have one and only one
|
8
|
+
# of each of your groups. (In the actual implementation, SketchUp keeps track
|
9
|
+
# of groups as a special kind of Component that combines properties of
|
10
|
+
# definitions and instances, which is why you will see deprecated methods
|
11
|
+
# like Group.make_unique, and the class of observer you attach to Groups are
|
12
|
+
# ComponentInstance observers.)
|
13
|
+
#
|
14
|
+
# @version SketchUp 6.0
|
15
|
+
class Sketchup::Group < Sketchup::Drawingelement
|
16
|
+
|
17
|
+
# Instance Methods
|
18
|
+
|
19
|
+
# The add_observer method is used to add a ComponentInstance observer to the
|
20
|
+
# group.
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# # Add a group to the model.
|
24
|
+
# group = Sketchup.active_model.entities.add_group
|
25
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
26
|
+
# status = group.add_observer observer
|
27
|
+
#
|
28
|
+
# @param observer
|
29
|
+
# An observer.
|
30
|
+
#
|
31
|
+
# @return true if successful, false if unsuccessful.
|
32
|
+
#
|
33
|
+
# @version SketchUp 6.0
|
34
|
+
def add_observer(observer)
|
35
|
+
end
|
36
|
+
|
37
|
+
# The copy method is used to create a new Group object that is a copy of the
|
38
|
+
# group.
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# # Add a group to the model.
|
42
|
+
# group = Sketchup.active_model.entities.add_group
|
43
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
44
|
+
# group2 = group.copy
|
45
|
+
#
|
46
|
+
# @return group - a new Group object
|
47
|
+
#
|
48
|
+
# @version SketchUp 6.0
|
49
|
+
def copy
|
50
|
+
end
|
51
|
+
|
52
|
+
# The definition method is used to retrieve the component definition for this
|
53
|
+
# group.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
# group = Sketchup.active_model.entities.add_group
|
57
|
+
# definition = group.definition
|
58
|
+
#
|
59
|
+
# @return componentdefinition - a ComponentDefinition object if
|
60
|
+
# successful
|
61
|
+
#
|
62
|
+
# @version SketchUp 2015
|
63
|
+
def definition
|
64
|
+
end
|
65
|
+
|
66
|
+
# The description method is used to retrieve the description for the group.
|
67
|
+
#
|
68
|
+
# @example
|
69
|
+
# depth = 100
|
70
|
+
# width = 100
|
71
|
+
# model = Sketchup.active_model
|
72
|
+
# entities = model.active_entities
|
73
|
+
# pts = []
|
74
|
+
# pts[0] = [0, 0, 0]
|
75
|
+
# pts[1] = [width, 0, 0]
|
76
|
+
# pts[2] = [width, depth, 0]
|
77
|
+
# pts[3] = [0, depth, 0]
|
78
|
+
# # Add the group to the entities in the model
|
79
|
+
# group = entities.add_group
|
80
|
+
#
|
81
|
+
# # Get the entities within the group
|
82
|
+
# entities2 = group.entities
|
83
|
+
#
|
84
|
+
# # Add a face to within the group
|
85
|
+
# face = entities2.add_face pts
|
86
|
+
# group.description = "This is a Group with a 2d Face"
|
87
|
+
# description = group.description
|
88
|
+
#
|
89
|
+
# @return description - a string description if successful
|
90
|
+
#
|
91
|
+
# @version SketchUp 6.0
|
92
|
+
def description
|
93
|
+
end
|
94
|
+
|
95
|
+
# The description= method is used to set the description for the group.
|
96
|
+
#
|
97
|
+
# @example
|
98
|
+
# depth = 100
|
99
|
+
# width = 100
|
100
|
+
# model = Sketchup.active_model
|
101
|
+
# entities = model.active_entities
|
102
|
+
# pts = []
|
103
|
+
# pts[0] = [0, 0, 0]
|
104
|
+
# pts[1] = [width, 0, 0]
|
105
|
+
# pts[2] = [width, depth, 0]
|
106
|
+
# pts[3] = [0, depth, 0]
|
107
|
+
#
|
108
|
+
# # Add the group to the entities in the model
|
109
|
+
# group = entities.add_group
|
110
|
+
#
|
111
|
+
# # Get the entities within the group
|
112
|
+
# entities2 = group.entities
|
113
|
+
#
|
114
|
+
# # Add a face to within the group
|
115
|
+
# face = entities2.add_face pts
|
116
|
+
# group.description = "This is a Group with a 2d Face"
|
117
|
+
# description = group.description
|
118
|
+
# if (description)
|
119
|
+
# UI.messagebox description
|
120
|
+
# else
|
121
|
+
# UI.messagebox "Failure"
|
122
|
+
# end
|
123
|
+
#
|
124
|
+
# @param description
|
125
|
+
# A string description.
|
126
|
+
#
|
127
|
+
# @return description - the new description if successful
|
128
|
+
#
|
129
|
+
# @version SketchUp 6.0
|
130
|
+
def description=(description)
|
131
|
+
end
|
132
|
+
|
133
|
+
# The entities method is used to retrieve a collection of entities in the
|
134
|
+
# group.
|
135
|
+
#
|
136
|
+
# @example
|
137
|
+
# depth = 100
|
138
|
+
# width = 100
|
139
|
+
# model = Sketchup.active_model
|
140
|
+
# entities = model.active_entities
|
141
|
+
# pts = []
|
142
|
+
# pts[0] = [0, 0, 0]
|
143
|
+
# pts[1] = [width, 0, 0]
|
144
|
+
# pts[2] = [width, depth, 0]
|
145
|
+
# pts[3] = [0, depth, 0]
|
146
|
+
# # Add the group to the entities in the model
|
147
|
+
# group = entities.add_group
|
148
|
+
#
|
149
|
+
# # Get the entities within the group
|
150
|
+
# entities2 = group.entities
|
151
|
+
#
|
152
|
+
# # Add a face to within the group
|
153
|
+
# face = entities2.add_face pts
|
154
|
+
# entities = group.entities
|
155
|
+
# if (entities)
|
156
|
+
# UI.messagebox entities
|
157
|
+
# else
|
158
|
+
# UI.messagebox "Failure"
|
159
|
+
# end
|
160
|
+
#
|
161
|
+
# @return entities - an Entities object if successful
|
162
|
+
#
|
163
|
+
# @version SketchUp 6.0
|
164
|
+
def entities
|
165
|
+
end
|
166
|
+
|
167
|
+
# The equals? method is used to determine if a group is geometrically
|
168
|
+
# equivalent to another group.
|
169
|
+
#
|
170
|
+
# @example
|
171
|
+
# entities = Sketchup.active_model.entities
|
172
|
+
# group1 = entities[0]
|
173
|
+
# group2 = entities[1]
|
174
|
+
# status = group1.equals?(group2)
|
175
|
+
#
|
176
|
+
# @param group
|
177
|
+
# The group to compare this group with.
|
178
|
+
#
|
179
|
+
# @return status - true if the groups are geometrically
|
180
|
+
# equivalent. Otherwise false.
|
181
|
+
#
|
182
|
+
# @return [Boolean]
|
183
|
+
#
|
184
|
+
# @version SketchUp 8.0
|
185
|
+
def equals?(group)
|
186
|
+
end
|
187
|
+
|
188
|
+
# The explode method is used to explode the group into individual entities.
|
189
|
+
#
|
190
|
+
# @example
|
191
|
+
# # Add a group to the model.
|
192
|
+
# group = Sketchup.active_model.entities.add_group
|
193
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
194
|
+
#
|
195
|
+
# array = group.explode
|
196
|
+
# if array
|
197
|
+
# UI.messagebox "Exploded the group"
|
198
|
+
# else
|
199
|
+
# UI.messagebox "Failure"
|
200
|
+
# end
|
201
|
+
#
|
202
|
+
# @return An array of entity objects if successful, false if
|
203
|
+
# unsuccessful.
|
204
|
+
#
|
205
|
+
# @version SketchUp 6.0
|
206
|
+
def explode
|
207
|
+
end
|
208
|
+
|
209
|
+
# The guid method is used to get the base 64 encoded unique id
|
210
|
+
# for this SketchUp object.
|
211
|
+
#
|
212
|
+
# @example
|
213
|
+
# # Add a group to the model.
|
214
|
+
# group = Sketchup.active_model.entities.add_group
|
215
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
216
|
+
# guid = group.guid
|
217
|
+
#
|
218
|
+
# @return guid - a unique 22 character string
|
219
|
+
#
|
220
|
+
# @version SketchUp 2014
|
221
|
+
def guid
|
222
|
+
end
|
223
|
+
|
224
|
+
# The intersect method is used to compute the boolean intersection of two
|
225
|
+
# groups representing manifold solid volumes (this & arg). If the specified
|
226
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
227
|
+
#
|
228
|
+
# @example
|
229
|
+
# entities = Sketchup.active_model.entities
|
230
|
+
# group1 = entities[0]
|
231
|
+
# group2 = entities[1]
|
232
|
+
# result = group1.intersect(group2)
|
233
|
+
#
|
234
|
+
# @param group
|
235
|
+
# The group to intersect this group with.
|
236
|
+
#
|
237
|
+
# @return result - The resultant group if the two objects
|
238
|
+
# (this and arg) represent manifold solids and the
|
239
|
+
# operation succeeds. Otherwise nil is returned.
|
240
|
+
#
|
241
|
+
# @version SketchUp 8.0
|
242
|
+
def intersect(group)
|
243
|
+
end
|
244
|
+
|
245
|
+
# The local_bounds method returns the BoundingBox object that defines the size
|
246
|
+
# of the group in an untransformed state. Useful for determining the original
|
247
|
+
# width, height, and depth of a group regardless of its current position or
|
248
|
+
# scale. For components, you can get a similar result by checking
|
249
|
+
# my_instance.definition.bounds.
|
250
|
+
#
|
251
|
+
# @example
|
252
|
+
# # Add a group to the model.
|
253
|
+
# group = Sketchup.active_model.entities.add_group
|
254
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
255
|
+
# transformation = Geom::Transformation.new([100,0,0])
|
256
|
+
#
|
257
|
+
# # Note that local_bounds_1 and local_bounds_2 will be identical, since
|
258
|
+
# # they both find the bounding box in group's untransformed state.
|
259
|
+
# local_bounds_1 = group.local_bounds
|
260
|
+
# group.transform! transformation
|
261
|
+
# local_bounds_2 = group.local_bounds
|
262
|
+
#
|
263
|
+
# @return bounds - a BoundingBox object
|
264
|
+
#
|
265
|
+
# @version SketchUp 7.0
|
266
|
+
def local_bounds
|
267
|
+
end
|
268
|
+
|
269
|
+
# The locked= method is used to lock a group.
|
270
|
+
#
|
271
|
+
# @example
|
272
|
+
# # Add a group to the model.
|
273
|
+
# group = Sketchup.active_model.entities.add_group
|
274
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
275
|
+
# status = group.locked = true
|
276
|
+
#
|
277
|
+
# @param [Boolean] lock
|
278
|
+
#
|
279
|
+
# @return status - true if the group is locked, false if not
|
280
|
+
#
|
281
|
+
# @version SketchUp 6.0
|
282
|
+
def locked=(lock)
|
283
|
+
end
|
284
|
+
|
285
|
+
# The locked? method is used to determine if a group is locked.
|
286
|
+
#
|
287
|
+
# @example
|
288
|
+
# depth = 100
|
289
|
+
# width = 100
|
290
|
+
# model = Sketchup.active_model
|
291
|
+
# entities = model.active_entities
|
292
|
+
# pts = []
|
293
|
+
# pts[0] = [0, 0, 0]
|
294
|
+
# pts[1] = [width, 0, 0]
|
295
|
+
# pts[2] = [width, depth, 0]
|
296
|
+
# pts[3] = [0, depth, 0]
|
297
|
+
#
|
298
|
+
# # Add the group to the entities in the model
|
299
|
+
# group = entities.add_group
|
300
|
+
# status = group.locked?
|
301
|
+
# UI.messagebox status
|
302
|
+
#
|
303
|
+
# @return status - true if the group is locked, false if not.
|
304
|
+
#
|
305
|
+
# @return [Boolean]
|
306
|
+
#
|
307
|
+
# @version SketchUp 6.0
|
308
|
+
def locked?
|
309
|
+
end
|
310
|
+
|
311
|
+
# The make_unique method is used to force a group to have a unique definition.
|
312
|
+
#
|
313
|
+
# Copying a group using the copy tool in SketchUp will create copies of the
|
314
|
+
# group that share a common definition until an instance is edited manually or
|
315
|
+
# this method is used. If multiple copies are made, all copies share a
|
316
|
+
# definition until all copies are edited manually, or all copies have this
|
317
|
+
# method used on them. This method ensures that the group uses a unique
|
318
|
+
# definition entry in the drawing database.
|
319
|
+
#
|
320
|
+
# @example
|
321
|
+
# # Assume we have 2 groups, one copied from the other and sharing definitions
|
322
|
+
# groups = Sketchup.active_model.entities.grep(Sketchup::Group)
|
323
|
+
# groups[0].make_unique
|
324
|
+
# if (groups[0].entities.to_a == groups[1].entities.to_a)
|
325
|
+
# puts "This should not happen since we made the groups unique"
|
326
|
+
# end
|
327
|
+
#
|
328
|
+
# @return group - the unique group
|
329
|
+
#
|
330
|
+
# @version SketchUp 6.0
|
331
|
+
def make_unique
|
332
|
+
end
|
333
|
+
|
334
|
+
# The manifold? method is used to determine if a group is manifold.
|
335
|
+
#
|
336
|
+
# @example
|
337
|
+
# entities = Sketchup.active_model.entities
|
338
|
+
# definition = Sketchup.active_model.definitions[0]
|
339
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
340
|
+
# group = entities.add_instance(definition, transformation)
|
341
|
+
# status = group.manifold?
|
342
|
+
#
|
343
|
+
# @return status - true if the group is manifold.
|
344
|
+
# false if the group is not manifold.
|
345
|
+
#
|
346
|
+
# @return [Boolean]
|
347
|
+
#
|
348
|
+
# @version SketchUp 8.0
|
349
|
+
def manifold?
|
350
|
+
end
|
351
|
+
|
352
|
+
# The move! method is used to apply a transformation to the group.
|
353
|
+
#
|
354
|
+
# This method is the same as the transform! method except that it does not
|
355
|
+
# record the move in an undo operation. This method is useful for
|
356
|
+
# transparently moving things during an animation.
|
357
|
+
#
|
358
|
+
# @example
|
359
|
+
# point = Geom::Point3d.new 500,500,500
|
360
|
+
# t = Geom::Transformation.new point
|
361
|
+
# depth = 100
|
362
|
+
# width = 100
|
363
|
+
# model = Sketchup.active_model
|
364
|
+
# entities = model.active_entities
|
365
|
+
# pts = []
|
366
|
+
# pts[0] = [0, 0, 0]
|
367
|
+
# pts[1] = [width, 0, 0]
|
368
|
+
# pts[2] = [width, depth, 0]
|
369
|
+
# pts[3] = [0, depth, 0]
|
370
|
+
#
|
371
|
+
# # Add the group to the entities in the model
|
372
|
+
# group = entities.add_group
|
373
|
+
#
|
374
|
+
# # Get the entities within the group
|
375
|
+
# entities2 = group.entities
|
376
|
+
#
|
377
|
+
# # Add a face to within the group
|
378
|
+
# face = entities2.add_face pts
|
379
|
+
# UI.messagebox "Group before Move"
|
380
|
+
# group = group.move! t
|
381
|
+
# if (group)
|
382
|
+
# UI.messagebox "Group after move"
|
383
|
+
# UI.messagebox group
|
384
|
+
# else
|
385
|
+
# UI.messagebox "Failure"
|
386
|
+
# end
|
387
|
+
#
|
388
|
+
# @param transform
|
389
|
+
# A Transformation object.
|
390
|
+
#
|
391
|
+
# @return group - the transformed Group object if successful
|
392
|
+
#
|
393
|
+
# @version SketchUp 6.0
|
394
|
+
def move!(transform)
|
395
|
+
end
|
396
|
+
|
397
|
+
# The name method is used to retrieve the name of the group.
|
398
|
+
#
|
399
|
+
# @example
|
400
|
+
# # Add a group to the model.
|
401
|
+
# group = Sketchup.active_model.entities.add_group
|
402
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
403
|
+
# group.name = "A Line"
|
404
|
+
# name = group.name
|
405
|
+
#
|
406
|
+
# @return name - The name of the group if successful
|
407
|
+
#
|
408
|
+
# @version SketchUp 6.0
|
409
|
+
def name
|
410
|
+
end
|
411
|
+
|
412
|
+
# The name= method is used to set the description for the group.
|
413
|
+
#
|
414
|
+
# @example
|
415
|
+
# # Add a group to the model.
|
416
|
+
# group = Sketchup.active_model.entities.add_group
|
417
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
418
|
+
# group.name = "A Line"
|
419
|
+
# name = group.name
|
420
|
+
#
|
421
|
+
# @param name
|
422
|
+
# A string name.
|
423
|
+
#
|
424
|
+
# @return name - a new name if successful
|
425
|
+
#
|
426
|
+
# @version SketchUp 6.0
|
427
|
+
def name=(name)
|
428
|
+
end
|
429
|
+
|
430
|
+
# The outer_shell method is used to compute the outer shell of the two groups
|
431
|
+
# representing manifold solid volumes (this || arg). If the specified objects
|
432
|
+
# (this and arg) do not represent manifold volumes, this method fails.
|
433
|
+
#
|
434
|
+
# @example
|
435
|
+
# entities = Sketchup.active_model.entities
|
436
|
+
# group1 = entities[0]
|
437
|
+
# group2 = entities[1]
|
438
|
+
# result = group1.outer_shell(group2)
|
439
|
+
#
|
440
|
+
# @param group
|
441
|
+
# The group to outer shell this group with.
|
442
|
+
#
|
443
|
+
# @return result - The resultant group if the two objects
|
444
|
+
# (this and arg) represent manifold solids and the
|
445
|
+
# operation succeeds otherwise nil is returned.
|
446
|
+
#
|
447
|
+
# @version SketchUp 8.0
|
448
|
+
def outer_shell(group)
|
449
|
+
end
|
450
|
+
|
451
|
+
# The remove_observer method is used to remove a ComponentInstance observer
|
452
|
+
# from the group.
|
453
|
+
#
|
454
|
+
# @example
|
455
|
+
# group = Sketchup.active_model.entities[0]
|
456
|
+
# if group != nil
|
457
|
+
# if group.is_a? Sketchup::Group
|
458
|
+
# status = group.remove_observer observer
|
459
|
+
# end
|
460
|
+
# end
|
461
|
+
#
|
462
|
+
# @param observer
|
463
|
+
# An observer.
|
464
|
+
#
|
465
|
+
# @return true if successful, false if unsuccessful.
|
466
|
+
#
|
467
|
+
# @version SketchUp 6.0
|
468
|
+
def remove_observer(observer)
|
469
|
+
end
|
470
|
+
|
471
|
+
# The show_differences method is used to determine if a group is
|
472
|
+
# geometrically equivalent to another group and in addition move the non-
|
473
|
+
# matching and matching geometry to new layers.
|
474
|
+
#
|
475
|
+
# This method will move both groups to Layer0. Geometry that is the same
|
476
|
+
# in both groups will be moved to a new layer named group_name + "_same".
|
477
|
+
# Geometry that is not the same will be moved to a layer named group_name +
|
478
|
+
# "_diff".
|
479
|
+
#
|
480
|
+
# If verbose is true, a list of all the geometry that is different
|
481
|
+
# from one group to the other is displayed texturally in the Ruby Console.
|
482
|
+
#
|
483
|
+
# @example
|
484
|
+
# entities = Sketchup.active_model.entities
|
485
|
+
# group1 = entities[0]
|
486
|
+
# group2 = entities[1]
|
487
|
+
# status = group1.show_differences(group2, true)
|
488
|
+
#
|
489
|
+
# @param group
|
490
|
+
# The group to be compared with.
|
491
|
+
#
|
492
|
+
# @param verbose
|
493
|
+
# A boolean flag indicating whether to display a textural
|
494
|
+
# report of the found differences to the Ruby console.
|
495
|
+
#
|
496
|
+
# @return status - true if the groups are geometrically
|
497
|
+
# equivalent. Otherwise false.
|
498
|
+
#
|
499
|
+
# @version SketchUp 8.0
|
500
|
+
def show_differences(group, verbose)
|
501
|
+
end
|
502
|
+
|
503
|
+
# The split method is used to compute the boolean split (map overlay) of the
|
504
|
+
# two groups representing manifold solid volumes (this ^ arg). If the
|
505
|
+
# specified objects (this and arg) do not represent manifold volumes,
|
506
|
+
# this method fails.
|
507
|
+
#
|
508
|
+
# @example
|
509
|
+
# entities = Sketchup.active_model.entities
|
510
|
+
# group1 = entities[0]
|
511
|
+
# group2 = entities[1]
|
512
|
+
# result = group1.split(group2)
|
513
|
+
#
|
514
|
+
# @param group
|
515
|
+
# The group to split this group with.
|
516
|
+
#
|
517
|
+
# @return result - A vector (array) of the three resultant groups
|
518
|
+
# if the two objects (this and arg) represent manifold
|
519
|
+
# solids and the operation succeeds otherwise nil is
|
520
|
+
# returned. The 3 groups are as follows:
|
521
|
+
# The intersection of volume 1 & volume 2,
|
522
|
+
# the difference of volume 1 minus volume 2,
|
523
|
+
# and the reverse difference of volume 2 minus volume 1.
|
524
|
+
#
|
525
|
+
# @version SketchUp 8.0
|
526
|
+
def split(group)
|
527
|
+
end
|
528
|
+
|
529
|
+
# The subtract method is used to compute the boolean difference of the two
|
530
|
+
# groups representing manifold solid volumes (this - arg). If the specified
|
531
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
532
|
+
#
|
533
|
+
# @example
|
534
|
+
# entities = Sketchup.active_model.entities
|
535
|
+
# group1 = entities[0]
|
536
|
+
# group2 = entities[1]
|
537
|
+
# result = group1.subtract(group2)
|
538
|
+
#
|
539
|
+
# @param group
|
540
|
+
# The group to subtract this group from.
|
541
|
+
#
|
542
|
+
# @return result - The resultant group if the two objects
|
543
|
+
# (this and arg) represent manifold solids and the
|
544
|
+
# operation succeeds. Otherwise nil is returned.
|
545
|
+
#
|
546
|
+
# @version SketchUp 8.0
|
547
|
+
def subtract(group)
|
548
|
+
end
|
549
|
+
|
550
|
+
# The to_component method is used to convert the group to a component
|
551
|
+
# instance.
|
552
|
+
#
|
553
|
+
# @example
|
554
|
+
# # Add a group to the model.
|
555
|
+
# group = Sketchup.active_model.entities.add_group
|
556
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
557
|
+
#
|
558
|
+
# # change the group to a component instance
|
559
|
+
# group.to_component
|
560
|
+
#
|
561
|
+
# @return instance - the new ComponentInstance object
|
562
|
+
#
|
563
|
+
# @version SketchUp 6.0
|
564
|
+
def to_component
|
565
|
+
end
|
566
|
+
|
567
|
+
# The transform! method is used to apply a transformation to a group.
|
568
|
+
#
|
569
|
+
# @example
|
570
|
+
# point = Geom::Point3d.new 500,500,500
|
571
|
+
# t = Geom::Transformation.new point
|
572
|
+
# depth = 100
|
573
|
+
# width = 100
|
574
|
+
# model = Sketchup.active_model
|
575
|
+
# entities = model.active_entities
|
576
|
+
# pts = []
|
577
|
+
# pts[0] = [0, 0, 0]
|
578
|
+
# pts[1] = [width, 0, 0]
|
579
|
+
# pts[2] = [width, depth, 0]
|
580
|
+
# pts[3] = [0, depth, 0]
|
581
|
+
#
|
582
|
+
# # Add the group to the entities in the model
|
583
|
+
# group = entities.add_group
|
584
|
+
#
|
585
|
+
# # Get the entities within the group
|
586
|
+
# entities2 = group.entities
|
587
|
+
#
|
588
|
+
# # Add a face to within the group
|
589
|
+
# face = entities2.add_face pts
|
590
|
+
# UI.messagebox "Group before Move"
|
591
|
+
# group = group.transform! t
|
592
|
+
# if (group)
|
593
|
+
# UI.messagebox "Group after move"
|
594
|
+
# UI.messagebox group
|
595
|
+
# else
|
596
|
+
# UI.messagebox "Failure"
|
597
|
+
# end
|
598
|
+
#
|
599
|
+
# @param transform
|
600
|
+
# A Transformation object.
|
601
|
+
#
|
602
|
+
# @return group - a transformed group object if successful
|
603
|
+
#
|
604
|
+
# @version SketchUp 6.0
|
605
|
+
def transform!(transform)
|
606
|
+
end
|
607
|
+
|
608
|
+
# The transformation method is used to retrieve the transformation for the
|
609
|
+
# group.
|
610
|
+
#
|
611
|
+
# @example
|
612
|
+
# # Add a group to the model.
|
613
|
+
# group = Sketchup.active_model.entities.add_group
|
614
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
615
|
+
#
|
616
|
+
# trans = group.transformation
|
617
|
+
#
|
618
|
+
# @return transformation - a Transformation object if successful
|
619
|
+
#
|
620
|
+
# @version SketchUp 6.0
|
621
|
+
def transformation
|
622
|
+
end
|
623
|
+
|
624
|
+
# The transformation= method is used to set the transformation for the
|
625
|
+
# group.
|
626
|
+
#
|
627
|
+
# @example
|
628
|
+
# # Add a group to the model.
|
629
|
+
# group = Sketchup.active_model.entities.add_group
|
630
|
+
# group.entities.add_line([0,0,0],[100,100,100])
|
631
|
+
#
|
632
|
+
# new_transform = Geom::Transformation.new([100,0,0])
|
633
|
+
# group.transformation = new_transform
|
634
|
+
#
|
635
|
+
# @param transform
|
636
|
+
# The Transformation object to apply
|
637
|
+
#
|
638
|
+
# @return group - the newly trasformed group
|
639
|
+
#
|
640
|
+
# @version SketchUp 6.0
|
641
|
+
def transformation=(transform)
|
642
|
+
end
|
643
|
+
|
644
|
+
# The trim method is used to compute the (non-destructive) boolean difference
|
645
|
+
# of the two groups representing manifold solid volumes (this - arg). If
|
646
|
+
# the specified objects (this and arg) do not represent manifold volumes, this
|
647
|
+
# method fails.
|
648
|
+
#
|
649
|
+
# @example
|
650
|
+
# entities = Sketchup.active_model.entities
|
651
|
+
# group1 = entities[0]
|
652
|
+
# group2 = entities[1]
|
653
|
+
# result = group1.trim(group2)
|
654
|
+
#
|
655
|
+
# @param group
|
656
|
+
# The group to trim this group against.
|
657
|
+
#
|
658
|
+
# @return result - The resultant group if the two objects
|
659
|
+
# (this and arg) represent manifold solids and the
|
660
|
+
# operation succeeds otherwise nil is returned.
|
661
|
+
#
|
662
|
+
# @version SketchUp 8.0
|
663
|
+
def trim(group)
|
664
|
+
end
|
665
|
+
|
666
|
+
# The union method is used to compute the boolean union of the two groups
|
667
|
+
# representing manifold solid volumes (this | arg). If the specified
|
668
|
+
# objects (this and arg) do not represent manifold volumes, this method fails.
|
669
|
+
#
|
670
|
+
# @example
|
671
|
+
# entities = Sketchup.active_model.entities
|
672
|
+
# group1 = entities[0]
|
673
|
+
# group2 = entities[1]
|
674
|
+
# result = group1.union(group2)
|
675
|
+
#
|
676
|
+
# @param group
|
677
|
+
# The group to union this group with.
|
678
|
+
#
|
679
|
+
# @return result - The resultant group if the two objects
|
680
|
+
# (this and arg) represent manifold solids and the
|
681
|
+
# operation succeeds. Otherwise nil is returned.
|
682
|
+
#
|
683
|
+
# @version SketchUp 8.0
|
684
|
+
def union(group)
|
685
|
+
end
|
686
|
+
|
687
|
+
# The volume method is used to compute the volume of this group if and only
|
688
|
+
# if this group is manifold.
|
689
|
+
#
|
690
|
+
# @example
|
691
|
+
# entities = Sketchup.active_model.entities
|
692
|
+
# definition = Sketchup.active_model.definitions[0]
|
693
|
+
# transformation = Geom::Transformation.new([0,0,0])
|
694
|
+
# group = entities.add_instance(definition, transformation)
|
695
|
+
# volume = group.volume
|
696
|
+
#
|
697
|
+
# @return volume - If the group represents a manifold volume,
|
698
|
+
# volume will be a positive value. If volume is negative,
|
699
|
+
# the group is not manifold.
|
700
|
+
#
|
701
|
+
# @version SketchUp 8.0
|
702
|
+
def volume
|
703
|
+
end
|
704
|
+
|
705
|
+
end
|