Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/rake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-12, windows-2022 ]
ruby: [ 2.7 ]
os: [ macos-latest, windows-latest ]
ruby: [ 3.2 ]

steps:
- name: Checkout source
Expand All @@ -45,4 +45,4 @@ jobs:

- name: Run rake
timeout-minutes: 10
run: bundle exec rake
run: bundle exec rake
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

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.

<p>
Get started with the <a href="_index.html">Ruby API Overview</a>.
</p>
All interactions with the SketchUp Ruby API must be performed from the main thread to avoid unexpected behavior and application instability.

Get started with the [Ruby API Overview](_index.html).

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

Expand Down
6 changes: 6 additions & 0 deletions lib/sketchup-api-stubs/sketchup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
require 'sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb'
require 'sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb'
require 'sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb'
require 'sketchup-api-stubs/stubs/Layout/Dictionary.rb'
require 'sketchup-api-stubs/stubs/Layout/Document.rb'
require 'sketchup-api-stubs/stubs/Layout/Ellipse.rb'
require 'sketchup-api-stubs/stubs/Layout/Entities.rb'
Expand Down Expand Up @@ -82,6 +83,9 @@
require 'sketchup-api-stubs/stubs/Sketchup/Entities.rb'
require 'sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb'
require 'sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Environment.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Environments.rb'
require 'sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb'
require 'sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Face.rb'
require 'sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb'
Expand All @@ -103,6 +107,7 @@
require 'sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb'
require 'sketchup-api-stubs/stubs/Sketchup/LineStyle.rb'
require 'sketchup-api-stubs/stubs/Sketchup/LineStyles.rb'
require 'sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Loop.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Material.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Materials.rb'
Expand All @@ -129,6 +134,7 @@
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb'
require 'sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Skp.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Snap.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Style.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Styles.rb'
require 'sketchup-api-stubs/stubs/Sketchup/Text.rb'
Expand Down
2 changes: 1 addition & 1 deletion lib/sketchup-api-stubs/stubs/Array.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright:: Copyright 2024 Trimble Inc.
# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)

# The SketchUp Array class adds additional methods to the standard Ruby Array
Expand Down
12 changes: 6 additions & 6 deletions lib/sketchup-api-stubs/stubs/Geom.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright:: Copyright 2024 Trimble Inc.
# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)

# The Geom module defines a number of Module methods that let you perform
Expand Down Expand Up @@ -73,12 +73,12 @@ def self.closest_points(line1, line2)
# @param [Geom::Point3d] point1
# @param [Geom::Point3d] point2
# @param [Geom::Point3d] point3
# @return [Array(Geom::Point3d, Geom::Vector3d)] A plane
# @return [Array(Float, Float, Float, Float)] A plane
#
# @overload fit_plane_to_points(points)
#
# @param [Array<Geom::Point3d>] points
# @return [Array(Geom::Point3d, Geom::Vector3d)] A plane
# @return [Array(Float, Float, Float, Float)] A plane
#
# @version SketchUp 6.0
def self.fit_plane_to_points(*args)
Expand Down Expand Up @@ -125,7 +125,7 @@ def self.intersect_line_line(line1, line2)
#
# @param [Array(Geom::Point3d, Geom::Vector3d)] line
#
# @param [Array(Geom::Point3d, Geom::Point3d)] plane
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane
#
# @return [Geom::Point3d, nil] A Point3d object. Returns +nil+ if they do not
# intersect.
Expand All @@ -149,11 +149,11 @@ def self.intersect_line_plane(line, plane)
# # This will return a line [Point3d(10, 20, 0), Vector3d(0, 0, 1)].
# line = Geom.intersect_plane_plane(plane1, plane2)
#
# @param [Array(Geom::Point3d, Geom::Point3d)] plane1
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane1
# The first plane to
# intersect
#
# @param [Array(Geom::Point3d, Geom::Point3d)] plane2
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane2
# The second plane to
# intersect
#
Expand Down
4 changes: 2 additions & 2 deletions lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright:: Copyright 2024 Trimble Inc.
# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)

# Bounding boxes are three-dimensional boxes (eight corners), aligned with the
Expand Down Expand Up @@ -141,7 +141,7 @@ def contains?(point_or_bb)
# boundingbox.add([100, 200, -400], [200, 400, 100])
# # This will return Point3d(100, 200, -400).
# boundingbox.corner(0)
# # This will return Point3d(100, 200, -400).
# # This will return Point3d(100, 400, 100).
# boundingbox.corner(6)
#
# @param [Integer] corner_index
Expand Down
40 changes: 25 additions & 15 deletions lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright:: Copyright 2024 Trimble Inc.
# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)

# The bounds2d class represents an axis aligned bounding box represented by
Expand All @@ -14,7 +14,10 @@ class Geom::Bounds2d
# checks whether the point values are the same
#
# @example
# entity.bounds == entity.untransformed_bounds
# bounds1 = Geom::Bounds2d.new(0.0, 0.0, 5.0, 5.0)
# bounds2 = Geom::Bounds2d.new([0, 0], [5, 5])
# # Return true
# bounds1 == bounds2
#
# @param [Geom::Bounds2d] other
#
Expand All @@ -27,10 +30,10 @@ def ==(other)
# The {#height} method returns the height of the {Geom::Bounds2d}.
#
# @example
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
# bounds = Geom::Bounds2d.new(5.0, 5.0, 1.0, 7.0)
# height = bounds.height
#
# @return [Geom::Point2d]
# @return [Float]
#
# @version LayOut 2018
def height
Expand All @@ -39,7 +42,11 @@ def height
# The {#initialize} method creates a new {Geom::Bounds2d}.
#
# @example
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
# bounds1 = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
#
# upper_left = Geom::Point2d.new(1, 1) # is equivalent to upper_left = [1, 1]
# lower_right = Geom::Point2d.new(3, 3) # is equivalent to lower_right = [3, 3]
# bounds2 = Geom::Bounds2d.new(upper_left, lower_right)
#
# @overload initialize(other_bounds)
#
Expand Down Expand Up @@ -80,17 +87,19 @@ def initialize(*args)
# corner of the {Geom::Bounds2d}.
#
# @example
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
# l_r = bounds.lower_right
# bounds = Geom::Bounds2d.new(2.0, 2.0, 1.0, 1.0)
# # The result is a Point2d(3, 3)
# lower_right = bounds.lower_right
#
# @return [Geom::Point2d]
#
# @version LayOut 2018
def lower_right
end

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

