Skip to content

Commit 56d5ac3

Browse files
committed
Merge branch 'master' into staging
2 parents 1924dde + 02c5098 commit 56d5ac3

17 files changed

Lines changed: 564 additions & 35 deletions

File tree

.github/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SketchUp Ruby API Stubs
22

3-
[![Gem Version](https://badge.fury.io/rb/sketchup-api-stubs.svg)](https://badge.fury.io/rb/sketchup-api-stubs) [![Build status](https://ci.appveyor.com/api/projects/status/6l5tqoawh44lut66?svg=true)](https://ci.appveyor.com/project/thomthom/rubocop-sketchup)
3+
[![Gem Version](https://badge.fury.io/rb/sketchup-api-stubs.svg)](https://badge.fury.io/rb/sketchup-api-stubs) [![Build status](https://ci.appveyor.com/api/projects/status/6l5tqoawh44lut66/branch/master?svg=true)](https://ci.appveyor.com/project/thomthom/ruby-api-stubs/branch/master)
44

55
Auto-generated stubs for the SketchUp Ruby API. Useful for IDE intellisense and auto-complete.
66

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
33
gemspec
44

55
group :development do
6+
gem 'rake', '~> 12.0'
67
gem 'yard'
78
gem 'yard-sketchup'
89
end

lib/sketchup-api-stubs/stubs/Geom/Point2d.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Copyright:: Copyright 2020 Trimble Inc.
22
# License:: The MIT License (MIT)
33

4-
# The {Geom::Vector2d} class allows you to work with a point in 2D space.
5-
# {Geom::Point2d} is basically just a series of values representing x and y
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.
76
#
8-
# The values are specified as [x, y]. For example [1, 1].
9-
# To create a point call Geom::Point2d.new, where the creation method
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
109
# can take a variety of arguments:
1110
#
1211
# @example

lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Copyright:: Copyright 2020 Trimble Inc.
22
# License:: The MIT License (MIT)
33

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.
65
#
76
# There are numerous tutorials on 2D vectors available on the internet.
87
#

lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ def start_offset_point
536536
# dim = Layout::AngularDimension.new(start_point, end_point, start_extent, end_extent, inner_angle)
537537
# text = dim.text
538538
#
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+
#
539543
# @return [Layout::FormattedText]
540544
#
541545
# @version LayOut 2018

lib/sketchup-api-stubs/stubs/Layout/Document.rb

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,61 @@ def add_entity(*args)
143143
def auto_text_definitions
144144
end
145145

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+
146201
# The {#grid} method returns the {Layout::Grid} for a {Layout::Document}.
147202
#
148203
# @example

lib/sketchup-api-stubs/stubs/Layout/Grid.rb

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,62 @@ class Layout::Grid
88

99
# Instance Methods
1010

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+
1167
# The {#major_color} method returns the {Sketchup::Color} for the major grid
1268
# lines.
1369
#
@@ -22,6 +78,26 @@ class Layout::Grid
2278
def major_color
2379
end
2480

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+
25101
# The {#major_spacing} method returns the major space size of the
26102
# {Layout::Grid}.
27103
#
@@ -36,6 +112,24 @@ def major_color
36112
def major_spacing
37113
end
38114

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+
39133
# The {#minor_color} method returns the {Sketchup::Color} for the minor grid
40134
# lines.
41135
#
@@ -50,6 +144,26 @@ def major_spacing
50144
def minor_color
51145
end
52146

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+
53167
# The {#minor_divisions} method returns the number of minor divisions of the
54168
# {Layout::Grid}.
55169
#
@@ -64,6 +178,38 @@ def minor_color
64178
def minor_divisions
65179
end
66180

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+
67213
# The {#print?} method returns whether or not the {Layout::Grid} is
68214
# printed.
69215
#
@@ -78,6 +224,20 @@ def minor_divisions
78224
def print?
79225
end
80226

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+
81241
# The {#show?} method returns whether or not the {Layout::Grid} is
82242
# visible.
83243
#
@@ -92,6 +252,20 @@ def print?
92252
def show?
93253
end
94254

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+
95269
# The {#show_major?} method returns whether or not the major grid lines are
96270
# visible.
97271
#
@@ -106,6 +280,20 @@ def show?
106280
def show_major?
107281
end
108282

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+
109297
# The {#show_minor?} method returns whether or not the minor grid lines are
110298
# visible.
111299
#

lib/sketchup-api-stubs/stubs/Layout/Image.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ class Layout::Image < Layout::Entity
3232
def clip_mask
3333
end
3434

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}.
3638
#
3739
# @example
3840
# image = Layout::Image.new("my_image.png", [[1, 1], [3, 3]])
@@ -42,11 +44,14 @@ def clip_mask
4244
# clip_mask = Layout::Rectangle.new(bounds)
4345
# image.clip_mask = clip_mask
4446
#
45-
# @param [Layout::Entity] clip_mask
47+
# @note +clip_mask+ may be +nil+ as of LayOut 2020.1.
48+
#
49+
# @param [Layout::Entity, nil] clip_mask
4650
# The clip mask can be a {Layout::Path},
4751
# {Layout::Rectangle}, {Layout::Ellipse}, or +nil+.
4852
#
49-
# @raise [ArgumentError] if clip mask is already in a document
53+
# @raise [ArgumentError] if clip mask is already in a {Layout::Document} or
54+
# {Layout::Group}
5055
#
5156
# @raise [ArgumentError] if clip mask is not a {Layout::Path},
5257
# {Layout::Rectangle}, or {Layout::Ellipse}

lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,10 @@ def start_offset_point
532532
# dim = Layout::LinearDimension.new(start_point, end_point, height)
533533
# text = dim.text
534534
#
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+
#
535539
# @return [Layout::FormattedText]
536540
#
537541
# @version LayOut 2018

0 commit comments

Comments
 (0)