sketchup-api-stubs 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.yardopts +9 -9
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +4 -5
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +1 -2
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +4 -0
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +55 -0
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +188 -0
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +8 -3
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +4 -0
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +147 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +22 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +4 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +80 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bb72e30ef14ac1304786753cba895f4f33f0f385
|
4
|
+
data.tar.gz: af93be638b15ec0e5a973774f3bf62e184f4d990
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4543f6149197135ba5c17ab692a70f484054b646d56251209969a19946a8b0ad507249eca712f799d110ac9dff186773b306508f6defef194cc8bcd784593a6a
|
7
|
+
data.tar.gz: bfd1f6ded0a8bdb1604cef99fe9ddb5a7c9f378c60de3c2a64a34926b6d0e6306f0d556085cbb036bcdbbe91b0970f8c031a81d8574f9fc8a75f87237ed1761e
|
data/.yardopts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
--title "SketchUp Ruby API Documentation"
|
2
|
-
--no-api
|
3
|
-
--no-private
|
4
|
-
--hide-api Internal
|
5
|
-
--plugin yard-sketchup
|
6
|
-
--asset images:images
|
7
|
-
lib/sketchup-api-stubs/stubs/**/*.rb
|
8
|
-
-
|
9
|
-
pages/*.md
|
1
|
+
--title "SketchUp Ruby API Documentation"
|
2
|
+
--no-api
|
3
|
+
--no-private
|
4
|
+
--hide-api Internal
|
5
|
+
--plugin yard-sketchup
|
6
|
+
--asset images:images
|
7
|
+
lib/sketchup-api-stubs/stubs/**/*.rb
|
8
|
+
-
|
9
|
+
pages/*.md
|
@@ -1,12 +1,11 @@
|
|
1
1
|
# Copyright:: Copyright 2020 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
|
-
# The {Geom::
|
5
|
-
# {Geom::Point2d} is
|
6
|
-
# coordinates.
|
4
|
+
# The {Geom::Point2d} class allows you to work with a point in 2D space.
|
5
|
+
# {Geom::Point2d} is a series of values representing x and y coordinates.
|
7
6
|
#
|
8
|
-
# The values are specified as [x, y]
|
9
|
-
# To create a point call Geom::Point2d.new
|
7
|
+
# The values are specified as +[x, y]+. For example [1, 1].
|
8
|
+
# To create a point call +Geom::Point2d.new+, where the creation method
|
10
9
|
# can take a variety of arguments:
|
11
10
|
#
|
12
11
|
# @example
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# Copyright:: Copyright 2020 Trimble Inc.
|
2
2
|
# License:: The MIT License (MIT)
|
3
3
|
|
4
|
-
# The Vector2d class represents vectors in a 2 dimensional space.
|
5
|
-
# Vectors in LayOut have a direction and a length, but not a starting point.
|
4
|
+
# The {Geom::Vector2d} class represents vectors in a 2 dimensional space.
|
6
5
|
#
|
7
6
|
# There are numerous tutorials on 2D vectors available on the internet.
|
8
7
|
#
|
@@ -536,6 +536,10 @@ class Layout::AngularDimension < Layout::Entity
|
|
536
536
|
# dim = Layout::AngularDimension.new(start_point, end_point, start_extent, end_extent, inner_angle)
|
537
537
|
# text = dim.text
|
538
538
|
#
|
539
|
+
# @note With the addition of auto-text in dimensions for LayOut 2019.2, the
|
540
|
+
# copy of the dimension text incorrectly provided the plain text when
|
541
|
+
# requesting the display text. This has been fixed for LayOut 2020.1.
|
542
|
+
#
|
539
543
|
# @return [Layout::FormattedText]
|
540
544
|
#
|
541
545
|
# @version LayOut 2018
|
@@ -143,6 +143,61 @@ class Layout::Document
|
|
143
143
|
def auto_text_definitions
|
144
144
|
end
|
145
145
|
|
146
|
+
# The {#export} method exports the {Layout::Document} to a given file format.
|
147
|
+
# It knows which format to export based on the file extension you place on the
|
148
|
+
# file name. For example, a filename of "thing.pdf" will export a PDF file,
|
149
|
+
# whereas "thing.png" will export a set of PNG images.
|
150
|
+
#
|
151
|
+
# For LayOut version 2020.1, valid extensions include .pdf, .jpg, and .png.
|
152
|
+
#
|
153
|
+
# @example PDF Export Examples
|
154
|
+
# doc = Layout::Document.open("c:/path/to/document.layout")
|
155
|
+
#
|
156
|
+
# # Export pdf file on a PC, with default settings.
|
157
|
+
# status = doc.export("c:/my_export.pdf")
|
158
|
+
#
|
159
|
+
# # Export pages one through three at high quality, compressing jpeg images
|
160
|
+
# # at 0.75 compression quality (valid range is 0.0 - 1.0). Note that the
|
161
|
+
# # first page of a {Layout::Document} is index 0.
|
162
|
+
# options = { start_page: 1,
|
163
|
+
# end_page: 3,
|
164
|
+
# output_resolution: Layout::PageInfo::RESOLUTION_HIGH,
|
165
|
+
# compress_images: TRUE,
|
166
|
+
# compress_quality: 0.75 }
|
167
|
+
#
|
168
|
+
# status = doc.export("c:/my_export.pdf", options)
|
169
|
+
#
|
170
|
+
# @example Image Set Export Examples
|
171
|
+
# doc = Layout::Document.open("c:/path/to/document.layout")
|
172
|
+
#
|
173
|
+
# # Export png files on macOS, with default settings.
|
174
|
+
# status = doc.export('/Users/username/Desktop/pngs/page.png')
|
175
|
+
#
|
176
|
+
# # Export pages one through three at 300 dpi as JPGs.
|
177
|
+
# options = { start_page: 1,
|
178
|
+
# end_page: 3,
|
179
|
+
# dpi: 300 }
|
180
|
+
# status = doc.export('c:/page.jpg', options)
|
181
|
+
#
|
182
|
+
# @param [String] file_path
|
183
|
+
# The file or image set to create. The directory
|
184
|
+
# path must already exist. The path must include the file extension.
|
185
|
+
#
|
186
|
+
# @param [Hash, nil] options
|
187
|
+
# An optional hash of settings for the export.
|
188
|
+
#
|
189
|
+
# @raise [TypeError] if an options value is the wrong type
|
190
|
+
#
|
191
|
+
# @raise [RangeError] if an options value is out of range
|
192
|
+
#
|
193
|
+
# @raise [ArgumentError] if the full file path does not exist
|
194
|
+
#
|
195
|
+
# @raise [ArgumentError] if the specified file type is missing or not supported
|
196
|
+
#
|
197
|
+
# @version LayOut 2020.1
|
198
|
+
def export(file_path, options = nil)
|
199
|
+
end
|
200
|
+
|
146
201
|
# The {#grid} method returns the {Layout::Grid} for a {Layout::Document}.
|
147
202
|
#
|
148
203
|
# @example
|
@@ -8,6 +8,62 @@ class Layout::Grid
|
|
8
8
|
|
9
9
|
# Instance Methods
|
10
10
|
|
11
|
+
# The {#clip_to_margins=} method sets whether or not the grid is clipped to the
|
12
|
+
# page margins.
|
13
|
+
#
|
14
|
+
# @example
|
15
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
16
|
+
# grid = doc.grid
|
17
|
+
# grid.clip_to_margins = true
|
18
|
+
#
|
19
|
+
# @param [Boolean] clip
|
20
|
+
#
|
21
|
+
# @version LayOut 2020.1
|
22
|
+
def clip_to_margins=(clip)
|
23
|
+
end
|
24
|
+
|
25
|
+
# The {#clip_to_margins?} method returns whether or not the grid is clipped to
|
26
|
+
# the page margins.
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
30
|
+
# grid = doc.grid
|
31
|
+
# in_front = grid.clip_to_margins?
|
32
|
+
#
|
33
|
+
# @return [Boolean]
|
34
|
+
#
|
35
|
+
# @version LayOut 2020.1
|
36
|
+
def clip_to_margins?
|
37
|
+
end
|
38
|
+
|
39
|
+
# The {#in_front=} method sets whether or not the grid is drawn on top of
|
40
|
+
# entities.
|
41
|
+
#
|
42
|
+
# @example
|
43
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
44
|
+
# grid = doc.grid
|
45
|
+
# grid.in_front = true
|
46
|
+
#
|
47
|
+
# @param [Boolean] in_front
|
48
|
+
#
|
49
|
+
# @version LayOut 2020.1
|
50
|
+
def in_front=(in_front)
|
51
|
+
end
|
52
|
+
|
53
|
+
# The {#in_front?} method returns whether or not the grid is drawn on top of
|
54
|
+
# entities.
|
55
|
+
#
|
56
|
+
# @example
|
57
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
58
|
+
# grid = doc.grid
|
59
|
+
# in_front = grid.in_front?
|
60
|
+
#
|
61
|
+
# @return [Boolean]
|
62
|
+
#
|
63
|
+
# @version LayOut 2020.1
|
64
|
+
def in_front?
|
65
|
+
end
|
66
|
+
|
11
67
|
# The {#major_color} method returns the {Sketchup::Color} for the major grid
|
12
68
|
# lines.
|
13
69
|
#
|
@@ -22,6 +78,26 @@ class Layout::Grid
|
|
22
78
|
def major_color
|
23
79
|
end
|
24
80
|
|
81
|
+
# The {#major_color=} method sets the {Sketchup::Color} for the major grid
|
82
|
+
# lines.
|
83
|
+
#
|
84
|
+
# @example
|
85
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
86
|
+
# grid = doc.grid
|
87
|
+
# grid.major_color = Sketchup::Color.new(255, 0, 0)
|
88
|
+
# grid.major_color = 255
|
89
|
+
# grid.major_color = 0x0000ff
|
90
|
+
# grid.major_color = "red"
|
91
|
+
# grid.major_color = "#ff0000"
|
92
|
+
# grid.major_color = [1.0, 0.0, 0.0]
|
93
|
+
# grid.major_color = [255, 0, 0]
|
94
|
+
#
|
95
|
+
# @param [Sketchup::Color] color
|
96
|
+
#
|
97
|
+
# @version LayOut 2020.1
|
98
|
+
def major_color=(color)
|
99
|
+
end
|
100
|
+
|
25
101
|
# The {#major_spacing} method returns the major space size of the
|
26
102
|
# {Layout::Grid}.
|
27
103
|
#
|
@@ -36,6 +112,24 @@ class Layout::Grid
|
|
36
112
|
def major_spacing
|
37
113
|
end
|
38
114
|
|
115
|
+
# The {#major_spacing=} method sets the major space size of the
|
116
|
+
# {Layout::Grid}.
|
117
|
+
#
|
118
|
+
# @example
|
119
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
120
|
+
# grid = doc.grid
|
121
|
+
# grid.major_spacing = 1.25
|
122
|
+
#
|
123
|
+
# @param [Float] spacing
|
124
|
+
# The double specifying the space size for the
|
125
|
+
# {Layout::Grid}
|
126
|
+
#
|
127
|
+
# @raise [ArgumentError] if spacing is not greater than zero
|
128
|
+
#
|
129
|
+
# @version LayOut 2020.1
|
130
|
+
def major_spacing=(spacing)
|
131
|
+
end
|
132
|
+
|
39
133
|
# The {#minor_color} method returns the {Sketchup::Color} for the minor grid
|
40
134
|
# lines.
|
41
135
|
#
|
@@ -50,6 +144,26 @@ class Layout::Grid
|
|
50
144
|
def minor_color
|
51
145
|
end
|
52
146
|
|
147
|
+
# The {#minor_color=} method sets the {Sketchup::Color} for the minor grid
|
148
|
+
# lines.
|
149
|
+
#
|
150
|
+
# @example
|
151
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
152
|
+
# grid = doc.grid
|
153
|
+
# grid.minor_color = Sketchup::Color.new(255, 0, 0)
|
154
|
+
# grid.minor_color = 255
|
155
|
+
# grid.minor_color = 0x0000ff
|
156
|
+
# grid.minor_color = "red"
|
157
|
+
# grid.minor_color = "#ff0000"
|
158
|
+
# grid.minor_color = [1.0, 0.0, 0.0]
|
159
|
+
# grid.minor_color = [255, 0, 0]
|
160
|
+
#
|
161
|
+
# @param [Sketchup::Color] color
|
162
|
+
#
|
163
|
+
# @version LayOut 2020.1
|
164
|
+
def minor_color=(color)
|
165
|
+
end
|
166
|
+
|
53
167
|
# The {#minor_divisions} method returns the number of minor divisions of the
|
54
168
|
# {Layout::Grid}.
|
55
169
|
#
|
@@ -64,6 +178,38 @@ class Layout::Grid
|
|
64
178
|
def minor_divisions
|
65
179
|
end
|
66
180
|
|
181
|
+
# The {#minor_divisions=} method sets the number of minor divisions of the
|
182
|
+
# {Layout::Grid}.
|
183
|
+
#
|
184
|
+
# @example
|
185
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
186
|
+
# grid = doc.grid
|
187
|
+
# grid.major_spacing = 1.25
|
188
|
+
#
|
189
|
+
# @param [Integer] divisions
|
190
|
+
# The number of minor divisions for the
|
191
|
+
# {Layout::Grid}
|
192
|
+
#
|
193
|
+
# @raise [ArgumentError] if divisions is negative
|
194
|
+
#
|
195
|
+
# @version LayOut 2020.1
|
196
|
+
def minor_divisions=(divisions)
|
197
|
+
end
|
198
|
+
|
199
|
+
# The {#print=} method sets whether or not the {Layout::Grid} is
|
200
|
+
# printed.
|
201
|
+
#
|
202
|
+
# @example
|
203
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
204
|
+
# grid = doc.grid
|
205
|
+
# grid.print = false
|
206
|
+
#
|
207
|
+
# @param [Boolean] print
|
208
|
+
#
|
209
|
+
# @version LayOut 2020.1
|
210
|
+
def print=(print)
|
211
|
+
end
|
212
|
+
|
67
213
|
# The {#print?} method returns whether or not the {Layout::Grid} is
|
68
214
|
# printed.
|
69
215
|
#
|
@@ -78,6 +224,20 @@ class Layout::Grid
|
|
78
224
|
def print?
|
79
225
|
end
|
80
226
|
|
227
|
+
# The {#show=} method sets whether or not the {Layout::Grid} is
|
228
|
+
# visible.
|
229
|
+
#
|
230
|
+
# @example
|
231
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
232
|
+
# grid = doc.grid
|
233
|
+
# grid.show = true
|
234
|
+
#
|
235
|
+
# @param [Boolean] show
|
236
|
+
#
|
237
|
+
# @version LayOut 2020.1
|
238
|
+
def show=(show)
|
239
|
+
end
|
240
|
+
|
81
241
|
# The {#show?} method returns whether or not the {Layout::Grid} is
|
82
242
|
# visible.
|
83
243
|
#
|
@@ -92,6 +252,20 @@ class Layout::Grid
|
|
92
252
|
def show?
|
93
253
|
end
|
94
254
|
|
255
|
+
# The {#show_major=} method sets whether or not the major grid lines are
|
256
|
+
# visible.
|
257
|
+
#
|
258
|
+
# @example
|
259
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
260
|
+
# grid = doc.grid
|
261
|
+
# grid.show_major = true
|
262
|
+
#
|
263
|
+
# @param [Boolean] show
|
264
|
+
#
|
265
|
+
# @version LayOut 2020.1
|
266
|
+
def show_major=(show)
|
267
|
+
end
|
268
|
+
|
95
269
|
# The {#show_major?} method returns whether or not the major grid lines are
|
96
270
|
# visible.
|
97
271
|
#
|
@@ -106,6 +280,20 @@ class Layout::Grid
|
|
106
280
|
def show_major?
|
107
281
|
end
|
108
282
|
|
283
|
+
# The {#show_minor=} method sets whether or not the minor grid lines are
|
284
|
+
# visible.
|
285
|
+
#
|
286
|
+
# @example
|
287
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
288
|
+
# grid = doc.grid
|
289
|
+
# grid.show_minor = false
|
290
|
+
#
|
291
|
+
# @param [Boolean] show
|
292
|
+
#
|
293
|
+
# @version LayOut 2020.1
|
294
|
+
def show_minor=(show)
|
295
|
+
end
|
296
|
+
|
109
297
|
# The {#show_minor?} method returns whether or not the minor grid lines are
|
110
298
|
# visible.
|
111
299
|
#
|
@@ -32,7 +32,9 @@ class Layout::Image < Layout::Entity
|
|
32
32
|
def clip_mask
|
33
33
|
end
|
34
34
|
|
35
|
-
# The {#clip_mask=} method sets the clip mask of the {Layout::Image}.
|
35
|
+
# The {#clip_mask=} method sets the clip mask of the {Layout::Image}. clip_mask
|
36
|
+
# can be a {Layout::Rectangle}, {Layout::Ellipse}, or {Layout::Path}, or +nil+,
|
37
|
+
# and it must not currently exist in a {Layout::Document}, or {Layout::Group}.
|
36
38
|
#
|
37
39
|
# @example
|
38
40
|
# image = Layout::Image.new("my_image.png", [[1, 1], [3, 3]])
|
@@ -42,11 +44,14 @@ class Layout::Image < Layout::Entity
|
|
42
44
|
# clip_mask = Layout::Rectangle.new(bounds)
|
43
45
|
# image.clip_mask = clip_mask
|
44
46
|
#
|
45
|
-
# @
|
47
|
+
# @note +clip_mask+ may be +nil+ as of LayOut 2020.1.
|
48
|
+
#
|
49
|
+
# @param [Layout::Entity, nil] clip_mask
|
46
50
|
# The clip mask can be a {Layout::Path},
|
47
51
|
# {Layout::Rectangle}, {Layout::Ellipse}, or +nil+.
|
48
52
|
#
|
49
|
-
# @raise [ArgumentError] if clip mask is already in a
|
53
|
+
# @raise [ArgumentError] if clip mask is already in a {Layout::Document} or
|
54
|
+
# {Layout::Group}
|
50
55
|
#
|
51
56
|
# @raise [ArgumentError] if clip mask is not a {Layout::Path},
|
52
57
|
# {Layout::Rectangle}, or {Layout::Ellipse}
|
@@ -532,6 +532,10 @@ class Layout::LinearDimension < Layout::Entity
|
|
532
532
|
# dim = Layout::LinearDimension.new(start_point, end_point, height)
|
533
533
|
# text = dim.text
|
534
534
|
#
|
535
|
+
# @note With the addition of auto-text in dimensions for LayOut 2019.2, the
|
536
|
+
# copy of the dimension text incorrectly provided the plain text when
|
537
|
+
# requesting the display text. This has been fixed for LayOut 2020.1.
|
538
|
+
#
|
535
539
|
# @return [Layout::FormattedText]
|
536
540
|
#
|
537
541
|
# @version LayOut 2018
|
@@ -44,6 +44,20 @@ class Layout::SketchUpModel < Layout::Entity
|
|
44
44
|
|
45
45
|
# Instance Methods
|
46
46
|
|
47
|
+
# The {#camera_modified?} method returns whether the camera of the
|
48
|
+
# {Layout::SketchUpModel} has been modified.
|
49
|
+
#
|
50
|
+
# @example
|
51
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
52
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
53
|
+
# modified = model.camera_modified?
|
54
|
+
#
|
55
|
+
# @return [Boolean]
|
56
|
+
#
|
57
|
+
# @version LayOut 2020.1
|
58
|
+
def camera_modified?
|
59
|
+
end
|
60
|
+
|
47
61
|
# The {#clip_mask} method returns the clip mask entity for the
|
48
62
|
# {Layout::SketchUpModel}, or +nil+ if it does not have one. clip_mask can be a
|
49
63
|
# {Layout::Rectangle}, {Layout::Ellipse}, or {Layout::Path}.
|
@@ -61,7 +75,8 @@ class Layout::SketchUpModel < Layout::Entity
|
|
61
75
|
|
62
76
|
# The {#clip_mask=} method sets a clip mask for the {Layout::SketchUpModel}.
|
63
77
|
# clip_mask can be a {Layout::Rectangle}, {Layout::Ellipse}, or {Layout::Path},
|
64
|
-
# and it must not currently exist in a {Layout::Document}
|
78
|
+
# or +nil+, and it must not currently exist in a {Layout::Document},
|
79
|
+
# or {Layout::Group}.
|
65
80
|
#
|
66
81
|
# @example
|
67
82
|
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
@@ -69,9 +84,14 @@ class Layout::SketchUpModel < Layout::Entity
|
|
69
84
|
# rect = Layout::Rectangle.new([[2, 2], [3, 3]]);
|
70
85
|
# model.clip_mask = rect
|
71
86
|
#
|
72
|
-
# @
|
87
|
+
# @note +clip_mask+ may be +nil+ as of LayOut 2020.1.
|
73
88
|
#
|
74
|
-
# @
|
89
|
+
# @param [Layout::Entity, nil] clip_mask
|
90
|
+
# The clip mask can be a {Layout::Path},
|
91
|
+
# {Layout::Rectangle}, {Layout::Ellipse}, or +nil+.
|
92
|
+
#
|
93
|
+
# @raise [ArgumentError] if clip_mask is already in a {Layout::Document} or
|
94
|
+
# {Layout::Group}
|
75
95
|
#
|
76
96
|
# @raise [ArgumentError] if clip_mask is not a {Layout::Rectangle},
|
77
97
|
# {Layout::Ellipse}, or {Layout::Path}
|
@@ -210,6 +230,20 @@ class Layout::SketchUpModel < Layout::Entity
|
|
210
230
|
def display_background?
|
211
231
|
end
|
212
232
|
|
233
|
+
# The {#effects_modified?} method returns whether the shadow or fog settings
|
234
|
+
# of the {Layout::SketchUpModel} have been modified.
|
235
|
+
#
|
236
|
+
# @example
|
237
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
238
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
239
|
+
# modified = model.effects_modified?
|
240
|
+
#
|
241
|
+
# @return [Boolean]
|
242
|
+
#
|
243
|
+
# @version LayOut 2020.1
|
244
|
+
def effects_modified?
|
245
|
+
end
|
246
|
+
|
213
247
|
# The {#entities} method returns the {Layout::Group} that represents the
|
214
248
|
# {Layout::SketchUpModel} in its exploded form. The {Layout::Group} will
|
215
249
|
# contain a {Layout::Image} for raster and hybrid-rendered models, and
|
@@ -248,6 +282,25 @@ class Layout::SketchUpModel < Layout::Entity
|
|
248
282
|
def initialize(path, bounds)
|
249
283
|
end
|
250
284
|
|
285
|
+
# The {#layers_modified?} method returns whether the layers of the
|
286
|
+
# {Layout::SketchUpModel} has been modified.
|
287
|
+
#
|
288
|
+
#
|
289
|
+
# @note: In SketchUp 2020, SketchUp "layers" were renamed to "tags". For
|
290
|
+
# consistency with the SketchUp API, this will continue to refer to
|
291
|
+
# "tags" as "layers".
|
292
|
+
#
|
293
|
+
# @example
|
294
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
295
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
296
|
+
# modified = model.layers_modified?
|
297
|
+
#
|
298
|
+
# @return [Boolean]
|
299
|
+
#
|
300
|
+
# @version LayOut 2020.1
|
301
|
+
def layers_modified?
|
302
|
+
end
|
303
|
+
|
251
304
|
# The {#line_weight} method returns the line weight for the
|
252
305
|
# {Layout::SketchUpModel}.
|
253
306
|
#
|
@@ -366,7 +419,10 @@ class Layout::SketchUpModel < Layout::Entity
|
|
366
419
|
def preserve_scale_on_resize?
|
367
420
|
end
|
368
421
|
|
369
|
-
# The {#render} method renders the {Layout::SketchUpModel}.
|
422
|
+
# The {#render} method renders the {Layout::SketchUpModel}. If the model
|
423
|
+
# belongs to a {Layout::Document}, then the render will be performed at the
|
424
|
+
# quality set in document.page_info (see {Layout::Document} and
|
425
|
+
# {Layout::PageInfo}). Otherwise, the render will be performed at Low quality.
|
370
426
|
#
|
371
427
|
# @example
|
372
428
|
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
@@ -441,6 +497,79 @@ class Layout::SketchUpModel < Layout::Entity
|
|
441
497
|
def render_needed?
|
442
498
|
end
|
443
499
|
|
500
|
+
# The {#reset_camera} method resets the {Layout::SketchUpModel}'s camera to
|
501
|
+
# the scene's setting.
|
502
|
+
#
|
503
|
+
# @example
|
504
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
505
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
506
|
+
# model.reset_camera if model.camera_modified?
|
507
|
+
#
|
508
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
509
|
+
# {Layout::Layer}
|
510
|
+
#
|
511
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
512
|
+
#
|
513
|
+
# @version LayOut 2020.1
|
514
|
+
def reset_camera
|
515
|
+
end
|
516
|
+
|
517
|
+
# The {#reset_effects} method resets the {Layout::SketchUpModel}'s shadow and
|
518
|
+
# fog settings to the scene's settings.
|
519
|
+
#
|
520
|
+
# @example
|
521
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
522
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
523
|
+
# model.reset_effects if model.effects_modified?
|
524
|
+
#
|
525
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
526
|
+
# {Layout::Layer}
|
527
|
+
#
|
528
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
529
|
+
#
|
530
|
+
# @version LayOut 2020.1
|
531
|
+
def reset_effects
|
532
|
+
end
|
533
|
+
|
534
|
+
# The {#reset_layers} method resets the {Layout::SketchUpModel}'s layers to
|
535
|
+
# the scene's setting.
|
536
|
+
#
|
537
|
+
#
|
538
|
+
# @note: In SketchUp 2020, SketchUp "layers" were renamed to "tags". For
|
539
|
+
# consistency with the SketchUp API, this will continue to refer to
|
540
|
+
# "tags" as "layers".
|
541
|
+
#
|
542
|
+
# @example
|
543
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
544
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
545
|
+
# model.reset_layers if model.layers_modified?
|
546
|
+
#
|
547
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
548
|
+
# {Layout::Layer}
|
549
|
+
#
|
550
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
551
|
+
#
|
552
|
+
# @version LayOut 2020.1
|
553
|
+
def reset_layers
|
554
|
+
end
|
555
|
+
|
556
|
+
# The {#reset_style} method resets the {Layout::SketchUpModel}'s style to
|
557
|
+
# the scene's setting.
|
558
|
+
#
|
559
|
+
# @example
|
560
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
561
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
562
|
+
# model.reset_style if model.style_modified?
|
563
|
+
#
|
564
|
+
# @raise [LockedLayerError] if the {Layout::SketchUpModel} is on a locked
|
565
|
+
# {Layout::Layer}
|
566
|
+
#
|
567
|
+
# @raise [LockedEntityError] if the {Layout::SketchUpModel} is locked
|
568
|
+
#
|
569
|
+
# @version LayOut 2020.1
|
570
|
+
def reset_style
|
571
|
+
end
|
572
|
+
|
444
573
|
# The {#scale} method returns the scale of the {Layout::SketchUpModel}.
|
445
574
|
#
|
446
575
|
# @example
|
@@ -492,6 +621,20 @@ class Layout::SketchUpModel < Layout::Entity
|
|
492
621
|
def scenes
|
493
622
|
end
|
494
623
|
|
624
|
+
# The {#style_modified?} method returns whether the style of the
|
625
|
+
# {Layout::SketchUpModel} has been modified.
|
626
|
+
#
|
627
|
+
# @example
|
628
|
+
# bounds = Geom::Bounds2d.new(1, 1, 3, 3)
|
629
|
+
# model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds)
|
630
|
+
# modified = model.style_modified?
|
631
|
+
#
|
632
|
+
# @return [Boolean]
|
633
|
+
#
|
634
|
+
# @version LayOut 2020.1
|
635
|
+
def style_modified?
|
636
|
+
end
|
637
|
+
|
495
638
|
# The {#view} method returns the standard view of the {Layout::SketchUpModel}.
|
496
639
|
#
|
497
640
|
# The standard view can be one of the following values:
|
@@ -1094,4 +1094,26 @@ class Sketchup::Entities
|
|
1094
1094
|
def transform_entities(transform, entities)
|
1095
1095
|
end
|
1096
1096
|
|
1097
|
+
# The {#weld} method takes a set of edges and find all possible chains of edges
|
1098
|
+
# and connect them with a {Sketchup::Curve}.
|
1099
|
+
#
|
1100
|
+
# A curve will not cross another curve. They will split where multiple curves
|
1101
|
+
# meet.
|
1102
|
+
#
|
1103
|
+
# @example
|
1104
|
+
# entities = Sketchup.active_model.entities
|
1105
|
+
# edges = model.selection.grep(Sketchup::Edge)
|
1106
|
+
# curves = entities.weld(edges)
|
1107
|
+
#
|
1108
|
+
# @param [Array<Sketchup::Edge>] edges
|
1109
|
+
#
|
1110
|
+
# @raise [ArgumentError] if the given entities are not part of the same
|
1111
|
+
# {Sketchup::Entities} collection.
|
1112
|
+
#
|
1113
|
+
# @return [Array<Sketchup::Curve>]
|
1114
|
+
#
|
1115
|
+
# @version SketchUp 2020.1
|
1116
|
+
def weld(edges)
|
1117
|
+
end
|
1118
|
+
|
1097
1119
|
end
|
@@ -344,6 +344,10 @@ class Sketchup::Entity
|
|
344
344
|
#
|
345
345
|
# The persistent id persistent between sessions.
|
346
346
|
#
|
347
|
+
# [SketchUp 2020.1]
|
348
|
+
# - {Sketchup::ComponentDefinition}
|
349
|
+
# - {Sketchup::Material}
|
350
|
+
# - {Sketchup::Style}
|
347
351
|
# [SketchUp 2020.0]
|
348
352
|
# - {Sketchup::Layer}
|
349
353
|
# - {Sketchup::LineStyle}
|
@@ -374,9 +374,11 @@ class Sketchup::Page < Sketchup::Entity
|
|
374
374
|
# - 2 - Drawing Style,
|
375
375
|
# - 4 - Shadow Settings,
|
376
376
|
# - 8 - Axes Location,
|
377
|
-
# - 16 - Hidden Geometry,
|
377
|
+
# - 16 - Hidden Geometry & Objects,
|
378
378
|
# - 32 - Visible Layers,
|
379
|
-
# - 64 - Active Section Planes
|
379
|
+
# - 64 - Active Section Planes,
|
380
|
+
# - 128 - Hidden Geometry,
|
381
|
+
# - 256 - Hidden Objects
|
380
382
|
#
|
381
383
|
# The bit code values are added together to provide the flags value. For
|
382
384
|
# example, to update the Camera Location, Axes Location, and Active Section
|
@@ -476,11 +478,14 @@ class Sketchup::Page < Sketchup::Entity
|
|
476
478
|
|
477
479
|
# The use_hidden= method sets the page's hidden property.
|
478
480
|
#
|
481
|
+
# @deprecated The functionality is replaced by {use_hidden_geometry=}
|
482
|
+
# and {use_hidden_objects=} in SketchUp 2020.1.
|
483
|
+
#
|
479
484
|
# @example
|
480
485
|
# model = Sketchup.active_model
|
481
486
|
# pages = model.pages
|
482
487
|
# page = pages.add "My Page"
|
483
|
-
# status = page.use_hidden=false
|
488
|
+
# status = page.use_hidden = false
|
484
489
|
#
|
485
490
|
# @param setting
|
486
491
|
# true if you want your page to save this property, false
|
@@ -489,6 +494,10 @@ class Sketchup::Page < Sketchup::Entity
|
|
489
494
|
# @return status - true if you are saving the property, false if
|
490
495
|
# you are not saving the property.
|
491
496
|
#
|
497
|
+
# @see #use_hidden_geometry=
|
498
|
+
#
|
499
|
+
# @see #use_hidden_objects=
|
500
|
+
#
|
492
501
|
# @version SketchUp 6.0
|
493
502
|
def use_hidden=(setting)
|
494
503
|
end
|
@@ -496,20 +505,57 @@ class Sketchup::Page < Sketchup::Entity
|
|
496
505
|
# The use_hidden? method determines whether you are storing the hidden
|
497
506
|
# property with the page.
|
498
507
|
#
|
508
|
+
# @deprecated The functionality is replaced by {use_hidden_geometry?}
|
509
|
+
# and {use_hidden_objects?} in SketchUp 2020.1.
|
510
|
+
#
|
499
511
|
# @example
|
500
512
|
# model = Sketchup.active_model
|
501
513
|
# pages = model.pages
|
502
|
-
# page = pages.add
|
514
|
+
# page = pages.add("My Page")
|
503
515
|
# status = page.use_hidden?
|
504
516
|
#
|
505
517
|
# @return [Boolean] status - true if you are storing the this property with
|
506
518
|
# the page, false if you are not storing this property
|
507
519
|
# with the page.
|
508
520
|
#
|
521
|
+
# @see #use_hidden_geometry?
|
522
|
+
#
|
523
|
+
# @see #use_hidden_objects?
|
524
|
+
#
|
509
525
|
# @version SketchUp 6.0
|
510
526
|
def use_hidden?
|
511
527
|
end
|
512
528
|
|
529
|
+
# Sets the page's use hidden geometry property.
|
530
|
+
#
|
531
|
+
# @example
|
532
|
+
# model = Sketchup.active_model
|
533
|
+
# pages = model.pages
|
534
|
+
# page = pages.add("My Page")
|
535
|
+
# status = page.use_hidden_geometry = false
|
536
|
+
#
|
537
|
+
# @param [Boolean] setting
|
538
|
+
# `true` if you want your page to save this property,
|
539
|
+
# `false` if you do not want your page to save this property.
|
540
|
+
#
|
541
|
+
# @version SketchUp 2020.1
|
542
|
+
def use_hidden_geometry=(setting)
|
543
|
+
end
|
544
|
+
|
545
|
+
# Returns the use hidden geometry property from the page.
|
546
|
+
#
|
547
|
+
# @example
|
548
|
+
# model = Sketchup.active_model
|
549
|
+
# pages = model.pages
|
550
|
+
# page = pages.add("My Page")
|
551
|
+
# status = page.use_hidden_geometry?
|
552
|
+
#
|
553
|
+
# @return [Boolean]
|
554
|
+
#
|
555
|
+
# @version SketchUp 2020.1
|
556
|
+
def use_hidden_geometry?
|
557
|
+
end
|
558
|
+
|
513
559
|
# The use_hidden_layers= method sets the page's hidden layers
|
514
560
|
# property.
|
515
561
|
#
|
@@ -547,6 +593,36 @@ class Sketchup::Page < Sketchup::Entity
|
|
547
593
|
def use_hidden_layers?
|
548
594
|
end
|
549
595
|
|
596
|
+
# Sets the page's use hidden objects property.
|
597
|
+
#
|
598
|
+
# @example
|
599
|
+
# model = Sketchup.active_model
|
600
|
+
# pages = model.pages
|
601
|
+
# page = pages.add("My Page")
|
602
|
+
# status = page.use_hidden_objects = false
|
603
|
+
#
|
604
|
+
# @param [Boolean] setting
|
605
|
+
# `true` if you want your page to save this property,
|
606
|
+
# `false` if you do not want your page to save this property.
|
607
|
+
#
|
608
|
+
# @version SketchUp 2020.1
|
609
|
+
def use_hidden_objects=(setting)
|
610
|
+
end
|
611
|
+
|
612
|
+
# Returns the use hidden objects property from the page.
|
613
|
+
#
|
614
|
+
# @example
|
615
|
+
# model = Sketchup.active_model
|
616
|
+
# pages = model.pages
|
617
|
+
# page = pages.add("My Page")
|
618
|
+
# status = page.use_hidden_objects?
|
619
|
+
#
|
620
|
+
# @return [Boolean]
|
621
|
+
#
|
622
|
+
# @version SketchUp 2020.1
|
623
|
+
def use_hidden_objects?
|
624
|
+
end
|
625
|
+
|
550
626
|
# The use_rendering_optoins= method sets the page's display
|
551
627
|
# settings property.
|
552
628
|
#
|
@@ -498,14 +498,14 @@ class Sketchup::View
|
|
498
498
|
# IS_WIN = Sketchup.platform == :platform_win
|
499
499
|
#
|
500
500
|
# def draw(view)
|
501
|
-
# draw_text(view, "Hello World", size: 20)
|
501
|
+
# draw_text(view, [100, 200, 0], "Hello World", size: 20)
|
502
502
|
# end
|
503
503
|
#
|
504
504
|
# private
|
505
505
|
#
|
506
506
|
# # This will ensure text is drawn with consistent size across platforms,
|
507
507
|
# # using pixels as size units.
|
508
|
-
# def draw_text(view, text, **options)
|
508
|
+
# def draw_text(view, position, text, **options)
|
509
509
|
# native_options = options.dup
|
510
510
|
# if IS_WIN && options.key?(:size)
|
511
511
|
# native_options[:size] = pixels_to_points(size)
|
@@ -147,6 +147,8 @@
|
|
147
147
|
PAGE_USE_ALL = nil # Stub value.
|
148
148
|
PAGE_USE_CAMERA = nil # Stub value.
|
149
149
|
PAGE_USE_HIDDEN = nil # Stub value.
|
150
|
+
PAGE_USE_HIDDEN_GEOMETRY = nil # Stub value.
|
151
|
+
PAGE_USE_HIDDEN_OBJECTS = nil # Stub value.
|
150
152
|
PAGE_USE_LAYER_VISIBILITY = nil # Stub value.
|
151
153
|
PAGE_USE_RENDERING_OPTIONS = nil # Stub value.
|
152
154
|
PAGE_USE_SECTION_PLANES = nil # Stub value.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sketchup-api-stubs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Trimble Inc, SketchUp Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -203,7 +203,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
- !ruby/object:Gem::Version
|
204
204
|
version: '0'
|
205
205
|
requirements: []
|
206
|
-
|
206
|
+
rubyforge_project:
|
207
|
+
rubygems_version: 2.6.14
|
207
208
|
signing_key:
|
208
209
|
specification_version: 4
|
209
210
|
summary: SketchUp Ruby API stubs.
|