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 layers events.
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# This observer interface is implemented to react to layers 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
|
# class MyLayersObserver < Sketchup::LayersObserver
|
@@ -88,6 +89,87 @@ class Sketchup::LayersObserver
|
|
88
89
|
def onLayerChanged(layers, layer)
|
89
90
|
end
|
90
91
|
|
92
|
+
# The {#onLayerFolderAdded} method is called when a layer folder is added
|
93
|
+
# to a model.
|
94
|
+
#
|
95
|
+
# @api TagFolder
|
96
|
+
#
|
97
|
+
# @example
|
98
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
99
|
+
# def onLayerFolderAdded(layers, layer_folder)
|
100
|
+
# puts "onLayerFolderAdded: #{layer_folder.name}"
|
101
|
+
# end
|
102
|
+
# end
|
103
|
+
#
|
104
|
+
# model = Sketchup.active_model
|
105
|
+
# model.layers.add_observer(MyLayersObserver.new)
|
106
|
+
# folder = model.layers.add_folder("Hello World")
|
107
|
+
#
|
108
|
+
# @param [Sketchup::Layers] layers
|
109
|
+
#
|
110
|
+
# @param [Sketchup::LayerFolder] layer_folder
|
111
|
+
#
|
112
|
+
# @return [nil]
|
113
|
+
#
|
114
|
+
# @version SketchUp 2021.0
|
115
|
+
def onLayerFolderAdded(layers, layer_folder)
|
116
|
+
end
|
117
|
+
|
118
|
+
# The {#onLayerFolderChanged} method is called when a layer folder changes
|
119
|
+
# one of its properties.
|
120
|
+
#
|
121
|
+
# @api TagFolder
|
122
|
+
#
|
123
|
+
# @example
|
124
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
125
|
+
# def onLayerFolderChanged(layers, layer_folder)
|
126
|
+
# puts "onLayerFolderChanged: #{layer_folder.name}"
|
127
|
+
# end
|
128
|
+
# end
|
129
|
+
#
|
130
|
+
# model = Sketchup.active_model
|
131
|
+
# model.layers.add_observer(MyLayersObserver.new)
|
132
|
+
# folder = model.layers.add_folder("Hello World")
|
133
|
+
# folder.name = "Hello Universe"
|
134
|
+
# folder.visible = false
|
135
|
+
#
|
136
|
+
# @param [Sketchup::Layers] layers
|
137
|
+
#
|
138
|
+
# @param [Sketchup::LayerFolder] layer_folder
|
139
|
+
#
|
140
|
+
# @return [nil]
|
141
|
+
#
|
142
|
+
# @version SketchUp 2021.0
|
143
|
+
def onLayerFolderChanged(layers, layer_folder)
|
144
|
+
end
|
145
|
+
|
146
|
+
# The {#onLayerFolderRemoved} method is called when a layer folder is removed
|
147
|
+
# from a model.
|
148
|
+
#
|
149
|
+
# @api TagFolder
|
150
|
+
#
|
151
|
+
# @example
|
152
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
153
|
+
# def onLayerFolderRemoved(layers, layer_folder)
|
154
|
+
# puts "onLayerRemoved: #{layer_folder.name}"
|
155
|
+
# end
|
156
|
+
# end
|
157
|
+
#
|
158
|
+
# model = Sketchup.active_model
|
159
|
+
# model.layers.add_observer(MyLayersObserver.new)
|
160
|
+
# folder = model.layers.add_folder("Hello World")
|
161
|
+
# model.layers.remove_folder(folder)
|
162
|
+
#
|
163
|
+
# @param [Sketchup::Layers] layers
|
164
|
+
#
|
165
|
+
# @param [Sketchup::LayerFolder] layer_folder
|
166
|
+
#
|
167
|
+
# @return [nil]
|
168
|
+
#
|
169
|
+
# @version SketchUp 2021.0
|
170
|
+
def onLayerFolderRemoved(layers, layer_folder)
|
171
|
+
end
|
172
|
+
|
91
173
|
# The {#onLayerRemoved} method is called when a layer is removed from a model.
|
92
174
|
#
|
93
175
|
# @example
|
@@ -111,6 +193,37 @@ class Sketchup::LayersObserver
|
|
111
193
|
def onLayerRemoved(layers, layer)
|
112
194
|
end
|
113
195
|
|
196
|
+
# The {#onParentFolderChanged} method is called when a layer changes parent
|
197
|
+
# folder.
|
198
|
+
#
|
199
|
+
# @api TagFolder
|
200
|
+
#
|
201
|
+
# @example
|
202
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
203
|
+
# def onParentFolderChanged(layers, layer)
|
204
|
+
# puts "onParentFolderChange: #{layer.name}"
|
205
|
+
# end
|
206
|
+
# end
|
207
|
+
#
|
208
|
+
# model = Sketchup.active_model
|
209
|
+
# model.layers.add_observer(MyLayersObserver.new)
|
210
|
+
# layer = model.layers.add_layer("World")
|
211
|
+
# folder = model.layers.add_folder("Hello")
|
212
|
+
# layer.folder = folder
|
213
|
+
#
|
214
|
+
# @note When a folder changes parent {#onLayerFolderRemoved} and
|
215
|
+
# {#onLayerFolderAdded} triggers.
|
216
|
+
#
|
217
|
+
# @param [Sketchup::Layers] layers
|
218
|
+
#
|
219
|
+
# @param [Sketchup::Layer] layer
|
220
|
+
#
|
221
|
+
# @return [nil]
|
222
|
+
#
|
223
|
+
# @version SketchUp 2021.0
|
224
|
+
def onParentFolderChanged(layers, layer)
|
225
|
+
end
|
226
|
+
|
114
227
|
# The {#onRemoveAllLayers} method is called when all layer are removed from a
|
115
228
|
# model.
|
116
229
|
#
|
@@ -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 +Sketchup::Licensing+ module contains methods for
|
@@ -10,7 +10,7 @@
|
|
10
10
|
# than their Ruby API counterparts.
|
11
11
|
#
|
12
12
|
# For more details, see:
|
13
|
-
# {
|
13
|
+
# {Licensing Example}[https://github.com/SketchUp/sketchup-ruby-api-tutorials/tree/master/examples/99_license]
|
14
14
|
#
|
15
15
|
# @version SketchUp 2015
|
16
16
|
module Sketchup::Licensing
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# Provides access to the different line style objects in the model.
|
@@ -74,18 +74,6 @@ class Sketchup::LineStyles < Sketchup::Entity
|
|
74
74
|
def each
|
75
75
|
end
|
76
76
|
|
77
|
-
# The {#size} method returns the number of line styles that SketchUp supports.
|
78
|
-
#
|
79
|
-
# @example
|
80
|
-
# line_styles = Sketchup.active_model.line_styles
|
81
|
-
# line_styles.size
|
82
|
-
#
|
83
|
-
# @return [Integer] The count of line styles.
|
84
|
-
#
|
85
|
-
# @version SketchUp 2019
|
86
|
-
def length
|
87
|
-
end
|
88
|
-
|
89
77
|
# The {#names} method return the support line styles as strings.
|
90
78
|
#
|
91
79
|
# @example
|
@@ -108,6 +96,7 @@ class Sketchup::LineStyles < Sketchup::Entity
|
|
108
96
|
# @version SketchUp 2019
|
109
97
|
def size
|
110
98
|
end
|
99
|
+
alias_method :length, :size
|
111
100
|
|
112
101
|
# The {#to_a} method returns an array of all the line styles.
|
113
102
|
#
|
@@ -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 Material class represents a texture or color that can be applied to
|
@@ -358,20 +358,18 @@ class Sketchup::Material < Sketchup::Entity
|
|
358
358
|
#
|
359
359
|
# @overload texture=(filename)
|
360
360
|
#
|
361
|
-
# @param
|
362
|
-
#
|
361
|
+
# @param [String] filename
|
362
|
+
# The file path to the texture the material should use.
|
363
363
|
#
|
364
364
|
# @overload texture=(properties)
|
365
365
|
#
|
366
|
-
# @param
|
367
|
-
# texture
|
368
|
-
# @return [Array(String, Integer, Integer)]
|
366
|
+
# @param [Array(String, Length, Length)] properties
|
367
|
+
# An array with the texture file path and optionally the width and height.
|
369
368
|
#
|
370
369
|
# @overload texture=(image_rep)
|
371
370
|
#
|
372
371
|
# @param [Sketchup::ImageRep] image_rep The pixel data representing the
|
373
372
|
# texture. (Added in SketchUp 2018)
|
374
|
-
# @return [Sketchup::ImageRep]
|
375
373
|
#
|
376
374
|
# @version SketchUp 6.0
|
377
375
|
def texture=(arg)
|
@@ -401,8 +399,8 @@ class Sketchup::Material < Sketchup::Entity
|
|
401
399
|
# material.write_thumbnail(thumbnail_file, 128)
|
402
400
|
# }
|
403
401
|
#
|
404
|
-
# @param [String]
|
405
|
-
# The file
|
402
|
+
# @param [String] path
|
403
|
+
# The file path for the thumbnail.
|
406
404
|
#
|
407
405
|
# @param [Integer] resolution
|
408
406
|
# The resolution of the thumbnail.
|
@@ -410,7 +408,7 @@ class Sketchup::Material < Sketchup::Entity
|
|
410
408
|
# @return [Boolean] true if successful, false if unsuccessful.
|
411
409
|
#
|
412
410
|
# @version SketchUp 8.0 M1
|
413
|
-
def write_thumbnail(
|
411
|
+
def write_thumbnail(path, resolution)
|
414
412
|
end
|
415
413
|
|
416
414
|
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
|
# A collection of Materials objects. Each model contains a Materials collection
|
@@ -29,13 +29,14 @@ class Sketchup::Materials < Sketchup::Entity
|
|
29
29
|
#
|
30
30
|
# @overload [](index)
|
31
31
|
#
|
32
|
-
# @param
|
33
|
-
#
|
32
|
+
# @param [Integer] index
|
33
|
+
# A number representing the material's index in an array of Material
|
34
|
+
# objects.
|
34
35
|
# @return [Sketchup::Material, nil] a Material object on success, Nil on failure
|
35
36
|
#
|
36
37
|
# @overload [](name)
|
37
38
|
#
|
38
|
-
# @param
|
39
|
+
# @param [String] name The name of the material.
|
39
40
|
# @return [Sketchup::Material, nil] a Material object on success, Nil on failure
|
40
41
|
#
|
41
42
|
# @version SketchUp 6.0
|
@@ -89,13 +90,14 @@ class Sketchup::Materials < Sketchup::Entity
|
|
89
90
|
#
|
90
91
|
# @overload [](index)
|
91
92
|
#
|
92
|
-
# @param
|
93
|
-
#
|
93
|
+
# @param [Integer] index
|
94
|
+
# A number representing the material's index in an array of Material
|
95
|
+
# objects.
|
94
96
|
# @return [Sketchup::Material, nil] a Material object on success, Nil on failure
|
95
97
|
#
|
96
98
|
# @overload [](name)
|
97
99
|
#
|
98
|
-
# @param
|
100
|
+
# @param [String] name The name of the material.
|
99
101
|
# @return [Sketchup::Material, nil] a Material object on success, Nil on failure
|
100
102
|
#
|
101
103
|
# @version SketchUp 6.0
|
@@ -147,7 +149,7 @@ class Sketchup::Materials < Sketchup::Entity
|
|
147
149
|
def current=(material)
|
148
150
|
end
|
149
151
|
|
150
|
-
# The each method is used to iterate through all of the materials.
|
152
|
+
# The {#each} method is used to iterate through all of the materials.
|
151
153
|
#
|
152
154
|
# @example
|
153
155
|
# model = Sketchup.active_model
|
@@ -155,6 +157,11 @@ class Sketchup::Materials < Sketchup::Entity
|
|
155
157
|
# puts material.display_name
|
156
158
|
# }
|
157
159
|
#
|
160
|
+
# @note Don't remove content from this collection while iterating over it with
|
161
|
+
# {#each}. This would change the size of the collection and cause elements to
|
162
|
+
# be skipped as the indices change. Instead copy the current collection to an
|
163
|
+
# array using +to_a+ and then use +each+ on the array, when removing content.
|
164
|
+
#
|
158
165
|
# @return [nil]
|
159
166
|
#
|
160
167
|
# @version SketchUp 6.0
|
@@ -184,7 +191,7 @@ class Sketchup::Materials < Sketchup::Entity
|
|
184
191
|
|
185
192
|
# The {#load} method is used to load a material from file into the model.
|
186
193
|
#
|
187
|
-
# If a matching material exist in the model
|
194
|
+
# If a matching material exist in the model it will be returned instead.
|
188
195
|
#
|
189
196
|
# @example
|
190
197
|
# # Load a material from the shipped SketchUp library. (SketchUp 2016)
|
@@ -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 materials events.
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# This observer interface is implemented to react to materials 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
|
# class MyMaterialsObserver < Sketchup::MaterialsObserver
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright
|
1
|
+
# Copyright:: Copyright 2021 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
4
|
# An interface to a menu.
|
@@ -20,9 +20,9 @@ class Sketchup::Menu
|
|
20
20
|
# menu = UI.menu('Plugins')
|
21
21
|
# menu.add_item("Test") { puts 'Hello World' }
|
22
22
|
#
|
23
|
-
# @overload add_item(
|
23
|
+
# @overload add_item(title, &block)
|
24
24
|
#
|
25
|
-
# @param [String]
|
25
|
+
# @param [String] title
|
26
26
|
# @yield A block that will be invoked when the menu item is selected.
|
27
27
|
# @return [Integer] A unique integer id for the added menu item.
|
28
28
|
#
|
@@ -35,7 +35,7 @@ class Sketchup::Menu
|
|
35
35
|
def add_item(*args)
|
36
36
|
end
|
37
37
|
|
38
|
-
# The add_separator method is used to add a menu separator to a menu.
|
38
|
+
# The {#add_separator} method is used to add a menu separator to a menu.
|
39
39
|
#
|
40
40
|
# @example
|
41
41
|
# plugins_menu = UI.menu("Plugins")
|
@@ -47,7 +47,7 @@ class Sketchup::Menu
|
|
47
47
|
def add_separator
|
48
48
|
end
|
49
49
|
|
50
|
-
# The add_submenu method is used to add a sub-menu to a menu.
|
50
|
+
# The {#add_submenu} method is used to add a sub-menu to a menu.
|
51
51
|
#
|
52
52
|
# @example
|
53
53
|
# plugins_menu = UI.menu("Plugins")
|
@@ -65,7 +65,7 @@ class Sketchup::Menu
|
|
65
65
|
def add_submenu(title)
|
66
66
|
end
|
67
67
|
|
68
|
-
# The set_validation_proc method is used to
|
68
|
+
# The {#set_validation_proc} method is used to specify the menu validation
|
69
69
|
# procedure. Your procedure should return either MF_ENABLED, MF_DISABLED,
|
70
70
|
# MF_CHECKED, MF_UNCHECKED, or MF_GRAYED.
|
71
71
|
#
|
@@ -80,16 +80,14 @@ class Sketchup::Menu
|
|
80
80
|
# end
|
81
81
|
# }
|
82
82
|
#
|
83
|
-
# @param [
|
84
|
-
#
|
85
|
-
#
|
86
|
-
# @return [Integer] a unique numerical item id for the menu
|
83
|
+
# @param [Integer] item
|
84
|
+
# The numerical identifier for the menu item.
|
87
85
|
#
|
88
86
|
# @version SketchUp 6.0
|
89
87
|
#
|
90
88
|
# @yield A method that will be invoked when the menu item is
|
91
89
|
# selected.
|
92
|
-
def set_validation_proc(
|
90
|
+
def set_validation_proc(item, &block)
|
93
91
|
end
|
94
92
|
|
95
93
|
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
|
# This is the interface to a SketchUp model. The model is the 3D drawing that
|
@@ -44,6 +44,9 @@ class Sketchup::Model
|
|
44
44
|
|
45
45
|
# Constants
|
46
46
|
|
47
|
+
LOAD_STATUS_SUCCESS = nil # Stub value.
|
48
|
+
LOAD_STATUS_SUCCESS_MORE_RECENT = nil # Stub value.
|
49
|
+
|
47
50
|
Make = nil # Stub value.
|
48
51
|
MakeTrial = nil # Stub value.
|
49
52
|
ProLicensed = nil # Stub value.
|
@@ -57,6 +60,7 @@ class Sketchup::Model
|
|
57
60
|
VERSION_2018 = nil # Stub value.
|
58
61
|
VERSION_2019 = nil # Stub value.
|
59
62
|
VERSION_2020 = nil # Stub value.
|
63
|
+
VERSION_2021 = nil # Stub value.
|
60
64
|
VERSION_3 = nil # Stub value.
|
61
65
|
VERSION_4 = nil # Stub value.
|
62
66
|
VERSION_5 = nil # Stub value.
|
@@ -66,15 +70,19 @@ class Sketchup::Model
|
|
66
70
|
|
67
71
|
# Instance Methods
|
68
72
|
|
69
|
-
# The abort_operation method aborts the current operation started with the
|
73
|
+
# The {#abort_operation} method aborts the current operation started with the
|
70
74
|
# start_operation method.
|
71
75
|
#
|
72
|
-
# The abort_operation method is normally called from inside of a rescue
|
73
|
-
# to cancel an operation if something goes wrong.
|
76
|
+
# The {#abort_operation} method is normally called from inside of a rescue
|
77
|
+
# clause to cancel an operation if something goes wrong.
|
74
78
|
#
|
75
79
|
# @example
|
76
80
|
# status = model.abort_operation
|
77
81
|
#
|
82
|
+
# @note Never abort a transparent operation. Doing so would abort the operation
|
83
|
+
# it chains to. Instead, try to clean up and simply commit in order to make
|
84
|
+
# sure the operation is closed.
|
85
|
+
#
|
78
86
|
# @return [Boolean] true if successful, false if unsuccessful
|
79
87
|
#
|
80
88
|
# @version SketchUp 6.0
|
@@ -155,37 +163,6 @@ class Sketchup::Model
|
|
155
163
|
|
156
164
|
# The {#active_path=} method is used to open a given instance path for editing.
|
157
165
|
#
|
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
166
|
# @example Open an instance
|
190
167
|
# model = Sketchup.active_model
|
191
168
|
# instance = model.active_entities.grep(Sketchup::ComponentInstance).first
|
@@ -201,8 +178,37 @@ class Sketchup::Model
|
|
201
178
|
# on the given path. A definition cannot be edited if any of its instances
|
202
179
|
# are locked.
|
203
180
|
#
|
204
|
-
# @note
|
205
|
-
# be
|
181
|
+
# @note Since changing the active entities in SketchUp also changes what
|
182
|
+
# coordinate system is used, entities can't be modified in the same operation
|
183
|
+
# as the active entities changes. The API handles this automatically by
|
184
|
+
# starting and committing transparent operations as needed.
|
185
|
+
#
|
186
|
+
# If the API user tries to do this:
|
187
|
+
#
|
188
|
+
# model.start_operation('...', true)
|
189
|
+
# model.entities.add_face(...)
|
190
|
+
# model.active_path = instance_path
|
191
|
+
# model.entities.add_face(...)
|
192
|
+
# model.commit_operation
|
193
|
+
#
|
194
|
+
# Then SketchUp will automatically break it up to something like to this:
|
195
|
+
#
|
196
|
+
# model.start_operation('...', true)
|
197
|
+
# model.entities.add_face(...)
|
198
|
+
# model.commit_operation
|
199
|
+
#
|
200
|
+
# model.start_operation('...', true, false, true)
|
201
|
+
# model.active_path = instance_path
|
202
|
+
# model.commit_operation
|
203
|
+
#
|
204
|
+
# model.start_operation('...', true, false, true)
|
205
|
+
# model.entities.add_face(...)
|
206
|
+
# model.commit_operation
|
207
|
+
#
|
208
|
+
# For the end user this will be experienced as a single operation.
|
209
|
+
#
|
210
|
+
# For the API user the side-effect is multiple transaction notifications to
|
211
|
+
# {Sketchup::ModelObserver}s.
|
206
212
|
#
|
207
213
|
# @param [Sketchup::InstancePath, Array<Sketchup::ComponentInstance, Sketchup::Group>, nil] instance_path
|
208
214
|
# Passing +nil+ or an empty array will close all open instances.
|
@@ -214,6 +220,8 @@ class Sketchup::Model
|
|
214
220
|
# @raise [ArgumentError] if the instance path contains instances who's
|
215
221
|
# siblings are locked.
|
216
222
|
#
|
223
|
+
# @raise [ArgumentError] if the instance path contains Live Components.
|
224
|
+
#
|
217
225
|
# @return [Sketchup::Model]
|
218
226
|
#
|
219
227
|
# @version SketchUp 2020.0
|
@@ -360,13 +368,14 @@ class Sketchup::Model
|
|
360
368
|
def behavior
|
361
369
|
end
|
362
370
|
|
363
|
-
# The {#bounds} method
|
371
|
+
# The {#bounds} method is used to retrieve the {Geom::BoundingBox} bounding the
|
372
|
+
# contents of a {Sketchup::Model}.
|
364
373
|
#
|
365
374
|
# @example
|
366
375
|
# model = Sketchup.active_model
|
367
376
|
# bounds = model.bounds
|
368
377
|
#
|
369
|
-
# @return [Geom::BoundingBox]
|
378
|
+
# @return [Geom::BoundingBox]
|
370
379
|
#
|
371
380
|
# @version SketchUp 6.0
|
372
381
|
def bounds
|
@@ -614,15 +623,15 @@ class Sketchup::Model
|
|
614
623
|
# :ifc_types => ['IfcBuilding', 'IfcDoor']}
|
615
624
|
# status = model.export('c:/my_export.ifc', options_hash)
|
616
625
|
#
|
617
|
-
# @overload export(
|
626
|
+
# @overload export(path, show_summary = false)
|
618
627
|
#
|
619
|
-
# @param [String]
|
628
|
+
# @param [String] path The name of the file to export.
|
620
629
|
# @param [Boolean] show_summary Boolean to show summary dialog.
|
621
630
|
# @return [Boolean]
|
622
631
|
#
|
623
|
-
# @overload export(
|
632
|
+
# @overload export(path, options)
|
624
633
|
#
|
625
|
-
# @param [String]
|
634
|
+
# @param [String] path The path to save the export at.
|
626
635
|
# @param [Hash] options
|
627
636
|
# @return [Boolean]
|
628
637
|
#
|
@@ -689,15 +698,54 @@ class Sketchup::Model
|
|
689
698
|
# entities = model.find_entity_by_persistent_id(id1, id2, id3)
|
690
699
|
# entities = model.find_entity_by_persistent_id([id1, id2, id3])
|
691
700
|
#
|
692
|
-
# @
|
693
|
-
#
|
694
|
-
#
|
695
|
-
#
|
696
|
-
#
|
697
|
-
#
|
701
|
+
# @example Limit search by scope
|
702
|
+
# model = Sketchup.active_model
|
703
|
+
# edge_pid = model.entities.add_line([0,0,0], [9,9,9]).persistent_id
|
704
|
+
# layer_pid = model.layers.add('Hello World').persistent_id
|
705
|
+
#
|
706
|
+
# # Search in all scopes:
|
707
|
+
# entities = model.find_entity_by_persistent_id(edge_pid, layer_pid)
|
708
|
+
# # => [#<Sketchup::Edge:0x000002567da4a8f0>, #<Sketchup::Layer:0x000002567da49e50>]
|
709
|
+
#
|
710
|
+
# # Search in layer scope:
|
711
|
+
# entities = model.find_entity_by_persistent_id(edge_pid, layer_pid, layers: true)
|
712
|
+
# # => [nil, #<Sketchup::Layer:0x000002567da49e50>]
|
713
|
+
#
|
714
|
+
# @overload find_entity_by_persistent_id(ids_or_array)
|
715
|
+
#
|
716
|
+
# @param [Array<Integer>] ids_or_array Pass either a series of ids or a
|
717
|
+
# single array containing persistent ids.
|
718
|
+
#
|
719
|
+
# @return [Array<Sketchup::Entity, nil>] Returns an array with
|
720
|
+
# {Sketchup::Entity} objects for each id found and nil otherwise.
|
721
|
+
#
|
722
|
+
# @overload find_entity_by_persistent_id(ids_or_array, **scope)
|
723
|
+
#
|
724
|
+
# @version SketchUp 2020.2
|
725
|
+
# @param [Array<Integer>] ids_or_array Pass either a series of ids or a
|
726
|
+
# single array containing persistent ids.
|
727
|
+
# @param [Hash<Symbol, Boolean>] scope Limit the scope of the search to the
|
728
|
+
# given scope categories.
|
729
|
+
# @option [Boolean] scope :entities Search entities parent to
|
730
|
+
# {Sketchup::Entities}.
|
731
|
+
# @option [Boolean] scope :layers Search {Sketchup::Layers} for
|
732
|
+
# {Sketchup::Layer} entities.
|
733
|
+
# @option [Boolean] scope :layer_folders Search {Sketchup::Layers} for
|
734
|
+
# {Sketchup::LayerFolder} entities.
|
735
|
+
# @option [Boolean] scope :materials Search {Sketchup::Materials} for
|
736
|
+
# {Sketchup::Material} entities.
|
737
|
+
# @option [Boolean] scope :pages Search {Sketchup::Pages} for
|
738
|
+
# {Sketchup::Page} entities.
|
739
|
+
# @option [Boolean] scope :styles Search {Sketchup::Styles} for
|
740
|
+
# {Sketchup::Style} entities.
|
741
|
+
# @option [Boolean] scope :definitions Search {Sketchup::DefinitionList} for
|
742
|
+
# {Sketchup::ComponentDefinition} entities.
|
743
|
+
#
|
744
|
+
# @return [Array<Sketchup::Entity, nil>] Returns an array with
|
745
|
+
# {Sketchup::Entity} objects for each id found and nil otherwise.
|
698
746
|
#
|
699
747
|
# @version SketchUp 2017
|
700
|
-
def find_entity_by_persistent_id(
|
748
|
+
def find_entity_by_persistent_id(*args)
|
701
749
|
end
|
702
750
|
|
703
751
|
# This methods determines if the model is georeferenced.
|
@@ -805,6 +853,9 @@ class Sketchup::Model
|
|
805
853
|
# The import method is used to load a file by recognizing the file extension
|
806
854
|
# and calling appropriate importer.
|
807
855
|
#
|
856
|
+
# See {Sketchup::DefinitionList#import} for importing a 3d model file as a
|
857
|
+
# component definition, without activating the UI for placing an instance.
|
858
|
+
#
|
808
859
|
# See the {file:pages/importer_options.md Importer Options} file for information
|
809
860
|
# on creating a valid hash for the various importers.
|
810
861
|
#
|
@@ -820,16 +871,16 @@ class Sketchup::Model
|
|
820
871
|
# :show_summary => true }
|
821
872
|
# status = model.import("filename", options)
|
822
873
|
#
|
823
|
-
# @overload import(
|
874
|
+
# @overload import(path, options)
|
824
875
|
#
|
825
|
-
# @param [String]
|
876
|
+
# @param [String] path The input file path.
|
826
877
|
# @param [Hash] options The options.
|
827
878
|
# @return [Boolean]
|
828
879
|
#
|
829
|
-
# @overload import(
|
880
|
+
# @overload import(path, show_summary = false)
|
830
881
|
#
|
831
882
|
# @note This variant is for SketchUp 2017 and earlier.
|
832
|
-
# @param [String]
|
883
|
+
# @param [String] path The input file path.
|
833
884
|
# @param [Boolean] show_summary Show the summary dialog.
|
834
885
|
# @return [Boolean]
|
835
886
|
#
|
@@ -1031,7 +1082,7 @@ class Sketchup::Model
|
|
1031
1082
|
# @example
|
1032
1083
|
# # Output all options available.
|
1033
1084
|
# options_manager = Sketchup.active_model.options
|
1034
|
-
# options_manager.
|
1085
|
+
# options_manager.each { |options_provider|
|
1035
1086
|
# puts options_provider.name
|
1036
1087
|
# options_provider.each { |key, value|
|
1037
1088
|
# puts "> #{key} - #{value}"
|
@@ -1214,15 +1265,15 @@ class Sketchup::Model
|
|
1214
1265
|
# @example
|
1215
1266
|
# model = Sketchup.active_model
|
1216
1267
|
# # Save the model using the current SketchUp format
|
1217
|
-
#
|
1218
|
-
# status = model.save(
|
1268
|
+
# path = File.join(ENV['HOME'], 'Desktop', 'mysketchup.skp')
|
1269
|
+
# status = model.save(path)
|
1219
1270
|
# # Save the model to the current file using the current SketchUp format
|
1220
1271
|
# status = model.save
|
1221
1272
|
# # Save the model to the current file in SketchUp 8 format
|
1222
1273
|
# status = model.save("", Sketchup::Model::VERSION_8)
|
1223
1274
|
# # Save the model in SketchUp 8 format
|
1224
|
-
#
|
1225
|
-
# status = model.save(
|
1275
|
+
# path = File.join(ENV['Home'], 'Desktop', 'mysketchup_v8.skp')
|
1276
|
+
# status = model.save(path, Sketchup::Model::VERSION_8)
|
1226
1277
|
#
|
1227
1278
|
# @note A bug in SketchUp 2016 and older caused the +.skb+ backup file
|
1228
1279
|
# written during save to be empty. The +.skp+ file was however valid.
|
@@ -1234,19 +1285,19 @@ class Sketchup::Model
|
|
1234
1285
|
# will be saved to the file to which it is associated. It must have
|
1235
1286
|
# already been saved to a file.
|
1236
1287
|
#
|
1237
|
-
# @overload save(
|
1288
|
+
# @overload save(path)
|
1238
1289
|
#
|
1239
|
-
# @param [String]
|
1290
|
+
# @param [String] path
|
1240
1291
|
# The name of the file to save.
|
1241
1292
|
# Starting with SketchUp 2014, this parameter is optional.
|
1242
1293
|
# If not provided or an empty string, model will be saved
|
1243
1294
|
# to the file to which it is associated. It must have
|
1244
1295
|
# already been saved to a file.
|
1245
1296
|
#
|
1246
|
-
# @overload save(
|
1297
|
+
# @overload save(path, version)
|
1247
1298
|
#
|
1248
|
-
# @param [String]
|
1249
|
-
# The
|
1299
|
+
# @param [String] path
|
1300
|
+
# The path of the file to save to.
|
1250
1301
|
# Starting with SketchUp 2014, this parameter is optional.
|
1251
1302
|
# If not provided or an empty string, model will be saved
|
1252
1303
|
# to the file to which it is associated. It must have
|
@@ -1267,7 +1318,8 @@ class Sketchup::Model
|
|
1267
1318
|
# Sketchup::Model::VERSION_2017,
|
1268
1319
|
# Sketchup::Model::VERSION_2018,
|
1269
1320
|
# Sketchup::Model::VERSION_2019,
|
1270
|
-
# Sketchup::Model::VERSION_2020
|
1321
|
+
# Sketchup::Model::VERSION_2020,
|
1322
|
+
# Sketchup::Model::VERSION_2021
|
1271
1323
|
#
|
1272
1324
|
# @return [Boolean] true if successful, false if unsuccessful
|
1273
1325
|
#
|
@@ -1280,14 +1332,14 @@ class Sketchup::Model
|
|
1280
1332
|
# @example
|
1281
1333
|
# model = Sketchup.active_model
|
1282
1334
|
# # Save copy of the model using the current SketchUp format
|
1283
|
-
#
|
1284
|
-
# status = model.save_copy(
|
1335
|
+
# path = File.join(ENV['Home'], 'Desktop', 'myModelCopy.skp')
|
1336
|
+
# status = model.save_copy(path)
|
1285
1337
|
# # Save copy of the model in SketchUp 8 format
|
1286
|
-
#
|
1287
|
-
# status = model.save_copy(
|
1338
|
+
# path = File.join(ENV['Home'], 'Desktop', 'mysketchupcopy_v8.skp')
|
1339
|
+
# status = model.save_copy(path, Sketchup::Model::VERSION_8)
|
1288
1340
|
#
|
1289
|
-
# @param [String]
|
1290
|
-
# The
|
1341
|
+
# @param [String] path
|
1342
|
+
# The path of the file to save the model copy to.
|
1291
1343
|
#
|
1292
1344
|
# @param [Integer] version
|
1293
1345
|
# (SketchUp 2014+)
|
@@ -1304,12 +1356,13 @@ class Sketchup::Model
|
|
1304
1356
|
# Sketchup::Model::VERSION_2017,
|
1305
1357
|
# Sketchup::Model::VERSION_2018,
|
1306
1358
|
# Sketchup::Model::VERSION_2019,
|
1307
|
-
# Sketchup::Model::VERSION_2020
|
1359
|
+
# Sketchup::Model::VERSION_2020,
|
1360
|
+
# Sketchup::Model::VERSION_2021
|
1308
1361
|
#
|
1309
1362
|
# @return [Boolean] true if successful, false if unsuccessful
|
1310
1363
|
#
|
1311
1364
|
# @version SketchUp 2014
|
1312
|
-
def save_copy(
|
1365
|
+
def save_copy(path, version)
|
1313
1366
|
end
|
1314
1367
|
|
1315
1368
|
# The save_thumbnail method is used to save a thumbnail image to a file.
|