sketchup-api-stubs 0.7.2 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +3 -1
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +15 -11
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +5 -5
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +5 -5
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +5 -6
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +18 -18
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +27 -10
- 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 +2 -3
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +4 -4
- data/lib/sketchup-api-stubs/stubs/Layout.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +5 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +7 -14
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +61 -5
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +7 -14
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +189 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +9 -4
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +2 -3
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +7 -14
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +6 -2
- 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 +7 -14
- 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 +148 -5
- 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 +5 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +4 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +3 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +6 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +32 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +110 -209
- 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 +24 -11
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +24 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +58 -57
- 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 +16 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +135 -39
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +6 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +6 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +3 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +5 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +10 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +8 -14
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +55 -26
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +6 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +20 -15
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +6 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +9 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +232 -65
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +98 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +48 -41
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +7 -7
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +60 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +47 -7
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +11 -12
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +33 -21
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +6 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +5 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +115 -68
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +225 -29
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +118 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +2 -2
- 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 +2 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +8 -10
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +16 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +6 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +9 -11
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +126 -73
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +5 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +2 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +7 -7
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +4 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +143 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +22 -12
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +6 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +37 -15
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +5 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +10 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +20 -20
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +5 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +6 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +9 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +14 -22
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +31 -25
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +6 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +32 -22
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +73 -67
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +6 -4
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +13 -6
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +132 -10
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +94 -54
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +3 -3
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +3 -1
- data/lib/sketchup-api-stubs/stubs/array.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/geom.rb +4 -1
- data/lib/sketchup-api-stubs/stubs/languagehandler.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/length.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/numeric.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/sketchup.rb +66 -23
- 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 +17 -12
- metadata +5 -3
@@ -1,10 +1,11 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
|
-
# This observer interface is implemented to react to pages events.
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# This observer interface is implemented to react to pages events.
|
5
|
+
#
|
6
|
+
# @abstract To implement this observer, create a Ruby class of this type, override the
|
7
|
+
# desired methods, and add an instance of the observer to the objects of
|
8
|
+
# interests.
|
8
9
|
#
|
9
10
|
# @example
|
10
11
|
# # This is an example of an observer that watches the pages for new ones.
|
@@ -1,15 +1,26 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
|
-
# The PickHelper class is used to pick entities that reside under
|
5
|
-
# cursor location
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# The {Sketchup::PickHelper} class is used to pick entities that reside under
|
5
|
+
# the current cursor location, similar to native Select tool. Unlike
|
6
|
+
# {Sketchup::InputPoint}, {Sketchup::PickHelper} uses no inference.
|
7
|
+
#
|
8
|
+
# Only {Sketchup::Tool}s react to cursor location and most of these methods are
|
9
|
+
# only useful in the context of a tool. For example, if you want to determine
|
10
|
+
# the entity you just clicked, you would use {#do_pick} from within your
|
11
|
+
# {Sketchup::Tool#onLButtonDown} method.
|
12
|
+
#
|
13
|
+
# You can retrieve a PickHelper object using the {Sketchup::View#pick_helper}
|
14
|
+
# method.
|
8
15
|
#
|
9
16
|
# Entities that are picked (found under the
|
10
17
|
# cursor when a mouse or keyboard event occurs), are called Pick Records and
|
11
18
|
# are placed in an indexed list.
|
12
19
|
#
|
20
|
+
# @note The same {Sketchup::Pickhelper} instance is being reused by SketchUp.
|
21
|
+
# Don't extend, add methods or redefine methods on this object as it can
|
22
|
+
# clash with other extensions.
|
23
|
+
#
|
13
24
|
# @version SketchUp 6.0
|
14
25
|
class Sketchup::PickHelper
|
15
26
|
|
@@ -110,8 +121,8 @@ class Sketchup::PickHelper
|
|
110
121
|
# entities in the list of pick records.
|
111
122
|
#
|
112
123
|
# @example
|
113
|
-
#
|
114
|
-
#
|
124
|
+
# pickhelper = view.pick_helper
|
125
|
+
# pickhelper.do_pick(x, y)
|
115
126
|
# # Iterate all pick-routes:
|
116
127
|
# pickhelper.count.times { |pick_path_index|
|
117
128
|
# puts pickhelper.depth_at(pick_path_index)
|
@@ -156,8 +167,8 @@ class Sketchup::PickHelper
|
|
156
167
|
# Use count() to get the number of possible pick paths.
|
157
168
|
#
|
158
169
|
# @example
|
159
|
-
#
|
160
|
-
#
|
170
|
+
# pickhelper = view.pick_helper
|
171
|
+
# pickhelper.do_pick(x, y)
|
161
172
|
# # Iterate all pick-routes:
|
162
173
|
# pickhelper.count.times { |pick_path_index|
|
163
174
|
# puts pickhelper.element_at(pick_path_index)
|
@@ -212,8 +223,8 @@ class Sketchup::PickHelper
|
|
212
223
|
# Use count() to get the number of possible pick paths.
|
213
224
|
#
|
214
225
|
# @example
|
215
|
-
#
|
216
|
-
#
|
226
|
+
# pickhelper = view.pick_helper
|
227
|
+
# pickhelper.do_pick(x, y)
|
217
228
|
# # Iterate all pick-routes:
|
218
229
|
# pickhelper.count.times { |pick_path_index|
|
219
230
|
# p pickhelper.leaf_at(pick_path_index)
|
@@ -239,8 +250,8 @@ class Sketchup::PickHelper
|
|
239
250
|
# item will be a drawing element that is not a group, component or image.
|
240
251
|
#
|
241
252
|
# @example
|
242
|
-
#
|
243
|
-
#
|
253
|
+
# pickhelper = view.pick_helper
|
254
|
+
# pickhelper.do_pick(x, y)
|
244
255
|
# # Iterate all pick-routes:
|
245
256
|
# pickhelper.count.times { |pick_path_index|
|
246
257
|
# p pickhelper.path_at(pick_path_index)
|
@@ -399,13 +410,24 @@ class Sketchup::PickHelper
|
|
399
410
|
# coordinates of the leaf entity into the coordinates of the active entities.
|
400
411
|
#
|
401
412
|
# @example
|
402
|
-
#
|
403
|
-
#
|
413
|
+
# pickhelper = view.pick_helper
|
414
|
+
# pickhelper.do_pick(x, y)
|
404
415
|
# # Iterate all pick-routes:
|
405
416
|
# pickhelper.count.times { |pick_path_index|
|
406
417
|
# puts pickhelper.transformation_at(pick_path_index)
|
407
418
|
# }
|
408
419
|
#
|
420
|
+
# @example Get transformation for specific picked element
|
421
|
+
# pickhelper = view.pick_helper
|
422
|
+
# pickhelper.do_pick(x, y)
|
423
|
+
# face = pickhelper.picked_face # Face may be inside a group or component.
|
424
|
+
#
|
425
|
+
# index = pickhelper.count.times.find { |i| pickhelper.leaf_at(i) == face }
|
426
|
+
# transformation = index ? pickhelper.transformation_at(index) : IDENTITY
|
427
|
+
#
|
428
|
+
# # Face#area is one method that may need a transformation.
|
429
|
+
# area = face.area(transformation)
|
430
|
+
#
|
409
431
|
# @param index
|
410
432
|
# The index where the transformation should be retrieved.
|
411
433
|
#
|
@@ -1,10 +1,11 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# This observer interface is implemented to react to rendering options events.
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
5
|
+
#
|
6
|
+
# @abstract To implement this observer, create a Ruby class of this type, implement the
|
7
|
+
# desired methods, and add an instance of the observer to the objects of
|
8
|
+
# interests.
|
8
9
|
#
|
9
10
|
# @example
|
10
11
|
# # This is an example of an observer that watches the rendering options
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# A set of the currently selected entities. Use the Model.selection method
|
@@ -38,7 +38,7 @@ class Sketchup::Selection
|
|
38
38
|
# @param [Integer] index
|
39
39
|
# The index of the Entity object to retrieve.
|
40
40
|
#
|
41
|
-
# @return [Sketchup::
|
41
|
+
# @return [Sketchup::Entity, nil]
|
42
42
|
#
|
43
43
|
# @see #at
|
44
44
|
#
|
@@ -108,7 +108,7 @@ class Sketchup::Selection
|
|
108
108
|
# @param [Integer] index
|
109
109
|
# The index of the Entity object to retrieve.
|
110
110
|
#
|
111
|
-
# @return [Sketchup::
|
111
|
+
# @return [Sketchup::Entity, nil]
|
112
112
|
#
|
113
113
|
# @see #[]
|
114
114
|
#
|
@@ -172,7 +172,12 @@ class Sketchup::Selection
|
|
172
172
|
# efficient than using [].
|
173
173
|
#
|
174
174
|
# @example
|
175
|
-
# selection.each { |entity|
|
175
|
+
# selection.each { |entity| puts entity }
|
176
|
+
#
|
177
|
+
# @note Don't remove content from this collection while iterating over it with
|
178
|
+
# {#each}. This would change the size of the collection and cause elemnts to
|
179
|
+
# be skipped as the indices change. Instead copy the current collection to an
|
180
|
+
# array using +to_a+ and then use +each+ on the array, when removing content.
|
176
181
|
#
|
177
182
|
# @return [nil]
|
178
183
|
#
|
@@ -232,7 +237,7 @@ class Sketchup::Selection
|
|
232
237
|
def include?(entity)
|
233
238
|
end
|
234
239
|
|
235
|
-
# The #
|
240
|
+
# The {#invert} method is used to invert the selection.
|
236
241
|
#
|
237
242
|
# @example
|
238
243
|
# model = Sketchup.active_model
|
@@ -1,10 +1,11 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
|
-
# This observer interface is implemented to react to selection events.
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# This observer interface is implemented to react to selection events.
|
5
|
+
#
|
6
|
+
# @abstract To implement this observer, create a Ruby class of this type, override the
|
7
|
+
# desired methods, and add an instance of the observer to the objects of
|
8
|
+
# interests.
|
8
9
|
#
|
9
10
|
# @example
|
10
11
|
# # This is an example of an observer that watches the selection for
|
@@ -30,7 +31,7 @@ class Sketchup::SelectionObserver
|
|
30
31
|
# end
|
31
32
|
#
|
32
33
|
# @note This event might not trigger even if a single element is selected. For
|
33
|
-
# instance the Selection tool will trigger #onSelectionBulkChange regardless.
|
34
|
+
# instance the Selection tool will trigger {#onSelectionBulkChange} regardless.
|
34
35
|
#
|
35
36
|
# @param [Sketchup::Selection] selection
|
36
37
|
#
|
@@ -53,7 +54,7 @@ class Sketchup::SelectionObserver
|
|
53
54
|
#
|
54
55
|
# @example
|
55
56
|
# def onSelectionBulkChange(selection)
|
56
|
-
# puts "
|
57
|
+
# puts "onSelectionBulkChange: #{selection}"
|
57
58
|
# end
|
58
59
|
#
|
59
60
|
# @param [Sketchup::Selection] selection
|
@@ -80,27 +81,26 @@ class Sketchup::SelectionObserver
|
|
80
81
|
def onSelectionCleared(selection)
|
81
82
|
end
|
82
83
|
|
84
|
+
#
|
85
|
+
# @bug Due to a bug in SketchUp this event doesn't trigger. Instead
|
86
|
+
# +onSelectedRemoved+ is called.
|
83
87
|
#
|
84
88
|
# @example
|
85
89
|
# class MySelectionObserver < Sketchup::SelectionObserver
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
# # fixed:
|
93
|
-
# def onSelectedRemoved(selection, entity)
|
94
|
-
# # You can forward it to the correct event to be future compatible.
|
95
|
-
# onSelectionRemoved(selection, entity)
|
96
|
-
# end
|
90
|
+
# def onSelectionRemoved(selection, entity)
|
91
|
+
# puts "onSelectionRemoved: #{entity}"
|
92
|
+
# end
|
93
|
+
#
|
94
|
+
# # Due to a SketchUp bug, this method is called by the wrong name.
|
95
|
+
# alias_method :onSelectedRemoved, :onSelectionRemoved
|
97
96
|
# end
|
98
97
|
#
|
99
98
|
# # Attach the observer.
|
100
99
|
# Sketchup.active_model.selection.add_observer(MySelectionObserver.new)
|
101
100
|
#
|
102
|
-
# @note
|
103
|
-
#
|
101
|
+
# @note This event might not trigger even if a single element is deselected.
|
102
|
+
# For instance the Selection tool will trigger {#onSelectionBulkChange}
|
103
|
+
# regardless.
|
104
104
|
#
|
105
105
|
# @param [Sketchup::Selection] selection
|
106
106
|
#
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The ShadowInfo class contains method to extract the shadow information for a
|
@@ -20,7 +20,7 @@
|
|
20
20
|
# - +Latitude+ (in Model Info > Geo-location > Set Manual Location...)
|
21
21
|
# - +Light+ (in Window > Shadows)
|
22
22
|
# - +Longitude+ (in Model Info > Geo-location > Set Manual Location...)
|
23
|
-
# - +
|
23
|
+
# - +NorthAngle+ (in View > Toolbars > Solar North) Note that 'Toolbar' is called 'Tool Palettes' on Mac
|
24
24
|
# - +ShadowTime+ (in Window > Shadows)
|
25
25
|
# - +ShadowTime_time_t+ (ShadowTime in Epoch time)
|
26
26
|
# - +SunDirection+ (Generated based on ShadowTime)
|
@@ -50,7 +50,7 @@ class Sketchup::ShadowInfo < Sketchup::Entity
|
|
50
50
|
# The each_key method iterates through all of the shadow information keys.
|
51
51
|
#
|
52
52
|
# @example
|
53
|
-
# shadowinfo.each_key { |key|
|
53
|
+
# shadowinfo.each_key { |key| puts key }
|
54
54
|
#
|
55
55
|
# @return [nil]
|
56
56
|
#
|
@@ -165,7 +165,7 @@ class Sketchup::ShadowInfo < Sketchup::Entity
|
|
165
165
|
# The each_key method iterates through all of the shadow information keys.
|
166
166
|
#
|
167
167
|
# @example
|
168
|
-
# shadowinfo.each_key { |key|
|
168
|
+
# shadowinfo.each_key { |key| puts key }
|
169
169
|
#
|
170
170
|
# @return [nil]
|
171
171
|
#
|
@@ -175,7 +175,7 @@ class Sketchup::ShadowInfo < Sketchup::Entity
|
|
175
175
|
def each_key
|
176
176
|
end
|
177
177
|
|
178
|
-
# The #
|
178
|
+
# The {#each_pair} method is an alias for {#each}.
|
179
179
|
#
|
180
180
|
# @example
|
181
181
|
# model = Sketchup.active_model
|
@@ -1,10 +1,12 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# This observer interface is implemented to react to changes to the shadow
|
5
|
-
# settings.
|
6
|
-
#
|
7
|
-
#
|
5
|
+
# settings.
|
6
|
+
#
|
7
|
+
# @abstract To implement this observer, create a Ruby class of this type,
|
8
|
+
# override the desired methods, and add an instance of the observer to the
|
9
|
+
# {Sketchup::ShadowInfo} object.
|
8
10
|
#
|
9
11
|
# @example
|
10
12
|
# # This is an example of an observer that watches the selection for
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The {Sketchup::Skp} module is used to read metadata from external SketchUp
|
5
|
+
# files without loading the whole file.
|
6
|
+
#
|
7
|
+
# @version SketchUp 2021.0
|
8
|
+
module Sketchup::Skp
|
9
|
+
|
10
|
+
# Class Methods
|
11
|
+
|
12
|
+
# The {.read_guid} method is used to read the GUID, globally unique identifier,
|
13
|
+
# for an external model.
|
14
|
+
#
|
15
|
+
# In SketchUp, GUIDs are used to test if {Sketchup::ComponentDefinition}s and
|
16
|
+
# {Sketchup::Model}s match (a component being an embedded model).
|
17
|
+
# When you insert a component to a model, its GUID is compared to existing
|
18
|
+
# component definitions in that model, and if there is a match the existing
|
19
|
+
# component definition is re-used rather than a duplicate being added.
|
20
|
+
# When a component definition is modified or a model is saved, their GUIDs are
|
21
|
+
# renewed.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# model = Sketchup.active_model
|
25
|
+
# definitions = model.definitions
|
26
|
+
# definition = definitions.find { |definition| !definition.internal? }
|
27
|
+
# # true if component matches its external file.
|
28
|
+
# definition.guid == Sketchup::Skp.read_guid(definition.path)
|
29
|
+
#
|
30
|
+
# @param [String] filepath
|
31
|
+
#
|
32
|
+
# @raise [ArgumentError] if the file is missing or is not a SketchUp model.
|
33
|
+
#
|
34
|
+
# @return [String]
|
35
|
+
#
|
36
|
+
# @version SketchUp 2021.0
|
37
|
+
def self.read_guid(filepath)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The Styles class contains methods for manipulating a collection of styles in
|
@@ -38,7 +38,12 @@ class Sketchup::Styles < Sketchup::Entity
|
|
38
38
|
def [](arg)
|
39
39
|
end
|
40
40
|
|
41
|
-
# The #
|
41
|
+
# The {#active_style} method is used to retrieve the active style.
|
42
|
+
#
|
43
|
+
# While {#selected_style} is the style being selected in the Style Browser,
|
44
|
+
# the #{active_style} is a different object also including any unsaved style
|
45
|
+
# changes. These changes are silently dropped once a new style is selected.
|
46
|
+
# To save these changes to the selected style, call #{update_selected_style}.
|
42
47
|
#
|
43
48
|
# @example
|
44
49
|
# styles = Sketchup.active_model.styles
|
@@ -152,7 +157,8 @@ class Sketchup::Styles < Sketchup::Entity
|
|
152
157
|
def purge_unused
|
153
158
|
end
|
154
159
|
|
155
|
-
# The {#selected_style} method is used to retrieve the currently
|
160
|
+
# The {#selected_style} method is used to retrieve the style currently
|
161
|
+
# selected in the Styles Browser.
|
156
162
|
#
|
157
163
|
# @example
|
158
164
|
# styles = Sketchup.active_model.styles
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# The Texture class contains methods for obtaining information about textures
|
@@ -41,27 +41,19 @@ class Sketchup::Texture < Sketchup::Entity
|
|
41
41
|
def average_color
|
42
42
|
end
|
43
43
|
|
44
|
-
# The filename method retrieves the entire path, including the file, for a
|
44
|
+
# The {#filename} method retrieves the entire path, including the file, for a
|
45
45
|
# texture object.
|
46
46
|
#
|
47
47
|
# @example
|
48
48
|
# model = Sketchup.active_model
|
49
|
-
# materials=model.materials
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
# # Returns nil if not successful, path if successful
|
54
|
-
# m.texture = "c:\\Materials\\Carpet.jpg"
|
55
|
-
# rescue
|
56
|
-
# UI.messagebox $!.message
|
57
|
-
# end
|
58
|
-
# texture = m.texture
|
49
|
+
# materials = model.materials
|
50
|
+
# material = materials.add("Test Color")
|
51
|
+
# material.texture = "c:\\Materials\\Carpet.jpg"
|
52
|
+
# texture = material.texture
|
59
53
|
# filename = texture.filename
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
# UI.messagebox "Failure"
|
64
|
-
# end
|
54
|
+
#
|
55
|
+
# @note Since SketchUp 2021.0 this method will append a file extension matching
|
56
|
+
# the image format if the file extension is missing from stored filepath.
|
65
57
|
#
|
66
58
|
# @return [String] a string representation of the path and
|
67
59
|
# filename used for the texture.
|
@@ -206,11 +198,11 @@ class Sketchup::Texture < Sketchup::Entity
|
|
206
198
|
# @example
|
207
199
|
# material = Sketchup.active_model.materials[0]
|
208
200
|
# basename = File.basename(material.texture.filename)
|
209
|
-
#
|
210
|
-
# material.texture.write(
|
201
|
+
# path = File.join(Sketchup.temp_dir, basename)
|
202
|
+
# material.texture.write(path)
|
211
203
|
#
|
212
|
-
# @param [String]
|
213
|
-
#
|
204
|
+
# @param [String] path
|
205
|
+
# The file path to write the texture to.
|
214
206
|
#
|
215
207
|
# @param [Boolean] colorize
|
216
208
|
# Boolean - Allows for the texture to
|
@@ -219,7 +211,7 @@ class Sketchup::Texture < Sketchup::Entity
|
|
219
211
|
# @return [Boolean] true if the method succeeded
|
220
212
|
#
|
221
213
|
# @version SketchUp 2016
|
222
|
-
def write(
|
214
|
+
def write(path, colorize = false)
|
223
215
|
end
|
224
216
|
|
225
217
|
end
|