From 2bcf87b42e8197cc7f86637d316ea1327bf0672c Mon Sep 17 00:00:00 2001 From: Thomas Thomassen Date: Thu, 4 Apr 2024 16:48:46 +0200 Subject: [PATCH 1/2] SketchUp 2024.0. --- lib/sketchup-api-stubs/stubs/Array.rb | 2 +- lib/sketchup-api-stubs/stubs/Geom.rb | 2 +- .../stubs/Geom/BoundingBox.rb | 2 +- lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb | 2 +- lib/sketchup-api-stubs/stubs/Geom/LatLong.rb | 2 +- .../stubs/Geom/OrientedBounds2d.rb | 2 +- lib/sketchup-api-stubs/stubs/Geom/Point2d.rb | 2 +- lib/sketchup-api-stubs/stubs/Geom/Point3d.rb | 2 +- .../stubs/Geom/PolygonMesh.rb | 2 +- .../stubs/Geom/Transformation.rb | 2 +- .../stubs/Geom/Transformation2d.rb | 2 +- lib/sketchup-api-stubs/stubs/Geom/UTM.rb | 2 +- lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb | 2 +- lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb | 2 +- .../stubs/LanguageHandler.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout.rb | 2 +- .../stubs/Layout/AngularDimension.rb | 2 +- .../stubs/Layout/AutoTextDefinition.rb | 2 +- .../stubs/Layout/AutoTextDefinitions.rb | 2 +- .../stubs/Layout/ConnectionPoint.rb | 2 +- .../stubs/Layout/Document.rb | 58 +++++++- .../stubs/Layout/Ellipse.rb | 2 +- .../stubs/Layout/Entities.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Entity.rb | 5 +- .../stubs/Layout/FormattedText.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Grid.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Group.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Image.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Label.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Layer.rb | 2 +- .../stubs/Layout/LayerInstance.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Layers.rb | 2 +- .../stubs/Layout/LinearDimension.rb | 2 +- .../stubs/Layout/LockedEntityError.rb | 2 +- .../stubs/Layout/LockedLayerError.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Page.rb | 2 +- .../stubs/Layout/PageInfo.rb | 74 +++++++++- lib/sketchup-api-stubs/stubs/Layout/Pages.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Path.rb | 2 +- .../stubs/Layout/Rectangle.rb | 2 +- .../stubs/Layout/ReferenceEntity.rb | 2 +- .../stubs/Layout/SketchUpModel.rb | 24 +++- lib/sketchup-api-stubs/stubs/Layout/Style.rb | 2 +- lib/sketchup-api-stubs/stubs/Layout/Table.rb | 2 +- .../stubs/Layout/TableCell.rb | 2 +- .../stubs/Layout/TableColumn.rb | 2 +- .../stubs/Layout/TableRow.rb | 2 +- lib/sketchup-api-stubs/stubs/Length.rb | 2 +- lib/sketchup-api-stubs/stubs/Numeric.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup.rb | 25 +++- .../stubs/Sketchup/Animation.rb | 2 +- .../stubs/Sketchup/AppObserver.rb | 2 +- .../stubs/Sketchup/ArcCurve.rb | 19 ++- .../stubs/Sketchup/AttributeDictionaries.rb | 2 +- .../stubs/Sketchup/AttributeDictionary.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb | 2 +- .../stubs/Sketchup/Behavior.rb | 2 +- .../stubs/Sketchup/Camera.rb | 2 +- .../stubs/Sketchup/ClassificationSchema.rb | 2 +- .../stubs/Sketchup/Classifications.rb | 2 +- .../stubs/Sketchup/Color.rb | 2 +- .../stubs/Sketchup/ComponentDefinition.rb | 2 +- .../stubs/Sketchup/ComponentInstance.rb | 2 +- .../stubs/Sketchup/Console.rb | 2 +- .../stubs/Sketchup/ConstructionLine.rb | 2 +- .../stubs/Sketchup/ConstructionPoint.rb | 2 +- .../stubs/Sketchup/Curve.rb | 2 +- .../stubs/Sketchup/DefinitionList.rb | 2 +- .../stubs/Sketchup/DefinitionObserver.rb | 2 +- .../stubs/Sketchup/DefinitionsObserver.rb | 2 +- .../stubs/Sketchup/Dimension.rb | 2 +- .../stubs/Sketchup/DimensionLinear.rb | 2 +- .../stubs/Sketchup/DimensionObserver.rb | 2 +- .../stubs/Sketchup/DimensionRadial.rb | 2 +- .../stubs/Sketchup/Drawingelement.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb | 2 +- .../stubs/Sketchup/EdgeUse.rb | 2 +- .../stubs/Sketchup/Entities.rb | 5 +- .../stubs/Sketchup/EntitiesBuilder.rb | 2 +- .../stubs/Sketchup/EntitiesObserver.rb | 2 +- .../stubs/Sketchup/Entity.rb | 46 ++----- .../stubs/Sketchup/EntityObserver.rb | 2 +- .../stubs/Sketchup/ExtensionsManager.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Face.rb | 2 +- .../stubs/Sketchup/FrameChangeObserver.rb | 2 +- .../stubs/Sketchup/Group.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Http.rb | 2 +- .../stubs/Sketchup/Http/Request.rb | 2 +- .../stubs/Sketchup/Http/Response.rb | 2 +- .../stubs/Sketchup/Image.rb | 2 +- .../stubs/Sketchup/ImageRep.rb | 2 +- .../stubs/Sketchup/Importer.rb | 2 +- .../stubs/Sketchup/InputPoint.rb | 2 +- .../stubs/Sketchup/InstanceObserver.rb | 2 +- .../stubs/Sketchup/InstancePath.rb | 2 +- .../stubs/Sketchup/Layer.rb | 2 +- .../stubs/Sketchup/LayerFolder.rb | 2 +- .../stubs/Sketchup/Layers.rb | 2 +- .../stubs/Sketchup/LayersObserver.rb | 2 +- .../stubs/Sketchup/Licensing.rb | 2 +- .../Sketchup/Licensing/ExtensionLicense.rb | 2 +- .../stubs/Sketchup/LineStyle.rb | 2 +- .../stubs/Sketchup/LineStyles.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb | 2 +- .../stubs/Sketchup/Material.rb | 2 +- .../stubs/Sketchup/Materials.rb | 2 +- .../stubs/Sketchup/MaterialsObserver.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb | 2 +- .../stubs/Sketchup/Model.rb | 12 +- .../stubs/Sketchup/ModelObserver.rb | 2 +- .../stubs/Sketchup/OptionsManager.rb | 2 +- .../stubs/Sketchup/OptionsProvider.rb | 2 +- .../stubs/Sketchup/OptionsProviderObserver.rb | 2 +- .../stubs/Sketchup/Overlay.rb | 2 +- .../stubs/Sketchup/OverlaysManager.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Page.rb | 2 +- .../stubs/Sketchup/Pages.rb | 2 +- .../stubs/Sketchup/PagesObserver.rb | 2 +- .../stubs/Sketchup/PickHelper.rb | 10 +- .../stubs/Sketchup/RegionalSettings.rb | 2 +- .../stubs/Sketchup/RenderingOptions.rb | 14 +- .../Sketchup/RenderingOptionsObserver.rb | 2 +- .../stubs/Sketchup/SectionPlane.rb | 2 +- .../stubs/Sketchup/Selection.rb | 2 +- .../stubs/Sketchup/SelectionObserver.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Set.rb | 2 +- .../stubs/Sketchup/ShadowInfo.rb | 2 +- .../stubs/Sketchup/ShadowInfoObserver.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb | 2 +- .../stubs/Sketchup/Style.rb | 2 +- .../stubs/Sketchup/Styles.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Text.rb | 2 +- .../stubs/Sketchup/Texture.rb | 2 +- .../stubs/Sketchup/TextureWriter.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb | 2 +- .../stubs/Sketchup/Tools.rb | 2 +- .../stubs/Sketchup/ToolsObserver.rb | 2 +- .../stubs/Sketchup/UVHelper.rb | 2 +- .../stubs/Sketchup/Vertex.rb | 2 +- lib/sketchup-api-stubs/stubs/Sketchup/View.rb | 20 ++- .../stubs/Sketchup/ViewObserver.rb | 2 +- .../stubs/SketchupExtension.rb | 2 +- lib/sketchup-api-stubs/stubs/String.rb | 2 +- lib/sketchup-api-stubs/stubs/UI.rb | 97 +++++++++---- lib/sketchup-api-stubs/stubs/UI/Command.rb | 60 ++++----- lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb | 13 +- .../stubs/UI/Notification.rb | 2 +- lib/sketchup-api-stubs/stubs/UI/Toolbar.rb | 2 +- lib/sketchup-api-stubs/stubs/UI/WebDialog.rb | 34 +++-- lib/sketchup-api-stubs/stubs/_top_level.rb | 2 +- pages/ReleaseNotes.md | 66 ++++++++- pages/extension_requirements.md | 127 ++++++++++++++++++ 152 files changed, 707 insertions(+), 270 deletions(-) create mode 100644 pages/extension_requirements.md diff --git a/lib/sketchup-api-stubs/stubs/Array.rb b/lib/sketchup-api-stubs/stubs/Array.rb index c3b2010..f6a7736 100644 --- a/lib/sketchup-api-stubs/stubs/Array.rb +++ b/lib/sketchup-api-stubs/stubs/Array.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The SketchUp Array class adds additional methods to the standard Ruby Array diff --git a/lib/sketchup-api-stubs/stubs/Geom.rb b/lib/sketchup-api-stubs/stubs/Geom.rb index a5a4540..8db0774 100644 --- a/lib/sketchup-api-stubs/stubs/Geom.rb +++ b/lib/sketchup-api-stubs/stubs/Geom.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Geom module defines a number of Module methods that let you perform diff --git a/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb b/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb index b79a8fc..c68793b 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Bounding boxes are three-dimensional boxes (eight corners), aligned with the diff --git a/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb b/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb index 2232aa2..1374516 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The bounds2d class represents an axis aligned bounding box represented by diff --git a/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb b/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb index 54031e6..6e21c13 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The LatLong class contains various methods for creating and manipulating diff --git a/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb b/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb index 66c4948..66ac2b8 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The OrientedBounds2d class is a bounding box represented by four diff --git a/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb b/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb index bef83f5..b8103c4 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Geom::Point2d} class allows you to work with a point in 2D space. diff --git a/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb b/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb index 8475d37..e9eb0d7 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Point3d class allows you to work with a point in 3D space. diff --git a/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb b/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb index 2611e65..5762a59 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {#Geom::PolygonMesh} class contains methods to create polygon mesh diff --git a/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb b/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb index 1d4952e..f7299ec 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Transformations are a standard construct in the 3D world for representing diff --git a/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb b/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb index e3e1456..a60e094 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # diff --git a/lib/sketchup-api-stubs/stubs/Geom/UTM.rb b/lib/sketchup-api-stubs/stubs/Geom/UTM.rb index cecc00d..2590b25 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/UTM.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The UTM class lets you work with UTM map coordinates. diff --git a/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb b/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb index 7ffa502..1227e07 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Geom::Vector2d} class represents vectors in a 2 dimensional space. diff --git a/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb b/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb index 1f4cd8c..c2bb855 100644 --- a/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +++ b/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Vector3d class is used to represent vectors in a 3 dimensional space. diff --git a/lib/sketchup-api-stubs/stubs/LanguageHandler.rb b/lib/sketchup-api-stubs/stubs/LanguageHandler.rb index 5c88464..5a6eb26 100644 --- a/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +++ b/lib/sketchup-api-stubs/stubs/LanguageHandler.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The LanguageHandler class contains methods used to help make SketchUp diff --git a/lib/sketchup-api-stubs/stubs/Layout.rb b/lib/sketchup-api-stubs/stubs/Layout.rb index cceca15..5c8b161 100644 --- a/lib/sketchup-api-stubs/stubs/Layout.rb +++ b/lib/sketchup-api-stubs/stubs/Layout.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The LayOut module is the root of the LayOut Ruby API. Many of the classes in diff --git a/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb b/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb index b2bfa77..393924f 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # References an angular dimension entity. An {Layout::AngularDimension} is diff --git a/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb b/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb index a1f4767..c5f2e2c 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # References an auto-text definition. Some auto-text definitions are mandatory. diff --git a/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb b/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb index d545932..fdd6a2b 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The AutoTextDefinitions class is a container class for all diff --git a/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb b/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb index ad423fe..feabc2f 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is the interface to a LayOut Connection Point. A diff --git a/lib/sketchup-api-stubs/stubs/Layout/Document.rb b/lib/sketchup-api-stubs/stubs/Layout/Document.rb index 4732494..a786306 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Document.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Document.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is the interface to a LayOut document. A {Layout::Document} is the 2D @@ -164,7 +164,15 @@ def auto_text_definitions # # first page of a {Layout::Document} is index 0. # options = { start_page: 1, # end_page: 3, - # output_resolution: Layout::PageInfo::RESOLUTION_HIGH, + # compress_images: TRUE, + # compress_quality: 0.75 } + # + # status = doc.export("c:/my_export.pdf", options) + # + # # Export pages one and three through five. Note that page_range starts at + # # index 1. + # # `page_range` support added in LayOut 2024.0. + # options = { page_range: "1,3-5", # compress_images: TRUE, # compress_quality: 0.75 } # @@ -174,7 +182,7 @@ def auto_text_definitions # doc = Layout::Document.open("c:/path/to/document.layout") # # # Export png files on macOS, with default settings. - # status = doc.export('/Users/username/Desktop/pngs/page.png') + # status = doc.export("/Users//Desktop/pngs/page.png") # # # Export pages one through three at 300 dpi as JPGs. # options = { start_page: 1, @@ -182,6 +190,15 @@ def auto_text_definitions # dpi: 300 } # status = doc.export('c:/page.jpg', options) # + # # Export pages one and three through five. Note that page_range starts at + # # index 1. + # # `page_range` support added in LayOut 2024.0. + # options = { page_range: "1,3-5", + # compress_images: TRUE, + # compress_quality: 0.75 } + # + # status = doc.export("c:/my_export.png", options) + # # @param [String] file_path # The file or image set to create. The directory # path must already exist. The path must include the file extension. @@ -398,6 +415,41 @@ def precision=(precision) def remove_entity(entity) end + # The {#render_mode_override} method returns the override setting for output render modes + # of {Layout::SketchUpModel}s in the {Layout::Document}. + # + # @example + # doc = Layout::Document.open("C:/path/to/document.layout") + # render_mode = doc.render_mode_override + # + # @return [Integer] + # + # @version LayOut 2023.1 + def render_mode_override + end + + # The {#render_mode_override=} method sets the override setting for output render modes + # of {Layout::SketchUpModel}s in the {Layout::Document}. Setting this to +NO_OVERRIDE+ + # will prevent overriding the individual {Layout::SketchUpModel} render mode setting during + # export. This override will only affect raster rendered {Layout::SketchUpModel}s, if a + # viewport is set to vector or hybrid, it will retain that render mode as its output render + # mode. + # + # @example + # doc = Layout::Document.open("C:/path/to/document.layout") + # doc.render_mode_override = Layout::SketchUpModel::VECTOR_RENDER + # + # @param [Integer] render_mode + # +NO_OVERRIDE+, +VECTOR_RENDER+, or +HYBRID_RENDER+ + # + # @raise [ArgumentError] if render_mode is not a valid render mode + # + # @raise [ArgumentError] if render_mode is +RASTER_RENDER+ + # + # @version LayOut 2023.1 + def render_mode_override=(render_mode) + end + # The {#save} method saves the {Layout::Document} to a file at the given path. # Passing an empty path string will save the {Layout::Document} at its current # path. diff --git a/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb b/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb index beca4d9..5104eb1 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A simple elliptical shape entity. diff --git a/lib/sketchup-api-stubs/stubs/Layout/Entities.rb b/lib/sketchup-api-stubs/stubs/Layout/Entities.rb index b47d082..9bcdf18 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Entities.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Entities class is a container class for {Layout::Entity}s. A diff --git a/lib/sketchup-api-stubs/stubs/Layout/Entity.rb b/lib/sketchup-api-stubs/stubs/Layout/Entity.rb index baf1923..5ffad11 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Entity.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # An entity is an object shown on a page of a LayOut document. @@ -175,6 +175,9 @@ def move_to_group(group) # {Layout::Entity} must belong to the same {Layout::Document} as the the # {Layout::Layer} and the {Layout::Page}s. # + # @bug In LayOut versions prior to LayOut 2024.0 this method would fail to move + # entities from non-shared layers. + # # @example # doc = Layout::Document.open("C:/path/to/document.layout") # entities = doc.pages.first.entities diff --git a/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb b/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb index bc013b0..ec7e927 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A formatted text entity. diff --git a/lib/sketchup-api-stubs/stubs/Layout/Grid.rb b/lib/sketchup-api-stubs/stubs/Layout/Grid.rb index cb31e7c..02869d6 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Grid.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Class that references a {Layout::Document}'s grid settings. diff --git a/lib/sketchup-api-stubs/stubs/Layout/Group.rb b/lib/sketchup-api-stubs/stubs/Layout/Group.rb index 672a636..4579ea0 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Group.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Group.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A group is a special type of {Layout::Entity} that does not belong to a diff --git a/lib/sketchup-api-stubs/stubs/Layout/Image.rb b/lib/sketchup-api-stubs/stubs/Layout/Image.rb index cc2d628..fd46e7c 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Image.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Image.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A raster image entity. diff --git a/lib/sketchup-api-stubs/stubs/Layout/Label.rb b/lib/sketchup-api-stubs/stubs/Layout/Label.rb index fc07a8d..5ff563b 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Label.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Label.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is an interface to a label entity. A {Layout::Label} consists of a diff --git a/lib/sketchup-api-stubs/stubs/Layout/Layer.rb b/lib/sketchup-api-stubs/stubs/Layout/Layer.rb index 67854ee..af5e1c2 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Layer.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is the interface to a LayOut Layer Definition. A layer definition diff --git a/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb b/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb index 2b59be9..cd45220 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # References an instance of a {Layout::Layer}. A {Layout::LayerInstance} diff --git a/lib/sketchup-api-stubs/stubs/Layout/Layers.rb b/lib/sketchup-api-stubs/stubs/Layout/Layers.rb index f62fc63..50027fd 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Layers.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Layers class is a container class for all layers in a {Layout::Document}. diff --git a/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb b/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb index 6c48884..ed3abfd 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # References a linear dimension entity. A {Layout::LinearDimension} is composed diff --git a/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb b/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb index 6043be2..694726e 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is raised whenever a method attempts to modify any {Layout::Entity} diff --git a/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb b/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb index 8ff73f7..db52cd5 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is raised whenever a method attempts to modify any {Layout::Entity} diff --git a/lib/sketchup-api-stubs/stubs/Layout/Page.rb b/lib/sketchup-api-stubs/stubs/Layout/Page.rb index 564a193..d520c74 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Page.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Page.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Class for a single page in a LayOut document. diff --git a/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb b/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb index 804313a..fabc696 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is the interface to a {Layout::Document}'s paper space information. The @@ -140,6 +140,78 @@ def height def height=(height) end + # The {#image_display_resolution} method returns the on screen image quality. + # + # The resolution can be one of the following values: + # [+Layout::PageInfo::RESOLUTION_LOW+] + # [+Layout::PageInfo::RESOLUTION_MEDIUM+] + # [+Layout::PageInfo::RESOLUTION_HIGH+] + # + # @example + # doc = Layout::Document.open("C:/path/to/document.layout") + # image_quality = doc.page_info.image_display_resolution + # + # @return [Integer] + # + # @version LayOut 2023.1 + def image_display_resolution + end + + # The {#image_display_resolution=} method sets the on screen image quality. + # + # The resolution can be one of the following values: + # [+Layout::PageInfo::RESOLUTION_LOW+] + # [+Layout::PageInfo::RESOLUTION_MEDIUM+] + # [+Layout::PageInfo::RESOLUTION_HIGH+] + # + # @example + # doc = Layout::Document.open("C:/path/to/document.layout") + # doc.page_info.image_display_resolution = Layout::PageInfo::RESOLUTION_LOW + # + # @param [Integer] resolution + # + # @raise [ArgumentError] if resolution is not a valid resolution value + # + # @version LayOut 2023.1 + def image_display_resolution=(resolution) + end + + # The {#image_output_resolution} method returns the output image quality. + # + # The resolution can be one of the following values: + # [+Layout::PageInfo::RESOLUTION_LOW+] + # [+Layout::PageInfo::RESOLUTION_MEDIUM+] + # [+Layout::PageInfo::RESOLUTION_HIGH+] + # + # @example + # doc = Layout::Document.open("C:/path/to/document.layout") + # image_quality = doc.page_info.image_output_resolution + # + # @return [Integer] + # + # @version LayOut 2023.1 + def image_output_resolution + end + + # The {#image_output_resolution=} method sets the output image quality. + # + # The resolution can be one of the following values: + # [+Layout::PageInfo::RESOLUTION_LOW+] + # [+Layout::PageInfo::RESOLUTION_MEDIUM+] + # [+Layout::PageInfo::RESOLUTION_HIGH+] + # + # @example + # doc = Layout::Document.open("C:/path/to/document.layout") + # doc.page_info.image_output_resolution = Layout::PageInfo::RESOLUTION_HIGH + # + # @param [Integer] resolution + # + # @raise [ArgumentError] if resolution is not a valid resolution value + # + # @version LayOut 2023.1 + def image_output_resolution=(resolution) + end + # The {#left_margin} method returns the paper's left margin in document units. # # @example diff --git a/lib/sketchup-api-stubs/stubs/Layout/Pages.rb b/lib/sketchup-api-stubs/stubs/Layout/Pages.rb index 9b14019..fc057be 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Pages.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Pages class is a container class for all pages in a {Layout::Document}. diff --git a/lib/sketchup-api-stubs/stubs/Layout/Path.rb b/lib/sketchup-api-stubs/stubs/Layout/Path.rb index 127dadb..7aded8d 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Path.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Path.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A path entity represents a continuous, multi-segment polyline or bezier diff --git a/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb b/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb index be92676..42bdea1 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A simple rectangular shape entity. diff --git a/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb b/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb index 752a4f3..791da14 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # An entity that represents the data inserted from an external file. diff --git a/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb b/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb index 7479a99..d9c0a44 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A SketchUp Model entity. This is an instance of a SketchUp Model that is @@ -33,6 +33,8 @@ class Layout::SketchUpModel < Layout::Entity LEFT_VIEW = nil # Stub value. + NO_OVERRIDE = nil # Stub value. + RASTER_RENDER = nil # Stub value. RIGHT_VIEW = nil # Stub value. @@ -352,6 +354,26 @@ def line_weight=(line_weight) def model_to_paper_point(model_point) end + # The {#output_entities} method returns the {Layout::Group} that represents the + # {Layout::SketchUpModel} in its exported form. The {Layout::Group} will contain a {Layout::Image} + # for raster and hybrid-rendered models, and will contain a {Layout::Group} of LayOut entities for + # vector and hybrid-rendered models. This takes into account the output resolution set in the + # document's {Layout::PageInfo}, and the render mode override set on the document. + # + # @example + # doc = Layout::Document.open("C:/path/to/document.layout") + # bounds = Geom::Bounds2d.new(1, 1, 3, 3) + # model = Layout::SketchUpModel.new("C:/Path/to/model.skp", bounds) + # doc.add_entity(model, doc.layers.first, doc.pages.first) + # doc.render_mode_override = Layout::SketchUpModel::HYBRID_RENDER + # entities = model.output_entities + # + # @return [Layout::Entity] + # + # @version LayOut 2023.1 + def output_entities + end + # The {#perspective=} method sets whether the {Layout::SketchUpModel}'s view # is perspective or orthographic. # diff --git a/lib/sketchup-api-stubs/stubs/Layout/Style.rb b/lib/sketchup-api-stubs/stubs/Layout/Style.rb index 870f8f4..f55fcfa 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Style.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Style.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # References a collection of style attributes that determine the visual diff --git a/lib/sketchup-api-stubs/stubs/Layout/Table.rb b/lib/sketchup-api-stubs/stubs/Layout/Table.rb index c0757c9..6b77af5 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/Table.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/Table.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A {Layout::Table} is a series of rows and columns that holds data. diff --git a/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb b/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb index 0ae8a80..bb6f49c 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A {Layout::TableCell} is a single cell from a table that contains data. diff --git a/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb b/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb index d72f88d..548a0cc 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A {Layout::TableColumn} is a single column from a table. diff --git a/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb b/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb index 2de4b98..cc9282f 100644 --- a/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +++ b/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A {Layout::TableColumn} is a single row from a table. diff --git a/lib/sketchup-api-stubs/stubs/Length.rb b/lib/sketchup-api-stubs/stubs/Length.rb index afe18df..c05a0f8 100644 --- a/lib/sketchup-api-stubs/stubs/Length.rb +++ b/lib/sketchup-api-stubs/stubs/Length.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Because length units are used so often in SketchUp, a special class has been diff --git a/lib/sketchup-api-stubs/stubs/Numeric.rb b/lib/sketchup-api-stubs/stubs/Numeric.rb index e06bf24..678b154 100644 --- a/lib/sketchup-api-stubs/stubs/Numeric.rb +++ b/lib/sketchup-api-stubs/stubs/Numeric.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A number of methods have been added to the Ruby Numeric class to do units diff --git a/lib/sketchup-api-stubs/stubs/Sketchup.rb b/lib/sketchup-api-stubs/stubs/Sketchup.rb index 7a78927..1ee5dbe 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Sketchup module contains a number of important utility methods for use in @@ -651,8 +651,9 @@ def self.load(path) # # @version SketchUp 2021.0 # @param [String] filename The model file to open. - # @return [Integer, false] status code if opening the file succeeded, - # +false+ otherwise. + # @param [Boolean] with_status + # @return [Integer, false] status code if opening with +with_status+ set to +true+, + # otherwise +true+ or +false+. # # @version SketchUp 6.0 def self.open_file(*args) @@ -885,14 +886,30 @@ def self.remove_observer(observer) def self.require(path) end - # The {.size_viewport} method changes the pixel size of the viewport and SketchUp window. + # The {.resize_viewport} method changes the pixel size of the viewport and SketchUp window. # This can be useful for producing a consistent behavior in automatic testing, # regardless of the display resolution. # + # @bug In SketchUp 2023.1 this method didn't behave correctly on Windows. No known workarounds. + # # @example # model = Sketchup.active_model # Sketchup.resize_viewport(model, 800, 600) # + # @note In SketchUp 2024.0 and later this method doesn't behave correctly in all cases on Windows. + # The passed values are internally converted to logical pixels, rounded and converted back to + # physical pixels. This means certain sizes, such as 1000 px at 150% scaling, cannot be + # accurately set. + # + # As a workaround in you can use sizes that are evenly divisible with common scale factors, + # if you depend on pixel perfect sizes. + # + # # Changes by 1 px :( + # ((1000/1.5).round * 1.5).round # => 1001 + # # Survives the round-trip :) + # ((1500/1.5).round * 1.5).round # => 1500 + # ((1500/1.25).round * 1.25).round # => 1500 + # # @param [Sketchup::Model] model # # @param [Integer] width diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb index 2d95366..931fe55 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::Animation} interface is implemented to create animations diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb index 789b5db..cf0c058 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to application events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb index 0f4ee47..4b48b68 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # An ArcCurve is a Curve that makes up part of a circle. This is the @@ -53,6 +53,23 @@ class Sketchup::ArcCurve < Sketchup::Curve def center end + # Checks if the ArcCurve is a circle. + # + # @example + # entities = Sketchup.active_model.entities + # center_point = Geom::Point3d.new(0, 0, 0) + # normal_vector = Geom::Vector3d.new(0, 0, 1) + # radius = 10 + # edges = entities.add_circle(center_point, normal_vector, radius) + # curve = edges[0].curve + # is_circular = curve.circular? + # + # @return [Boolean] + # + # @version SketchUp 2023.1 + def circular? + end + # The {#end_angle} method is used to retrieve the angle of the end of the arc # measured from the X axis in radians. # diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb b/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb index 7389ef3..d69f030 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The AttributeDictionaries class is a collection of all of the diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb b/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb index 93690eb..b4a0ac8 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The AttributeDictionary class allows you to attach arbitrary collections of diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb index f3a14b4..ae9818c 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # SketchUp's drawing axes consist of three colored lines (red, green, blue), diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb index b78a787..016c096 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Behavior class is used to control the "behavior" of components, which diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb index 2a05a48..66212e5 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Camera class contains methods for creating and manipulating a camera. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb index 3272884..579a883 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The ClassificationSchema class represent schemas loaded in the model. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb index f859db6..d080543 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Classifications class is a container/manager for all classifications in diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb index 020756b..71111ea 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Color class is used to create and manipulate colors within SketchUp diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb index bcf9113..16363c0 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::ComponentDefinition} class is used to define the contents for diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb index 6f41d53..a21b408 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::ComponentInstance} class is used to represent component diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb index 05c6935..82553d6 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Console class is used by SketchUp to direct $stdout and $stderr to the diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb index 98d021e..e0d4467 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The ConstructionLine class contains methods for modifying construction diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb index af63b5e..b5c06c3 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A construction point represents a point in the model that can be used to aid diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb index 20f1e7c..65e2565 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Curve class is used by SketchUp to unite a series of Edge objects into diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb b/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb index 4913b54..74e2e4f 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A DefinitionList object holds a list of all of the ComponentDefinition diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb index 078be5d..b20991e 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to component definition diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb index a9bfd9d..8039164 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to events on a definitions diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb index 568b6e9..1bf68d5 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Dimension class provides base functionality for classes DimensionLinear diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb b/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb index 111741a..4f02fae 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The DimensionLinear class represents linear dimensions. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb index 0055f03..e17b230 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to changes in dimension text. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb b/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb index b916b29..429e97e 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The DimensionRadial class represents radius and diameter dimensions on diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb index d0e7813..18511a8 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Drawingelement is a base class for an item in the model that can be diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb index 09b2a90..fbed646 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Edge class contains methods modifying and extracting information for diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb b/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb index 326ec30..6a4d442 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The EdgeUse class defines how an Edge is used in the definition of a Face. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb index bdee1a5..b22418c 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::Entities} class is a collection of Entity objects, either in a @@ -898,6 +898,9 @@ def each # @bug Prior to SketchUp 2023.0 this could crash SketchUp if you erased an # instance used by the active edit path. # + # @bug SketchUp 2023.0 and SketchUp 2023.0.1 could incorrectly raise an + # `ArgumentError` when there was an open editing path. + # # @example # model = Sketchup.active_model # entities = model.active_entities diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb b/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb index b4ec91c..b9d4381 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::EntitiesBuilder} is an interface to generate bulk geometry diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb index a36b920..0cc4b1a 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to {Sketchup::Entities} diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb index f617f9c..ecca93c 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is the base class for all SketchUp entities. Entities are basically @@ -252,29 +252,17 @@ def entityID def get_attribute(dict_name, key, default_value = nil) end - # The to_s method is used to retrieve the string representation of the entity. + # The {#inspect} method is used to retrieve the string representation of the entity. # # @example - # depth = 100 - # width = 100 # model = Sketchup.active_model # entities = model.active_entities - # pts = [] - # pts[0] = [0, 0, 0] - # pts[1] = [width, 0, 0] - # pts[2] = [width, depth, 0] - # pts[3] = [0, depth, 0] + # edge = entities.add_line(Geom::Point3d.new(0, 0, 0), Geom::Point3d.new(9, 9, 9)) + # string = edge.inspect # - # # Add the face to the entities in the model - # face = entities.add_face pts + # @return [String] # - # # I just happen to know that the second and third entities in the - # # entities objects are edges. - # entity1 = entities[1] - # st = entity1.to_s - # - # @return [String] the string representation of the entity if - # successful + # @see #to_s # # @version SketchUp 6.0 def inspect @@ -457,29 +445,15 @@ def remove_observer(observer) def set_attribute(dict_name, key, value) end - # The to_s method is used to retrieve the string representation of the entity. + # The {#to_s} method is used to retrieve the string representation of the entity. # # @example - # depth = 100 - # width = 100 # model = Sketchup.active_model # entities = model.active_entities - # pts = [] - # pts[0] = [0, 0, 0] - # pts[1] = [width, 0, 0] - # pts[2] = [width, depth, 0] - # pts[3] = [0, depth, 0] - # - # # Add the face to the entities in the model - # face = entities.add_face pts - # - # # I just happen to know that the second and third entities in the - # # entities objects are edges. - # entity1 = entities[1] - # st = entity1.to_s + # edge = entities.add_line(Geom::Point3d.new(0, 0, 0), Geom::Point3d.new(9, 9, 9)) + # string = edge.to_s # - # @return [String] the string representation of the entity if - # successful + # @return [String] # # @version SketchUp 6.0 def to_s diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb index 1ed804a..d08bcc1 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to entity events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb index 1af0982..0484231 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The ExtensionsManager class provides a way of accessing the diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb index 3a62b9b..1b0a4a1 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Faces in SketchUp are flat, 2-sided polygons with 3 or more sides. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb index 4e12061..2f3eade 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to changes in camera diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb index 8625143..8269eeb 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A Group class contains methods for manipulating groups of entities. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb index b6d6d46..d64fa08 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::Http} module provides interfaces to create asynchronous HTTP diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb index 7ab5ccb..d9cb563 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Http::Request objects allows you to send HTTP request to HTTP servers. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb index 173ece8..f66073e 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Http::Response objects allows you to get the response information from the diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb index 6439308..a781cb7 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # An Image object represents a raster image placed in the Model. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb index 220bab9..2874b76 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # References an image representation object. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb index 369d238..88cb059 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Importer interface lets you build your own importers for SketchUp. To diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb b/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb index 6d0c2fe..a8784b1 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::InputPoint} class is used to pick 3d points and/or entities diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb index 2e2147e..c2cfef2 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to component instance diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb b/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb index b93b808..0bfdb2e 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::InstancePath} class represent the instance path to a given diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb index 5476dfa..72e89a9 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Layer class contains methods modifying and extracting information for a diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb b/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb index e3dae8d..c5ef7b3 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Allows layers to be organized in folders. Folders may have duplicate names. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb index 61c28f6..25df3c0 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Layers collection allows you to see and manage all of the layers in a diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb index 68a8e23..14b9045 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to layers events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb index 2b71e29..53c5489 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The +Sketchup::Licensing+ module contains methods for diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb index 733f86e..aa8a063 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Sketchup::Licensing::ExtensionLicense class is used to store extension diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb b/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb index 750cc67..e458137 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This provides a way for SketchUp to customize a line style and be set on a diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb b/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb index 64a2ff3..f1dd7ce 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Provides access to the different line style objects in the model. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb index c7fc17d..751339c 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Loop is a low level topology class that will not need to be used often. A diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb index fc31bf6..d479593 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Material class represents a texture or color that can be applied to diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb index 35caea4..65767d9 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A collection of Materials objects. Each model contains a Materials collection diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb index 0681f99..de53068 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to materials events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb index 885eec2..02de72e 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # An interface to a menu. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb index 2fb14f6..0999601 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This is the interface to a SketchUp model. The model is the 3D drawing that @@ -394,7 +394,7 @@ def bounds def classifications end - # The close method is used to close this model. On Mac OS, only the active + # The {#close} method is used to close this model. On Mac OS, only the active # model can be closed. On Windows, since there can be only one document open, # this method will perform a File/New operation. # @@ -403,10 +403,14 @@ def classifications # model = Sketchup.active_model # model.close # + # @note As of SketchUp 2024.0 this method will ensure the next model window + # gets focus if there is one. Before that `Sketchup.active_model` might + # return `nil` after calling this method even though more models where open. + # # @param [Boolean] ignore_changes - # If true, model changes will be + # If `true`, model changes will be # ignored and save prompts will be suppressed. - # If false, changes will not be ignored and save + # If `false`, changes will not be ignored and save # prompts will be displayed normally. # # @return [nil] diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb index bba4d62..ae137ad 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to model events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb b/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb index 86606ec..4a6ec3e 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The OptionsManager class manages various kinds of OptionsProviders on a diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb b/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb index 26c388c..f828bc1 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # An +OptionsProvider+ class provides various kinds of options on a diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb index 58de5c3..bee7330 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to operations provider diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb index f33a6be..baadd9b 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # An Overlay provides contextual model information directly in the viewport. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb b/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb index 34781ec..4be3880 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # An overlay added to a model is invalidated once it's removed from the model. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb index d50b667..ca7f333 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Page class contains methods to extract information and modify the diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb index 295cdeb..46fe16d 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Pages class contains methods for manipulating a collection of Pages diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb index c538408..43cca96 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to pages events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb b/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb index 9e40f1f..dc9daae 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::PickHelper} class is used to pick entities that reside under @@ -437,12 +437,14 @@ def test_point(*args) def transformation_at(index) end - # The view method is used to get the view associated with the PickHelper. + # The {#view} method is used to get the view associated with the {Sketchup::PickHelper}. # # @example - # view = pickhelper.view + # view = Sketchup.active_model.active_view + # ph = view.pick_helper + # ph.view # - # @return view - the associated view + # @return [Sketchup::View] # # @version SketchUp 6.0 def view diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb b/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb index 5b0520e..9705150 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::RegionalSettings} module contains methods getting information about the diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb b/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb index dc89ea3..0cec52c 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The RenderingOptions class contains method to extract the rendering @@ -85,6 +85,11 @@ # - +ROPDrawHiddenGeometry+ # - +ROPDrawHiddenObjects+ # +# Added in SketchUp 2024.0: +# - +AmbientOcclusion+ +# - +AmbientOcclusionDistance+ +# - +AmbientOcclusionIntensity+ +# # @version SketchUp 6.0 class Sketchup::RenderingOptions < Sketchup::Entity @@ -100,6 +105,9 @@ class Sketchup::RenderingOptions < Sketchup::Entity ROPDrawHiddenObjects = nil # Stub value. ROPEditComponent = nil # Stub value. ROPSectionDisplayTurnedOff = nil # Stub value. + ROPSetAODistance = nil # Stub value. + ROPSetAOEnabled = nil # Stub value. + ROPSetAOIntensity = nil # Stub value. ROPSetBackgroundColor = nil # Stub value. ROPSetConstructionColor = nil # Stub value. ROPSetDepthQueEdges = nil # Stub value. @@ -217,6 +225,10 @@ def [](key) # @param [Object] value # The value to be set. # + # @raise [ArgumentError] If the given key is invalid, the key's value is not settable, + # or the given value is invalid. SketchUp versions earlier than 2024.0 will not raise + # this error. + # # @return [Object] the value that was set # # @version SketchUp 6.0 diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb index 05dd48d..9540c89 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to rendering options events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb b/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb index 4cac686..8cf7012 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The SectionPlane class represents a section plane in a SketchUp model. Note diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb index c71cbc1..759dade 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A set of the currently selected entities. Use the Model.selection method diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb index bdff51c..d9c44ca 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to selection events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb index 69972ec..8644d24 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The set class represents a collection of unique objects. This class is useful diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb index bd9839e..50fdf4e 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::ShadowInfo} class contains method to extract the shadow diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb index 7372c43..d3bc82d 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to changes to the shadow diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb index 28c281c..c90ea99 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The {Sketchup::Skp} module is used to read metadata from external SketchUp diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb index 81a1d56..8a47886 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Style class contains methods for modifying information about a specific diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb index 93cc5b3..5d89887 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Styles class contains methods for manipulating a collection of styles in diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb index 251967d..c90f9cc 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Text class contains method to manipulate a Text entity object. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb index d2fba60..8bae55c 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Texture class contains methods for obtaining information about textures diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb b/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb index 76c0605..eac3f84 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The TextureWriter class is used primarily for writing the textures used in a diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb index bf6b85a..869a1e1 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # Tool is the interface that you implement to create a SketchUp tool. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb index 1729104..776fed7 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Tools class contains methods to manipulate a collection of SketchUp diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb index 90e8f61..d3f0d38 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to tool events. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb b/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb index 2dda359..033faca 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The UV Helper class contains methods allowing you to determine the location diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb b/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb index 924718e..d9b3f42 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # A Vertex. A Vertex represents the end of an Edge or a point inside a Face. diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/View.rb b/lib/sketchup-api-stubs/stubs/Sketchup/View.rb index cad9cfc..35829a2 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/View.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This class contains methods to manipulate the current point of view of the @@ -627,6 +627,24 @@ def field_of_view def field_of_view=(fov) end + # The {#graphics_engine} method is used query the type of the graphics engine that's currently + # used by this view. + # + # @example + # engine = Sketchup.active_model.active_view.graphics_engine + # if engine == :graphics_engine_classic + # puts 'Classic graphics engine' + # elsif engine == :graphics_engine_2024 + # puts 'New graphics engine' + # end + # + # @return [Symbol] Type of the graphics engine. + # +:graphics_engine_classic+ or +:graphics_engine_2024+ + # + # @version SketchUp 2024.0 + def graphics_engine + end + # The guess_target method is used to guess at what the user is looking at when # you have a perspective view. # diff --git a/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb b/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb index 4987319..753d2fb 100644 --- a/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +++ b/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # This observer interface is implemented to react to view events. diff --git a/lib/sketchup-api-stubs/stubs/SketchupExtension.rb b/lib/sketchup-api-stubs/stubs/SketchupExtension.rb index 5cbe9c9..a83a698 100644 --- a/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +++ b/lib/sketchup-api-stubs/stubs/SketchupExtension.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The SketchupExtension class contains methods allowing you to create and diff --git a/lib/sketchup-api-stubs/stubs/String.rb b/lib/sketchup-api-stubs/stubs/String.rb index c4ae2ac..acab6d2 100644 --- a/lib/sketchup-api-stubs/stubs/String.rb +++ b/lib/sketchup-api-stubs/stubs/String.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The String class contains a method used to parse a string as a length value. diff --git a/lib/sketchup-api-stubs/stubs/UI.rb b/lib/sketchup-api-stubs/stubs/UI.rb index b198ffc..0f9c6c6 100644 --- a/lib/sketchup-api-stubs/stubs/UI.rb +++ b/lib/sketchup-api-stubs/stubs/UI.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The UI module contains a number of methods for creating simple UI elements @@ -52,23 +52,43 @@ def self.add_context_menu_handler def self.beep end - # The create_cursor method is used to create a cursor from an image file at + # The {.create_cursor} method is used to create a cursor from an image file at # the specified location. This must be called from within a custom - # Tool. See the Tool class for a complete example. + # tool. See the {Sketchup::Tool} documentation for a complete example. # - # Since SketchUp 2016 it is possible to provide vector images for the cursors. - # SVG format for Windows and PDF format for OS X. + # The size of the cursor images should be 32x32 pixels. + # + # The coordinates for the cursor's hotspot is based from it's top left corner. + # For example, a value of (hot_x, hot_y) = (5, 10) would identify the hotpoint + # of the cursor at 6 pixels from the left edge of your cursor image and 11 + # pixels from the top edge of your cursor image. + # + # @bug On macOS raster cursors are always displayed at 24x24. + # + # @bug In SketchUp 2023.1 on Mac provided an incorrect hotspot location. The hotspot was scaled by + # a factor of 32.0/24.0. If a hotspot position was greater than 24, the cursor would not display. # # @example - # cursor_id = nil - # cursor_path = Sketchup.find_support_file("Pointer.png", "Plugins/") - # if cursor_path - # cursor_id = UI.create_cursor(cursor_path, 0, 0) + # class ExampleTool + # def initialize + # @cursor_id = nil + # # Load vector cursor format depending on platform. + # ext = Sketchup.platform == :platform_win ? 'svg' : 'pdf' + # cursor_path = File.join(__dir__, "cursor.#{ext}") + # @cursor_id = UI.create_cursor(cursor_path, 4, 6) + # end + # + # def onSetCursor + # UI.set_cursor(@cursor_id) + # end # end # - # def onSetCursor - # UI.set_cursor(cursor_id) - # end + # @note Since SketchUp 2016 it is possible to provide vector images for the cursors. + # SVG format for Windows and PDF format for macOS. This is the recommended format + # to use since it will scale well with different DPI scaling. + # + # @note Because the image is never released, avoid creating new cursors for the same image for any + # given tool. Cache it and reuse it. # # @param [String] path # File path to an image. @@ -80,17 +100,29 @@ def self.beep # @param [Integer] hot_y # A y coordinate that is the "hotpoint" for the cursor # computed from the top edge of the of your cursor image. - # For example, a value of (hot_x, hot_y) = (5,10) would - # identify the hotpoint of the cursor at 5 pixels from - # the left edge of your cursor image and 10 pixels from - # the top edge of your cursor image. # - # @return [Integer] ID associated with the cursor + # @return [Integer] Id associated with the cursor. + # Use this with {UI.set_cursor} in {Sketchup::Tool#onSetCursor}. + # + # @see UI.set_cursor + # + # @see Sketchup::Tool#onSetCursor # # @version SketchUp 6.0 def self.create_cursor(path, hot_x, hot_y) end + # Returns the plain text available on the clipboard, if there is any. + # + # @example + # text = UI.get_clipboard_data + # + # @return [String, nil] + # + # @version SketchUp 2023.1 + def self.get_clipboard_data + end + # Creates a dialog box for inputting user information. The dialog box contains # input fields with static text prompts, optional default values, optional # drop down selections, and optional title. @@ -166,8 +198,11 @@ def self.inspector_names # is the first step toward adding your own custom items to the bottom # of SketchUp's menus. # - # Valid menu names are: "File", "Edit", "View", "Camera", "Draw", "Tools", - # "Window", "Extensions", "Help" and "Developer". + # Valid menu names are: +'File'+, +'Edit'+, +'View'+, +'Camera'+, +'Draw'+, + # +'Tools'+, +'Window'+, +'Extensions'+, +'Help'+ and +'Developer'+. + # + # @bug In versions prior to SketchUp 2018 this would crash if you passed an + # empty string. # # @example # tool_menu = UI.menu("Tools") @@ -175,19 +210,18 @@ def self.inspector_names # UI.messagebox("Cheese activated.") # } # - # @note The "Extensions" menu was named "Plugins" prior to SketchUp 2015. - # For backward compatibility "Plugins" still works. + # @note The +'Extensions'+ menu was named +'Plugins'+ prior to SketchUp 2015. + # For backward compatibility +'Plugins'+ still works. # - # @note In versions prior to SketchUp 2018 this would crash if you passed an - # empty string. + # @note +'Developer'+ menu was added with SketchUp 2021.1. # - # @param menu_name - # The name of an existing top level menu. + # @param [String] menu_name + # The name of a supported menu. # # @return [Sketchup::Menu] # # @version SketchUp 6.0 - def self.menu(menu_name = "Plugins") + def self.menu(menu_name = "Extensions") end # Creates a dialog box containing static text with a series of buttons for @@ -480,6 +514,17 @@ def self.scale_factor def self.select_directory(options = {}) end + # Copies plain text to the clipboard. + # + # @example + # UI.set_clipboard_data('Hello World') + # + # @return [Boolean] + # + # @version SketchUp 2023.1 + def self.set_clipboard_data(data) + end + # The {.set_cursor} method is used to change the cursor to a new cursor with a # given cursor id. See UI.create_cursor and the Tool class for details # on creating your own tools with arbitrary cursors. diff --git a/lib/sketchup-api-stubs/stubs/UI/Command.rb b/lib/sketchup-api-stubs/stubs/UI/Command.rb index 7d561c6..0fddc83 100644 --- a/lib/sketchup-api-stubs/stubs/UI/Command.rb +++ b/lib/sketchup-api-stubs/stubs/UI/Command.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Command class is the preferred class for adding tools to the menus and @@ -35,36 +35,6 @@ # @version SketchUp 6.0 class UI::Command - # Class Methods - - # The new method is used to create a new command. - # - # @example - # UI.menu("Draw").add_separator - # - # # Adds a Test submenu to the Draw menu where the Tester menu item appears - # testmenu = UI.menu("Draw").add_submenu("Test") - # - # # This menu item simply displays Hello World on the screen when clicked. - # cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") } - # testmenu.add_item cmd - # - # @note Prior to SketchUp 2019 it was not possible to sub-class {UI::Command} - # due to a bug in how SketchUp initialized the class. - # - # @param [String] menutext - # The text that will appear for this command's menu item - # if it appears on a menu. - # - # @return [UI::Command] the new Command object - # - # @version SketchUp 6.0 - # - # @yield Code that executes the command when the menu item or - # toolbar item is selected. - def self.new(menutext) - end - # Instance Methods # The {#extension} method returns the command's associated extension. @@ -119,6 +89,34 @@ def extension=(extension) def get_validation_proc end + # The new method is used to create a new command. + # + # @example + # UI.menu("Draw").add_separator + # + # # Adds a Test submenu to the Draw menu where the Tester menu item appears + # testmenu = UI.menu("Draw").add_submenu("Test") + # + # # This menu item simply displays Hello World on the screen when clicked. + # cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") } + # testmenu.add_item cmd + # + # @note Prior to SketchUp 2019 it was not possible to sub-class {UI::Command} + # due to a bug in how SketchUp initialized the class. + # + # @param [String] menutext + # The text that will appear for this command's menu item + # if it appears on a menu. + # + # @return [UI::Command] the new Command object + # + # @version SketchUp 6.0 + # + # @yield Code that executes the command when the menu item or + # toolbar item is selected. + def initialize(menutext) + end + # The large_icon method returns the icon file for the command's # large icon. # diff --git a/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb b/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb index b58be68..61d028b 100644 --- a/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +++ b/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Ruby HtmlDialog class allows you to create and interact with HTML dialog @@ -21,6 +21,8 @@ # # HtmlDialog uses the following versions of CEF (Chromium Embedded Framework): # +# [SketchUp 2024.0] +# CEF 112 # [SketchUp 2021.1] # CEF 88 # [SketchUp 2019.0] @@ -30,6 +32,10 @@ # [SketchUp 2017.0] # CEF 52 # +# @note The window size is not guaranteed to be pixel perfect in all SketchUp +# versions and operating systems. Prefer responsive designs that can take +# up some fluctuations in size. +# # @version SketchUp 2017 class UI::HtmlDialog @@ -229,6 +235,11 @@ def get_size # HtmlDialog were not persisted when SketchUp was closed without first # closing the HtmlDialog window. # + # @bug SketchUp 2023.0 introduced a bug where the position given in {#initialize} + # is set relative to the SketchUp main window. If you rely on the position to be + # absolute to the screen then you can use {#set_position} after creating the + # dialog. + # # @example With options Hash # dialog = UI::HtmlDialog.new( # { diff --git a/lib/sketchup-api-stubs/stubs/UI/Notification.rb b/lib/sketchup-api-stubs/stubs/UI/Notification.rb index 15db1c5..cba9056 100644 --- a/lib/sketchup-api-stubs/stubs/UI/Notification.rb +++ b/lib/sketchup-api-stubs/stubs/UI/Notification.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # {UI::Notification} objects allows you to show native notifications in the diff --git a/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb b/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb index 0fe9ab4..df004a3 100644 --- a/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +++ b/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Toolbar class contains methods to create and manipulate SketchUp diff --git a/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb b/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb index 05245cd..271244c 100644 --- a/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +++ b/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) # The Ruby WebDialog class allows you to create and interact with DHTML dialog @@ -177,22 +177,6 @@ def get_element_value(element_id) # The +new+ method is used to create a new webdialog. # - # 250, left = 0, top = 0, resizable = true) - # @param [String] dialog_title The title to be displayed in the webdialog. - # @param [Boolean] scrollable true if you want to allow scrollbars, false - # if you do not want to allow scrollbars. - # @param [String, nil] pref_key The registry entry where the location and - # size of the dialog will be saved. - # If preferences_key is not included, the - # location and size will not be stored. - # @param [Integer] width The width of the webdialog. - # @param [Integer] height The height of the webdialog. - # @param [Integer] left The number of pixels from the left. - # @param [Integer] top The number of pixels from the top. - # @param [Integer] resizable true if you want the webdialog to be resizable, - # false if not. - # @return [UI::WebDialog] - # # @example # dlg = UI::WebDialog.new("Show sketchup.com", true, # "ShowSketchupDotCom", 739, 641, 150, 150, true); @@ -207,8 +191,22 @@ def get_element_value(element_id) # user's OS. On Mac, Safari is embedded, while on the PC whatever version of # Internet Explorer is installed will be embedded. # - # @overload initialize(dialog_title = "", scrollable = true, pref_key = nil, width = 250, height = + # @overload initialize(dialog_title = "", scrollable = true, pref_key = nil, width = 250, height = 250, left = 0, top = 0, resizable = true) # + # @param [String] dialog_title The title to be displayed in the webdialog. + # @param [Boolean] scrollable true if you want to allow scrollbars, false + # if you do not want to allow scrollbars. + # @param [String, nil] pref_key The registry entry where the location and + # size of the dialog will be saved. + # If preferences_key is not included, the + # location and size will not be stored. + # @param [Integer] width The width of the webdialog. + # @param [Integer] height The height of the webdialog. + # @param [Integer] left The number of pixels from the left. + # @param [Integer] top The number of pixels from the top. + # @param [Integer] resizable true if you want the webdialog to be resizable, + # false if not. + # @return [UI::WebDialog] # # @overload initialize(properties) # diff --git a/lib/sketchup-api-stubs/stubs/_top_level.rb b/lib/sketchup-api-stubs/stubs/_top_level.rb index 86d98dc..447a8ff 100644 --- a/lib/sketchup-api-stubs/stubs/_top_level.rb +++ b/lib/sketchup-api-stubs/stubs/_top_level.rb @@ -1,4 +1,4 @@ -# Copyright:: Copyright 2023 Trimble Inc. +# Copyright:: Copyright 2024 Trimble Inc. # License:: The MIT License (MIT) diff --git a/pages/ReleaseNotes.md b/pages/ReleaseNotes.md index 24f08d9..a32c0ce 100644 --- a/pages/ReleaseNotes.md +++ b/pages/ReleaseNotes.md @@ -19,7 +19,13 @@ Though our adoption rate to the latest version is quite high, it can take time a Here are the build numbers for recent SketchUp releases. Note that build numbers in languages besides English are larger for each release, so it is best to check for builds that are greater than or equal to the numbers here. -- **SU2023.0** = 23.0.117 on Windows 64-bit, 23.0.118 on Mac 64-bit. +- **SU2024.0** = 24.0.484 on Windows 64-bit, 24.0.483 on Mac 64-bit. +- **SU2023.1.3** = 23.1.340 on Windows 64-bit, 23.1.341 on Mac 64-bit. +- **SU2023.1.2** = 23.1.315 on Windows 64-bit, 23.1.314 on Mac 64-bit. +- **SU2023.1.1** = 23.1.313 on Windows 64-bit, 23.1.312 on Mac 64-bit. +- **SU2023.0.2** = 23.0.419 on Windows 64-bit, 23.0.418 on Mac 64-bit. +- **SU2023.0.1** = 23.0.397 on Windows 64-bit, 23.0.398 on Mac 64-bit. +- **SU2023.0** = 23.0.367 on Windows 64-bit, 23.0.366 on Mac 64-bit. - **SU2022.0.1** = 22.0.354 on Windows 64-bit, 22.0.353 on Mac 64-bit. - **SU2022.0** = 22.0.316 on Windows 64-bit, 22.0.315 on Mac 64-bit. - **SU2021.1.2** = 21.1.332 on Windows 64-bit, 21.1.331 on Mac 64-bit. (Contained no Ruby API changes) @@ -67,11 +73,67 @@ Here are the build numbers for recent SketchUp releases. Note that build numbers - **SU6 M6** = 6.4.265 on Windows, 6.4.263 on Mac. +# What's new in SketchUp 2024.0 + +## Ruby API Additions and Improvements + +* Added support for export option `:page_range` for {Layout::Document#export}. +* Added {Sketchup::View#graphics_engine}. +* Added rendering options support for Ambient Occlusion: + * {Sketchup::RenderingOptions} keys added: + * `"AmbientOcclusion"` + * `"AmbientOcclusionDistance"` + * `"AmbientOcclusionIntensity"` + * {Sketchup::RenderingOptionsObserver} constants: + * `ROPSetAOEnabled` + * `ROPSetAODistance` + * `ROPSetAOIntensity` +* {Sketchup::RenderingOptions#[]=} will now raise an `ArgumentError` if the given value cannot be set + for the given key. This is a breaking change since earlier versions of the API would not indicate any + failures for such erroneous calls. + +## Ruby API Bug Fixes + +* Fixed issue on Mac where {UI.create_cursor} would provide an incorrect hotspot +* Fixed regression in {Sketchup.resize_viewport} introduced in SketchUp 2023.1 on Windows. +* Fixed {Layout::Entity#move_to_layer} when moving an entity from a nonshared layer. +* Changed {Sketchup::Model#close} to set focus to the next open model window on macOS. +* Fixed regression from SketchUp 2023.1 with the Ruby Console on Windows where new-line + character was incorrectly added to the end of `print` calls. + +# What's new in SketchUp 2023.1 + +## Ruby API Additions and Improvements +* Added method {Layout::Document#render_mode_override} +* Added method {Layout::Document#render_mode_override=} +* Added constant {Layout::SketchUpModel::NO_OVERRIDE} +* Added method {Layout::SketchUpModel#output_entities} +* Added method {Layout::PageInfo#image_display_resolution} +* Added method {Layout::PageInfo#image_display_resolution=} +* Added method {Layout::PageInfo#image_output_resolution} +* Added method {Layout::PageInfo#image_output_resolution=} +* `output_resolution:` is no longer a supported value in the export options dictionary. Instead, use {Layout::PageInfo#output_resolution=} and {Layout::PageInfo#image_output_resolution=}. +* Added method {Sketchup::ArcCurve#circular?} + +# What's new in SketchUp 2023.0.2 + +## Ruby API Bug Fixes + +* Fixed issues with {Sketchup::Entities.erase_entities} incorrectly throwing + and `ArgumentError` claiming an instance was open for editing. + +# What's new in SketchUp 2023.0.1 + +## Ruby API Bug Fixes + +* Fixed issues with {UI.inputbox} and {UI.messagebox} not being modal. +* Fixed issue where new Ruby toolbars might not show up by default. + # What's new in SketchUp 2023.0 ## Overlays -Overlays are a new SketchUp API capability which allows developers to persist extension behaviors while you are using other tools. Effectively, extensions can now continue to analyze, visualize, and create information in the modeling window as you continue evolving a SketchUp model using other native tools and extensions. Previously, extension developers were limited to drawing information to the modeling window only when their extension had a tool active. +Overlays are a new SketchUp API capability which allows developers to persist extension behaviors while you are using other tools. Effectively, extensions can now continue to analyze, visualize, and create information in the modeling window as you continue evolving a SketchUp model using other native tools and extensions. Previously, extension developers were limited to drawing information to the modeling window only when their extension had a tool active . ## Update OpenSSL to 1.1.1o diff --git a/pages/extension_requirements.md b/pages/extension_requirements.md new file mode 100644 index 0000000..81317d4 --- /dev/null +++ b/pages/extension_requirements.md @@ -0,0 +1,127 @@ +# @title Extension Requirements + +# Extension Requirements + +SketchUp extensions are distributed as RBZ files. These are the specifications for creating a valid RBZ file that can be used by SketchUp or shared on the Extension Warehouse. + +## The Basics + +### File Structure + +An RBZ file is a normal ZIP archive with the .rbz file extension. To create one, you can use the ZIP archive tool of your choice, including right clicking the target files and sending them to a ZIP archive, and then rename the file. You may need to change a system setting to display the file extension to be able to change it. + +The RBZ archive must contain exactly two items, a root RB file and a support folder by the same name (excluding the .rb extension). The root RB file contains the extension metadata. The support folder contains the main code. + +*Root RB file* + +```ruby +# nn_cuber_maker.rb + +module NameyNamesson + module CubeMaker + EXTENSION = SketchupExtension.new("NN Cube Maker", "nn_cube_maker/main.rb") + EXTENSION.creator = "Namey Namesson" + EXTENSION.description = "Make cubes in just a few clicks." + EXTENSION.version = "1.0.0" + EXTENSION.copyright = "2023 Name Namesson" + Sketchup.register_extension(EXTENSION, true) + end +end +``` + +*Main code in support folder* + +```ruby +# nn_cuber_maker/main.rb + +module NameyNamesson + module CubeMaker + # Code goes here... + end +end +``` + +The root RB file should only register the extension, not contain the extension's logic or load additional files. + +### Wrapping Module + +SketchUp extensions all run in a shared environment. To avoid clashes between similarly named methods and classes, all your extension's Ruby code must be wrapped in a single uniquely named module. Typically you can use the name of your company or your name, followed by the name of your extension. + +```ruby +module NameyNamesson + module CubeMaker + # Code goes here… + end +end +``` + +### Undo Stack + +When your extension makes several low level draw calls, join them together as one entry to the undo stack using the `start_operation` and `commit_operation` methods. If the user activates it as a single high level action, let them also undo it in a single step. + +```ruby +# bad - creates multiple undo steps +def draw_cube + model = Sketchup.active_model + face = model.entities.add_face([0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]) + face.pushpull(10) +end + +# good - creates one undo step +def draw_cube + model = Sketchup.active_model + model.start_operation("Draw Cube", true) + face = model.entities.add_face([0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]) + face.pushpull(10) + model.commit_operation +end +``` + +### Global Variables + +Since SketchUp extensions run in a shared environment, global variables risk clashing between extensions and are not permitted. Instead use instance variables or class variables. + +### Dependency to Another Extension + +Ideally, avoid your extension depending on another extension. Prefer duplicating any shared logic between your extensions over publishing a "library extension", to make installation easier for end users. If your extension does require another extension to work, make sure to clearly state this in its documentation and also show an error message if the dependency is missing. + +## The Nitty Gritty Stuff + +### Monkey Patching the SketchUp Ruby API + +Since SketchUp extensions run in a shared environment, changing the modules and classes of the Ruby API from one extension can clash with another extension. Don't change these modules and classes. + +### Gems + +Installing Gems does not work well in SketchUp. It freezes up the program during installation and some Gems need special build tools to be made functional. Also different extensions may want to use different versions of the same gem. Instead copy the code of the Gem into your own extension support folder and wrap it under your unique namespace. + +### $LOAD_PATH + +Don't modify the '$LOAD_PATH'. Doing so may cause other extensions to load the wrong files. Instead include your extension support folder in the path whenever you load a file. + +### Exit + +'exit' and 'exit!' should not be used to stop the Ruby execution, as all Ruby extensions run in a shared interpreter. Instead use 'return', 'next', break' or 'raise' to stop the execution of your own code. + +### Unsafe License Checks + +Ruby is a very dynamic language where any method can be overridden at runtime. If you extract your licensing checks for a paid extension to a separate method, this method can be overridden and the extension used without a license. For better protection, prefer checking the license inside of the same method containing some of your main logic. Don't use a constant for your extension identifier as it too can be overridden. Prefer hardcoding the identifier directly where you make the license check + +These recommendations make it harder but not impossible to crack the extension. For better security, you can compile your logic and use a Ruby C Extension to integrate it with SketchUp, or run it on a server using HTTP requests. + +### And More… + +This is not a complete list of everything an extension can be denied for. See the below links for more details and use your good judgment when developing. + +## Further Reading + +[Extension Code Examples](https://github.com/SketchUp/sketchup-ruby-api-tutorials) + +[Extension Development Best Practices](https://help.sketchup.com/en/extension-warehouse/extension-development-best-practices) + +[Robocop cops](https://rubocop-sketchup.readthedocs.io/en/latest/cops_requirements/) - Technical list of everything checked by the sketchup-rubocop static code analysis tool. + +[Sketchup Extension UX Guidelines](https://sketchup.github.io/sketchup-extension-ux-guidelines/) +Recommendations to make the extension easier to use and fit better into SketchUp. + + From 9df89dc0d4df017fd4ef162bf72d073f9d3d41bc Mon Sep 17 00:00:00 2001 From: Thomas Thomassen Date: Thu, 4 Apr 2024 17:14:19 +0200 Subject: [PATCH 2/2] Bump version to 0.7.10. --- sketchup-api-stubs.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sketchup-api-stubs.gemspec b/sketchup-api-stubs.gemspec index 07b5043..b287d56 100644 --- a/sketchup-api-stubs.gemspec +++ b/sketchup-api-stubs.gemspec @@ -1,7 +1,7 @@ # coding: utf-8 Gem::Specification.new do |spec| spec.name = 'sketchup-api-stubs' - spec.version = '0.7.9' + spec.version = '0.7.10' spec.authors = ['Trimble Inc, SketchUp Team'] spec.summary = %q{SketchUp Ruby API stubs.}