# The {#to_a} method returns an array which contains the {Geom::Point2d} that
# The {#to_a} method returns an array which contains the {Geom::Point2d}s that
# define the {Geom::Bounds2d}.
#
# @example
# bounds = Geom::Bounds2d.new
# bounds = Geom::Bounds2d.new(2.0, 2.0, 5.0, 5.0)
# bounds.to_a.each { |point| p point.to_s }
#
# @return [Array(Geom::Point2d, Geom::Point2d)]
Expand All @@ -148,8 +157,9 @@ def to_a
# of the {Geom::Bounds2d}.
#
# @example
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
# u_l = bounds.upper_left
# bounds = Geom::Bounds2d.new(2.0, 2.0, 1.0, 1.0)
# # The result is a Point2d(2, 2)
# upper_left = bounds.upper_left
#
# @return [Geom::Point2d]
#
Expand All @@ -160,10 +170,10 @@ def upper_left
# The {#width} method returns the width of the {Geom::Bounds2d}.
#
# @example
# bounds = Geom::Bounds2d.new(0.0, 0.0, 1.0, 1.0)
# bounds = Geom::Bounds2d.new(5.0, 5.0, 7.0, 1.0)
# width = bounds.width
#
# @return [Geom::Point2d]
# @return [Float]
#
# @version LayOut 2018
def width
Expand Down
49 changes: 17 additions & 32 deletions lib/sketchup-api-stubs/stubs/Geom/LatLong.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright:: Copyright 2024 Trimble Inc.
# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)

# The LatLong class contains various methods for creating and manipulating
Expand All @@ -12,13 +12,13 @@ class Geom::LatLong
# The new method creates a LatLong object.
#
# @example
# ll = [40.01700, 105.28300]
# latlong = Geom::LatLong.new(ll)
# if (latlong)
# UI.messagebox(latlong)
# else
# UI.messagebox("Failure")
# end
# # No arguments, creates a latlong with (0, 0)
# latlong1 = Geom::LatLong.new
#
# latlong2 = Geom::LatLong.new(40.01700, 105.28300)
#
# array = [40.01700, 105.28300]
# latlong3 = Geom::LatLong.new(array)
#
# @overload initialize
#
Expand All @@ -36,8 +36,8 @@ class Geom::LatLong
#
# @overload initialize(lat, long)
#
# @param [Numeric] lat
# @param [Numeric] long
# @param [Numeric] latitude
# @param [Numeric] longitude
# @return [Geom::LatLong]
#
# @version SketchUp 6.0
Expand All @@ -47,14 +47,9 @@ def initialize(*args)
# The Latitude method retrieves the latitude coordinate from a LatLong object.
#
# @example
# ll = [40.01700, 105.28300]
# latlong = Geom::LatLong.new(ll)
# latlong = Geom::LatLong.new(40.01700, 105.28300)
# # The result is 40.01700
# latitude = latlong.latitude
# if (latitude)
# UI.messagebox(latitude)
# else
# UI.messagebox("Failure")
# end
#
# @return [Float] a latitude coordinate value
#
Expand All @@ -66,14 +61,9 @@ def latitude
# object.
#
# @example
# ll = [40.01700, 105.28300]
# latlong = Geom::LatLong.new(ll)
# latlong = Geom::LatLong.new(40.01700, 105.28300)
# # The result is 105.28300
# longitude = latlong.longitude
# if (longitude)
# UI.messagebox(longitude)
# else
# UI.messagebox("Failure")
# end
#
# @return [Float] a latitude coordinate value
#
Expand All @@ -84,7 +74,7 @@ def longitude
# The {#to_a} method converts a LatLong object to an array of two values.
#
# @example
# latlong = Geom::LatLong.new([40.01700, 105.28300])
# latlong = Geom::LatLong.new(40.01700, 105.28300)
# array = latlong.to_a
#
# @return [Array(Float, Float)] an array of latitude and longitude
Expand All @@ -108,14 +98,9 @@ def to_s
# The to_utm method converts a LatLong object to a UTM object.
#
# @example
# ll = [40.01700, 105.28300]
# latlong = Geom::LatLong.new(ll)
# latlong = Geom::LatLong.new(40.01700, 105.28300)
# # The result is UTM(48 T 524150.82056 4429682.40743)
# utm = latlong.to_utm
# if (utm)
# UI.messagebox(utm)
# else
# UI.messagebox("Failure")
# end
#
# @return [Geom::UTM]
#
Expand Down
2 changes: 1 addition & 1 deletion lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright:: Copyright 2024 Trimble Inc.
# Copyright:: Copyright 2026 Trimble Inc.
# License:: The MIT License (MIT)

# The OrientedBounds2d class is a bounding box represented by four
Expand Down
Loading