sketchup-api-stubs 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -0
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +5 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +4 -10
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +5 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +9 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +4 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +25 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +129 -11
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +8 -6
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +45 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +12 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +364 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +7 -1
- data/lib/sketchup-api-stubs/stubs/array.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/geom.rb +116 -1
- data/lib/sketchup-api-stubs/stubs/languagehandler.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/length.rb +19 -3
- data/lib/sketchup-api-stubs/stubs/numeric.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/sketchup.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/string.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/ui.rb +10 -3
- metadata +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The {Sketchup::ComponentDefinition} class is used to define the contents for
|
@@ -293,6 +293,10 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
293
293
|
# The insertion_point method is used to retrieve the Point3d object where the
|
294
294
|
# component was inserted.
|
295
295
|
#
|
296
|
+
# @deprecated SketchUp 2020.0 removed the insertion point feature.
|
297
|
+
# The getter will always return the origin point and the
|
298
|
+
# setter becomes a no-op.
|
299
|
+
#
|
296
300
|
# @example
|
297
301
|
# point = Geom::Point3d.new 10,20,30
|
298
302
|
# transform = Geom::Transformation.new point
|
@@ -314,6 +318,10 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
314
318
|
|
315
319
|
# Sets the insertion point of your definition.
|
316
320
|
#
|
321
|
+
# @deprecated SketchUp 2020.0 removed the insertion point feature.
|
322
|
+
# The getter will always return the origin point and the
|
323
|
+
# setter becomes a no-op.
|
324
|
+
#
|
317
325
|
# @example
|
318
326
|
# point = Geom::Point3d.new(10, 20, 0)
|
319
327
|
# componentdefinition = Sketchup.active_model.definitions[0]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# This is the base class for all SketchUp entities. Entities are basically
|
@@ -344,6 +344,9 @@ class Sketchup::Entity
|
|
344
344
|
#
|
345
345
|
# The persistent id persistent between sessions.
|
346
346
|
#
|
347
|
+
# [SketchUp 2020.0]
|
348
|
+
# - {Sketchup::Layer}
|
349
|
+
# - {Sketchup::LineStyle}
|
347
350
|
# [SketchUp 2018]
|
348
351
|
# - {Sketchup::Page}
|
349
352
|
# [SketchUp 2017]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The Layer class contains methods modifying and extracting information for a
|
@@ -103,6 +103,26 @@ class Sketchup::Layer < Sketchup::Entity
|
|
103
103
|
def color=(color)
|
104
104
|
end
|
105
105
|
|
106
|
+
# The {#display_name} method is used to retrieve the display name of the layer.
|
107
|
+
#
|
108
|
+
# @example
|
109
|
+
# model = Sketchup.active_model
|
110
|
+
# layers = model.layers
|
111
|
+
# new_layer = layers.add ("test layer")
|
112
|
+
# name = new_layer.display_name
|
113
|
+
#
|
114
|
+
# @return [String] the display name of the Layer object
|
115
|
+
#
|
116
|
+
# @see #name
|
117
|
+
#
|
118
|
+
# @version SketchUp 2020.0
|
119
|
+
def display_name
|
120
|
+
end
|
121
|
+
|
122
|
+
# Layer Group methods
|
123
|
+
def layer_group
|
124
|
+
end
|
125
|
+
|
106
126
|
# The {#line_style} method retrieves the line style on this layer.
|
107
127
|
#
|
108
128
|
# @example
|
@@ -129,7 +149,7 @@ class Sketchup::Layer < Sketchup::Entity
|
|
129
149
|
def line_style=(line_style)
|
130
150
|
end
|
131
151
|
|
132
|
-
# The name method is used to retrieve the name of the layer.
|
152
|
+
# The {#name} method is used to retrieve the name of the layer.
|
133
153
|
#
|
134
154
|
# @example
|
135
155
|
# model = Sketchup.active_model
|
@@ -137,7 +157,9 @@ class Sketchup::Layer < Sketchup::Entity
|
|
137
157
|
# new_layer = layers.add "test layer"
|
138
158
|
# name = new_layer.name
|
139
159
|
#
|
140
|
-
# @return
|
160
|
+
# @return [String]
|
161
|
+
#
|
162
|
+
# @see #display_name
|
141
163
|
#
|
142
164
|
# @version SketchUp 6.0
|
143
165
|
def name
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# This is the interface to a SketchUp model. The model is the 3D drawing that
|
@@ -14,6 +14,9 @@
|
|
14
14
|
# - Model::MakeTrial
|
15
15
|
# - Model::MakeTrialExpired
|
16
16
|
#
|
17
|
+
# @bug Prior to SketchUp 2019.0 this class would yield +TypeError+ for all
|
18
|
+
# method calls if +#singleton_class+ was called on the model object.
|
19
|
+
#
|
17
20
|
# @example
|
18
21
|
# # Grab a handle to the currently active model (aka the one the user is
|
19
22
|
# # looking at in SketchUp.)
|
@@ -36,9 +39,6 @@
|
|
36
39
|
#
|
37
40
|
# new_edge = entities.add_line([0,0,0], [500,500,0])
|
38
41
|
#
|
39
|
-
# @note Prior to SketchUp 2019 this class would yield +TypeError+ for all
|
40
|
-
# method calls if +#singleton_class+ was called on the model object.
|
41
|
-
#
|
42
42
|
# @version SketchUp 6.0
|
43
43
|
class Sketchup::Model
|
44
44
|
|
@@ -56,6 +56,7 @@ class Sketchup::Model
|
|
56
56
|
VERSION_2017 = nil # Stub value.
|
57
57
|
VERSION_2018 = nil # Stub value.
|
58
58
|
VERSION_2019 = nil # Stub value.
|
59
|
+
VERSION_2020 = nil # Stub value.
|
59
60
|
VERSION_3 = nil # Stub value.
|
60
61
|
VERSION_4 = nil # Stub value.
|
61
62
|
VERSION_5 = nil # Stub value.
|
@@ -152,6 +153,73 @@ class Sketchup::Model
|
|
152
153
|
def active_path
|
153
154
|
end
|
154
155
|
|
156
|
+
# The {#active_path=} method is used to open a given instance path for editing.
|
157
|
+
#
|
158
|
+
# It is expected that no entities are modified in an operation that
|
159
|
+
# opens/closes instances.
|
160
|
+
#
|
161
|
+
# To ensure that undo/redo is done correctly this method breaks up any open
|
162
|
+
# Ruby operations into a set of chained operations:
|
163
|
+
#
|
164
|
+
# If the API user tries to do this:
|
165
|
+
#
|
166
|
+
# model.start_operation('...', true)
|
167
|
+
# model.entities.add_face(...)
|
168
|
+
# model.active_path = instance_path
|
169
|
+
# model.entities.add_face(...)
|
170
|
+
# model.commit_operation
|
171
|
+
#
|
172
|
+
# Then the method will break it up to something like this:
|
173
|
+
#
|
174
|
+
# model.start_operation('...', true)
|
175
|
+
# model.entities.add_face(...)
|
176
|
+
# model.commit_operation
|
177
|
+
#
|
178
|
+
# model.start_operation('...', true, false, true)
|
179
|
+
# model.active_path = instance_path
|
180
|
+
# model.commit_operation
|
181
|
+
#
|
182
|
+
# model.start_operation('...', true, false, true)
|
183
|
+
# model.entities.add_face(...)
|
184
|
+
# model.commit_operation
|
185
|
+
#
|
186
|
+
# For the end user this will be experienced as a single operation.
|
187
|
+
# For the API user the side-effect is multiple transaction notifications.
|
188
|
+
#
|
189
|
+
# @example Open an instance
|
190
|
+
# model = Sketchup.active_model
|
191
|
+
# instance = model.active_entities.grep(Sketchup::ComponentInstance).first
|
192
|
+
# instance_path = Sketchup::InstancePath.new([instance])
|
193
|
+
# model.active_path = instance_path
|
194
|
+
#
|
195
|
+
# @example Close all instances
|
196
|
+
# model = Sketchup.active_model
|
197
|
+
# model.active_path = nil
|
198
|
+
#
|
199
|
+
# @note An instance path can only be opened if the instances are not locked.
|
200
|
+
# This also include instances of the same component definition that are not
|
201
|
+
# on the given path. A definition cannot be edited if any of its instances
|
202
|
+
# are locked.
|
203
|
+
#
|
204
|
+
# @note Open/close operations are special operations in SketchUp which has to
|
205
|
+
# be treated with special care.
|
206
|
+
#
|
207
|
+
# @param [Sketchup::InstancePath, Array<Sketchup::ComponentInstance, Sketchup::Group>, nil] instance_path
|
208
|
+
# Passing +nil+ or an empty array will close all open instances.
|
209
|
+
#
|
210
|
+
# @raise [ArgumentError] if the instance path is not valid.
|
211
|
+
#
|
212
|
+
# @raise [ArgumentError] if the instance path contains locked instances.
|
213
|
+
#
|
214
|
+
# @raise [ArgumentError] if the instance path contains instances who's
|
215
|
+
# siblings are locked.
|
216
|
+
#
|
217
|
+
# @return [Sketchup::Model]
|
218
|
+
#
|
219
|
+
# @version SketchUp 2020.0
|
220
|
+
def active_path=(instance_path)
|
221
|
+
end
|
222
|
+
|
155
223
|
# The {#active_view} method returns the active View object for this model.
|
156
224
|
#
|
157
225
|
# @example
|
@@ -338,17 +406,17 @@ class Sketchup::Model
|
|
338
406
|
def close(ignore_changes = false)
|
339
407
|
end
|
340
408
|
|
341
|
-
# The close_active method is used to close the currently active (open) group
|
409
|
+
# The {#close_active} method is used to close the currently active (open) group
|
342
410
|
# or component.
|
343
411
|
#
|
344
|
-
# Note: before SketchUp 2014 this method had a bug where it didn't create an
|
345
|
-
# undo operation and that could lead to corrupted geometry when undo/redo was
|
346
|
-
# used after invoking this method.
|
347
|
-
#
|
348
412
|
# @example
|
349
413
|
# model = Sketchup.active_model
|
350
414
|
# status = model.close_active
|
351
415
|
#
|
416
|
+
# @note Before SketchUp 2014 this method had a bug where it didn't create an
|
417
|
+
# undo operation and that could lead to corrupted geometry when undo/redo was
|
418
|
+
# used after invoking this method.
|
419
|
+
#
|
352
420
|
# @return [Boolean] true if successful, false if unsuccessful.
|
353
421
|
#
|
354
422
|
# @version SketchUp 6.0
|
@@ -414,6 +482,54 @@ class Sketchup::Model
|
|
414
482
|
def description=(description)
|
415
483
|
end
|
416
484
|
|
485
|
+
# The {#drawing_element_visible?} method reports whether the given drawing
|
486
|
+
# element in an instance path is visible given the current model options.
|
487
|
+
#
|
488
|
+
# @example Traversing every visible entity in the model
|
489
|
+
# module Example
|
490
|
+
#
|
491
|
+
# def self.instance?(entity)
|
492
|
+
# entity.is_a?(Sketchup::ComponentInstance) || entity.is_a?(Sketchup::Group)
|
493
|
+
# end
|
494
|
+
#
|
495
|
+
# # Walk the visible entities in the model, taking into account
|
496
|
+
# # "DrawHiddenGeometry" and "DrawHiddenObjects" rendering options.
|
497
|
+
# def self.walk(entities, transformation = IDENTITY, path = [], &block)
|
498
|
+
# entities.each { |entity|
|
499
|
+
# entity_path = path + [entity]
|
500
|
+
# next unless entity.model.drawing_element_visible?(entity_path)
|
501
|
+
# block.call(entity, transformation, path)
|
502
|
+
# if instance?(entity)
|
503
|
+
# child_entities = entity.definition.entities
|
504
|
+
# child_transformation = transformation * entity.transformation
|
505
|
+
# walk(child_entities, child_transformation, entity_path, &block)
|
506
|
+
# end
|
507
|
+
# }
|
508
|
+
# end
|
509
|
+
#
|
510
|
+
# end
|
511
|
+
#
|
512
|
+
# model = Sketchup.active_model
|
513
|
+
# Example.walk(model.entities) do |entity, transformation, path|
|
514
|
+
# # Do something to every visible entity in the model...
|
515
|
+
# end
|
516
|
+
#
|
517
|
+
# @param [Sketchup::InstancePath, Array<Sketchup::Drawingelement>] instance_path
|
518
|
+
#
|
519
|
+
# @raise [ArgumentError] if the +instance_path+ is not valid.
|
520
|
+
#
|
521
|
+
# @return [Boolean]
|
522
|
+
#
|
523
|
+
# @see Sketchup::RenderingOptions
|
524
|
+
#
|
525
|
+
# @see Sketchup::Drawingelement#visible?
|
526
|
+
#
|
527
|
+
# @see Sketchup::Layer#visible?
|
528
|
+
#
|
529
|
+
# @version SketchUp 2020.0
|
530
|
+
def drawing_element_visible?(instance_path)
|
531
|
+
end
|
532
|
+
|
417
533
|
# Returns the transformation of the current component edit session. If a user
|
418
534
|
# has double-clicked to edit a component's geometry, this will
|
419
535
|
# return the transformation of that component, relative to its parent's
|
@@ -1150,7 +1266,8 @@ class Sketchup::Model
|
|
1150
1266
|
# Sketchup::Model::VERSION_2016,
|
1151
1267
|
# Sketchup::Model::VERSION_2017,
|
1152
1268
|
# Sketchup::Model::VERSION_2018,
|
1153
|
-
# Sketchup::Model::VERSION_2019
|
1269
|
+
# Sketchup::Model::VERSION_2019,
|
1270
|
+
# Sketchup::Model::VERSION_2020
|
1154
1271
|
#
|
1155
1272
|
# @return [Boolean] true if successful, false if unsuccessful
|
1156
1273
|
#
|
@@ -1186,7 +1303,8 @@ class Sketchup::Model
|
|
1186
1303
|
# Sketchup::Model::VERSION_2016,
|
1187
1304
|
# Sketchup::Model::VERSION_2017,
|
1188
1305
|
# Sketchup::Model::VERSION_2018,
|
1189
|
-
# Sketchup::Model::VERSION_2019
|
1306
|
+
# Sketchup::Model::VERSION_2019,
|
1307
|
+
# Sketchup::Model::VERSION_2020
|
1190
1308
|
#
|
1191
1309
|
# @return [Boolean] true if successful, false if unsuccessful
|
1192
1310
|
#
|