Skip to content

Commit b3cba65

Browse files
authored
SketchUp 2025.0, SketchUp 2026.0 and SketchUp 2026.1. (#87)
* SketchUp 2025.0 and SketchUp 2026.0. * Fix typo in one `@version` tag. * SketchUp 2026.1. * Update github action. * Remove Bundler dev dependency. * Bump version to 0.7.11.
1 parent 351f3a9 commit b3cba65

164 files changed

Lines changed: 5934 additions & 2208 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/rake.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
os: [ macos-12, windows-2022 ]
31-
ruby: [ 2.7 ]
30+
os: [ macos-latest, windows-latest ]
31+
ruby: [ 3.2 ]
3232

3333
steps:
3434
- name: Checkout source
@@ -45,4 +45,4 @@ jobs:
4545

4646
- name: Run rake
4747
timeout-minutes: 10
48-
run: bundle exec rake
48+
run: bundle exec rake

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
The SketchUp Ruby API allows you to interact with SketchUp models and the SketchUp application. It is available from within SketchUp, it cannot be used by itself.
66

7-
<p>
8-
Get started with the <a href="_index.html">Ruby API Overview</a>.
9-
</p>
7+
All interactions with the SketchUp Ruby API must be performed from the main thread to avoid unexpected behavior and application instability.
8+
9+
Get started with the [Ruby API Overview](_index.html).
1010

1111
Visit our [SketchUp Developer Center](https://developer.sketchup.com) for more information and resources on SketchUp's APIs.
1212

lib/sketchup-api-stubs/sketchup.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
require 'sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb'
2222
require 'sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb'
2323
require 'sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb'
24+
require 'sketchup-api-stubs/stubs/Layout/Dictionary.rb'
2425
require 'sketchup-api-stubs/stubs/Layout/Document.rb'
2526
require 'sketchup-api-stubs/stubs/Layout/Ellipse.rb'
2627
require 'sketchup-api-stubs/stubs/Layout/Entities.rb'
@@ -82,6 +83,9 @@
8283
require 'sketchup-api-stubs/stubs/Sketchup/Entities.rb'
8384
require 'sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb'
8485
require 'sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb'
86+
require 'sketchup-api-stubs/stubs/Sketchup/Environment.rb'
87+
require 'sketchup-api-stubs/stubs/Sketchup/Environments.rb'
88+
require 'sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb'
8589
require 'sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb'
8690
require 'sketchup-api-stubs/stubs/Sketchup/Face.rb'
8791
require 'sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb'
@@ -103,6 +107,7 @@
103107
require 'sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb'
104108
require 'sketchup-api-stubs/stubs/Sketchup/LineStyle.rb'
105109
require 'sketchup-api-stubs/stubs/Sketchup/LineStyles.rb'
110+
require 'sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb'
106111
require 'sketchup-api-stubs/stubs/Sketchup/Loop.rb'
107112
require 'sketchup-api-stubs/stubs/Sketchup/Material.rb'
108113
require 'sketchup-api-stubs/stubs/Sketchup/Materials.rb'
@@ -129,6 +134,7 @@
129134
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb'
130135
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb'
131136
require 'sketchup-api-stubs/stubs/Sketchup/Skp.rb'
137+
require 'sketchup-api-stubs/stubs/Sketchup/Snap.rb'
132138
require 'sketchup-api-stubs/stubs/Sketchup/Style.rb'
133139
require 'sketchup-api-stubs/stubs/Sketchup/Styles.rb'
134140
require 'sketchup-api-stubs/stubs/Sketchup/Text.rb'

lib/sketchup-api-stubs/stubs/Array.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright:: Copyright 2024 Trimble Inc.
1+
# Copyright:: Copyright 2026 Trimble Inc.
22
# License:: The MIT License (MIT)
33

44
# The SketchUp Array class adds additional methods to the standard Ruby Array

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

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

44
# The Geom module defines a number of Module methods that let you perform
@@ -73,12 +73,12 @@ def self.closest_points(line1, line2)
7373
# @param [Geom::Point3d] point1
7474
# @param [Geom::Point3d] point2
7575
# @param [Geom::Point3d] point3
76-
# @return [Array(Geom::Point3d, Geom::Vector3d)] A plane
76+
# @return [Array(Float, Float, Float, Float)] A plane
7777
#
7878
# @overload fit_plane_to_points(points)
7979
#
8080
# @param [Array<Geom::Point3d>] points
81-
# @return [Array(Geom::Point3d, Geom::Vector3d)] A plane
81+
# @return [Array(Float, Float, Float, Float)] A plane
8282
#
8383
# @version SketchUp 6.0
8484
def self.fit_plane_to_points(*args)
@@ -125,7 +125,7 @@ def self.intersect_line_line(line1, line2)
125125
#
126126
# @param [Array(Geom::Point3d, Geom::Vector3d)] line
127127
#
128-
# @param [Array(Geom::Point3d, Geom::Point3d)] plane
128+
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane
129129
#
130130
# @return [Geom::Point3d, nil] A Point3d object. Returns +nil+ if they do not
131131
# intersect.
@@ -149,11 +149,11 @@ def self.intersect_line_plane(line, plane)
149149
# # This will return a line [Point3d(10, 20, 0), Vector3d(0, 0, 1)].
150150
# line = Geom.intersect_plane_plane(plane1, plane2)
151151
#
152-
# @param [Array(Geom::Point3d, Geom::Point3d)] plane1
152+
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane1
153153
# The first plane to
154154
# intersect
155155
#
156-
# @param [Array(Geom::Point3d, Geom::Point3d)] plane2
156+
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane2
157157
# The second plane to
158158
# intersect
159159
#

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

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

44
# Bounding boxes are three-dimensional boxes (eight corners), aligned with the
@@ -141,7 +141,7 @@ def contains?(point_or_bb)
141141
# boundingbox.add([100, 200, -400], [200, 400, 100])
142142
# # This will return Point3d(100, 200, -400).
143143
# boundingbox.corner(0)
144-
# # This will return Point3d(100, 200, -400).
144+
# # This will return Point3d(100, 400, 100).
145145
# boundingbox.corner(6)
146146
#
147147
# @param [Integer] corner_index

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

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright:: Copyright 2024 Trimble Inc.
1+
# Copyright:: Copyright 2026 Trimble Inc.
22
# License:: The MIT License (MIT)
33

44
# The bounds2d class represents an axis aligned bounding box represented by
@@ -14,7 +14,10 @@ class Geom::Bounds2d
1414
# checks whether the point values are the same
1515
#
1616
# @example
17-
# entity.bounds == entity.untransformed_bounds
17+
# bounds1 = Geom::Bounds2d.new(0.0, 0.0, 5.0, 5.0)
18+
# bounds2 = Geom::Bounds2d.new([0, 0], [5, 5])
19+
# # Return true
20+
# bounds1 == bounds2
1821
#
1922
# @param [Geom::Bounds2d] other
2023
#
@@ -27,10 +30,10 @@ def ==(other)
2730
# The {#height} method returns the height of the {Geom::Bounds2d}.
2831
#
2932
# @example
30-
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
33+
# bounds = Geom::Bounds2d.new(5.0, 5.0, 1.0, 7.0)
3134
# height = bounds.height
3235
#
33-
# @return [Geom::Point2d]
36+
# @return [Float]
3437
#
3538
# @version LayOut 2018
3639
def height
@@ -39,7 +42,11 @@ def height
3942
# The {#initialize} method creates a new {Geom::Bounds2d}.
4043
#
4144
# @example
42-
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
45+
# bounds1 = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
46+
#
47+
# upper_left = Geom::Point2d.new(1, 1) # is equivalent to upper_left = [1, 1]
48+
# lower_right = Geom::Point2d.new(3, 3) # is equivalent to lower_right = [3, 3]
49+
# bounds2 = Geom::Bounds2d.new(upper_left, lower_right)
4350
#
4451
# @overload initialize(other_bounds)
4552
#
@@ -80,17 +87,19 @@ def initialize(*args)
8087
# corner of the {Geom::Bounds2d}.
8188
#
8289
# @example
83-
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
84-
# l_r = bounds.lower_right
90+
# bounds = Geom::Bounds2d.new(2.0, 2.0, 1.0, 1.0)
91+
# # The result is a Point2d(3, 3)
92+
# lower_right = bounds.lower_right
8593
#
8694
# @return [Geom::Point2d]
8795
#
8896
# @version LayOut 2018
8997
def lower_right
9098
end
9199

92-
# The {#set!} method sets the {Geom::Bounds2d} to match another one.
93-
# The argument is anything that can be converted into a {Geom::Bounds2d}.
100+
# The {#set!} method is used to update the dimensions and position of a {Geom::Bounds2d} object so
101+
# that it matches the specified bounds. The argument is anything that can be converted into a
102+
# {Geom::Bounds2d}.
94103
#
95104
# @example
96105
# bounds = Geom::Bounds2d.new(3.0, 3.0, 5.0, 5.0)
@@ -131,11 +140,11 @@ def lower_right
131140
def set!(*args)
132141
end
133142

134-
# The {#to_a} method returns an array which contains the {Geom::Point2d} that
143+
# The {#to_a} method returns an array which contains the {Geom::Point2d}s that
135144
# define the {Geom::Bounds2d}.
136145
#
137146
# @example
138-
# bounds = Geom::Bounds2d.new
147+
# bounds = Geom::Bounds2d.new(2.0, 2.0, 5.0, 5.0)
139148
# bounds.to_a.each { |point| p point.to_s }
140149
#
141150
# @return [Array(Geom::Point2d, Geom::Point2d)]
@@ -148,8 +157,9 @@ def to_a
148157
# of the {Geom::Bounds2d}.
149158
#
150159
# @example
151-
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
152-
# u_l = bounds.upper_left
160+
# bounds = Geom::Bounds2d.new(2.0, 2.0, 1.0, 1.0)
161+
# # The result is a Point2d(2, 2)
162+
# upper_left = bounds.upper_left
153163
#
154164
# @return [Geom::Point2d]
155165
#
@@ -160,10 +170,10 @@ def upper_left
160170
# The {#width} method returns the width of the {Geom::Bounds2d}.
161171
#
162172
# @example
163-
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
173+
# bounds = Geom::Bounds2d.new(5.0, 5.0, 7.0, 1.0)
164174
# width = bounds.width
165175
#
166-
# @return [Geom::Point2d]
176+
# @return [Float]
167177
#
168178
# @version LayOut 2018
169179
def width

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

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright:: Copyright 2024 Trimble Inc.
1+
# Copyright:: Copyright 2026 Trimble Inc.
22
# License:: The MIT License (MIT)
33

44
# The LatLong class contains various methods for creating and manipulating
@@ -12,13 +12,13 @@ class Geom::LatLong
1212
# The new method creates a LatLong object.
1313
#
1414
# @example
15-
# ll = [40.01700, 105.28300]
16-
# latlong = Geom::LatLong.new(ll)
17-
# if (latlong)
18-
# UI.messagebox(latlong)
19-
# else
20-
# UI.messagebox("Failure")
21-
# end
15+
# # No arguments, creates a latlong with (0, 0)
16+
# latlong1 = Geom::LatLong.new
17+
#
18+
# latlong2 = Geom::LatLong.new(40.01700, 105.28300)
19+
#
20+
# array = [40.01700, 105.28300]
21+
# latlong3 = Geom::LatLong.new(array)
2222
#
2323
# @overload initialize
2424
#
@@ -36,8 +36,8 @@ class Geom::LatLong
3636
#
3737
# @overload initialize(lat, long)
3838
#
39-
# @param [Numeric] lat
40-
# @param [Numeric] long
39+
# @param [Numeric] latitude
40+
# @param [Numeric] longitude
4141
# @return [Geom::LatLong]
4242
#
4343
# @version SketchUp 6.0
@@ -47,14 +47,9 @@ def initialize(*args)
4747
# The Latitude method retrieves the latitude coordinate from a LatLong object.
4848
#
4949
# @example
50-
# ll = [40.01700, 105.28300]
51-
# latlong = Geom::LatLong.new(ll)
50+
# latlong = Geom::LatLong.new(40.01700, 105.28300)
51+
# # The result is 40.01700
5252
# latitude = latlong.latitude
53-
# if (latitude)
54-
# UI.messagebox(latitude)
55-
# else
56-
# UI.messagebox("Failure")
57-
# end
5853
#
5954
# @return [Float] a latitude coordinate value
6055
#
@@ -66,14 +61,9 @@ def latitude
6661
# object.
6762
#
6863
# @example
69-
# ll = [40.01700, 105.28300]
70-
# latlong = Geom::LatLong.new(ll)
64+
# latlong = Geom::LatLong.new(40.01700, 105.28300)
65+
# # The result is 105.28300
7166
# longitude = latlong.longitude
72-
# if (longitude)
73-
# UI.messagebox(longitude)
74-
# else
75-
# UI.messagebox("Failure")
76-
# end
7767
#
7868
# @return [Float] a latitude coordinate value
7969
#
@@ -84,7 +74,7 @@ def longitude
8474
# The {#to_a} method converts a LatLong object to an array of two values.
8575
#
8676
# @example
87-
# latlong = Geom::LatLong.new([40.01700, 105.28300])
77+
# latlong = Geom::LatLong.new(40.01700, 105.28300)
8878
# array = latlong.to_a
8979
#
9080
# @return [Array(Float, Float)] an array of latitude and longitude
@@ -108,14 +98,9 @@ def to_s
10898
# The to_utm method converts a LatLong object to a UTM object.
10999
#
110100
# @example
111-
# ll = [40.01700, 105.28300]
112-
# latlong = Geom::LatLong.new(ll)
101+
# latlong = Geom::LatLong.new(40.01700, 105.28300)
102+
# # The result is UTM(48 T 524150.82056 4429682.40743)
113103
# utm = latlong.to_utm
114-
# if (utm)
115-
# UI.messagebox(utm)
116-
# else
117-
# UI.messagebox("Failure")
118-
# end
119104
#
120105
# @return [Geom::UTM]
121106
#

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright:: Copyright 2024 Trimble Inc.
1+
# Copyright:: Copyright 2026 Trimble Inc.
22
# License:: The MIT License (MIT)
33

44
# The OrientedBounds2d class is a bounding box represented by four

0 commit comments

Comments
 (0)