From 32581580010044a3fa80b092395d3d2be5216192 Mon Sep 17 00:00:00 2001 From: Thomas Thomassen Date: Thu, 4 Apr 2024 16:10:06 +0200 Subject: [PATCH] SketchUp 2024.0. (24.0.484, 24.0.483) --- Layout/Document.html | 22 +- Layout/Entity.html | 16 + Sketchup.html | 52 +- Sketchup/Entity.html | 63 +- Sketchup/Model.html | 14 +- Sketchup/PickHelper.html | 19 +- Sketchup/RenderingOptions.html | 36 + Sketchup/View.html | 95 + UI.html | 114 +- UI/Command.html | 107 +- UI/HtmlDialog.html | 13 +- UI/Toolbar.html | 14 +- _index.html | 68 +- file.ReleaseNotes.html | 57 +- file_list.html | 24 +- method_list.html | 4378 ++++++++++++++++---------------- 16 files changed, 2688 insertions(+), 2404 deletions(-) diff --git a/Layout/Document.html b/Layout/Document.html index f42a601..5a40862 100644 --- a/Layout/Document.html +++ b/Layout/Document.html @@ -1683,6 +1683,15 @@

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 } + status = doc.export("c:/my_export.pdf", options) @@ -1693,13 +1702,22 @@

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/<username>/Desktop/pngs/page.png")
 
 # Export pages one through three at 300 dpi as JPGs.
 options = { start_page: 1,
             end_page: 3,
             dpi: 300 }
-status = doc.export('c:/page.jpg', options)
+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) diff --git a/Layout/Entity.html b/Layout/Entity.html index 753251a..363dc13 100644 --- a/Layout/Entity.html +++ b/Layout/Entity.html @@ -1562,6 +1562,22 @@

+ +

Known Bugs:

+ diff --git a/Sketchup.html b/Sketchup.html index 6c70626..159e973 100644 --- a/Sketchup.html +++ b/Sketchup.html @@ -1351,7 +1351,7 @@

-

The size_viewport method changes the pixel size of the viewport and SketchUp window.

+

The Sketchup.resize_viewport method changes the pixel size of the viewport and SketchUp window.

@@ -4717,6 +4717,19 @@

+
  • + + with_status + + + (Boolean) + + + (defaults to: true) + + +
  • +

    Returns:

    @@ -4731,7 +4744,7 @@

    -

    status code if opening the file succeeded, false otherwise.

    +

    status code if opening with with_status set to true, otherwise true or false.

    @@ -5885,7 +5898,24 @@

    -

    The size_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.

    +
    + 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
    +
    +
    +
    + + +

    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.

    @@ -5990,6 +6020,22 @@

    + +

    Known Bugs:

    +
      + +
    • + + + + + +
      +

      In SketchUp 2023.1 this method didn't behave correctly on Windows. No known workarounds.

      +
      + +
    • +

    diff --git a/Sketchup/Entity.html b/Sketchup/Entity.html index 2f5cea7..e84cf56 100644 --- a/Sketchup/Entity.html +++ b/Sketchup/Entity.html @@ -443,7 +443,7 @@

    -

    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.

    @@ -587,7 +587,7 @@

    -

    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.

    @@ -1493,7 +1493,7 @@

    -

    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.

    @@ -1504,23 +1504,10 @@

    Examples:

    -
    depth = 100
    -width = 100
    -model = Sketchup.active_model
    +      
    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.inspect

    @@ -1534,14 +1521,16 @@

    - — -
    -

    the string representation of the entity if successful

    -
    - + +

    See Also:

    +

    Version:

    diff --git a/Sketchup/Model.html b/Sketchup/Model.html index cb26b45..607dba2 100644 --- a/Sketchup/Model.html +++ b/Sketchup/Model.html @@ -738,7 +738,7 @@

    -

    The close method is used to close this model.

    +

    The #close method is used to close this model.

    @@ -3417,7 +3417,15 @@

    -

    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.

    +
    + 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.

    +
    +
    + + +

    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.

    @@ -3457,7 +3465,7 @@

    -

    If true, model changes will be ignored and save prompts will be suppressed. If false, changes will not be ignored and save prompts will be displayed normally.

    +

    If `true`, model changes will be ignored and save prompts will be suppressed. If `false`, changes will not be ignored and save prompts will be displayed normally.

    diff --git a/Sketchup/PickHelper.html b/Sketchup/PickHelper.html index 398db65..1da1dae 100644 --- a/Sketchup/PickHelper.html +++ b/Sketchup/PickHelper.html @@ -650,7 +650,7 @@

  • - #view ⇒ Object + #view ⇒ Sketchup::View @@ -665,7 +665,7 @@

    -

    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 PickHelper.

  • @@ -2530,7 +2530,7 @@

    - #viewObject + #viewSketchup::View @@ -2539,7 +2539,7 @@

    -

    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.

    @@ -2550,7 +2550,9 @@

    Examples:

    -
    view = pickhelper.view
    +
    view = Sketchup.active_model.active_view
    +ph = view.pick_helper
    +ph.view

    @@ -2560,14 +2562,9 @@

  • - - + (Sketchup::View) - -
    -

    view - the associated view

    -
  • diff --git a/Sketchup/RenderingOptions.html b/Sketchup/RenderingOptions.html index deb8c1a..d4eeda9 100644 --- a/Sketchup/RenderingOptions.html +++ b/Sketchup/RenderingOptions.html @@ -346,6 +346,15 @@

    Overview

    ROPDrawHiddenObjects

    +

    Added in SketchUp 2024.0:

    +
    • +

      AmbientOcclusion

      +
    • +

      AmbientOcclusionDistance

      +
    • +

      AmbientOcclusionIntensity

      +
    +
    @@ -574,6 +583,15 @@

    Sketchup::RenderingOptions::ROPTransparencySortMethod
    +
    Sketchup::RenderingOptions::ROPSetAOEnabled +
    + +
    Sketchup::RenderingOptions::ROPSetAODistance +
    + +
    Sketchup::RenderingOptions::ROPSetAOIntensity +
    +
    Sketchup::RenderingOptions::ROPSetFaceColorMode
    @@ -1268,6 +1286,24 @@

    + +

    Raises:

    +

    Version:

    + + + +
    +

    + + + #graphics_engineSymbol + + + + + +

    +
    + +

    The #graphics_engine method is used query the type of the graphics engine that's currently used by this view.

    + + +
    +
    +
    + +
    +

    Examples:

    + + +
    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
    + +
    + +

    Returns:

    +
      + +
    • + + + (Symbol) + + + + — +
      +

      Type of the graphics engine. :graphics_engine_classic or :graphics_engine_2024

      +
      + +
    • + +
    +

    Version:

    +
      + +
    • + + + + + +
      +

      SketchUp 2024.0

      +
      + +
    • + +
    +
    diff --git a/UI.html b/UI.html index 2b61b64..fbf3394 100644 --- a/UI.html +++ b/UI.html @@ -290,7 +290,7 @@

    -

    The create_cursor method is used to create a cursor from an image file at the specified location.

    +

    The UI.create_cursor method is used to create a cursor from an image file at the specified location.

    @@ -371,7 +371,7 @@

  • - .menu(menu_name = "Plugins") ⇒ Sketchup::Menu + .menu(menu_name = "Extensions") ⇒ Sketchup::Menu @@ -1123,9 +1123,26 @@

    -

    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.

    +
    + 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.

    +
    +
    -

    Since SketchUp 2016 it is possible to provide vector images for the cursors. SVG format for Windows and PDF format for OS X.

    +
    + Note: +
    +

    Because the image is never released, avoid creating new cursors for the same image for any given tool. Cache it and reuse it.

    +
    +
    + + +

    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 Sketchup::Tool documentation for a complete example.

    + +

    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.

    @@ -1136,14 +1153,18 @@

    Examples:

    -
    cursor_id = nil
    -cursor_path = Sketchup.find_support_file("Pointer.png", "Plugins/")
    -if cursor_path
    -  cursor_id = UI.create_cursor(cursor_path, 0, 0)
    -end
    +      
    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)
    +  def onSetCursor
    +    UI.set_cursor(@cursor_id)
    +  end
     end

    @@ -1201,7 +1222,7 @@

    -

    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.

    +

    A y coordinate that is the “hotpoint” for the cursor computed from the top edge of the of your cursor image.

  • @@ -1223,12 +1244,21 @@

    -

    ID associated with the cursor

    +

    Id associated with the cursor. Use this with set_cursor in Sketchup::Tool#onSetCursor.

    + +

    See Also:

    +

    Version:

      @@ -1244,6 +1274,34 @@

      +

    +

    Known Bugs:

    +
      + +
    • + + + + + +
      +

      On macOS raster cursors are always displayed at 24x24.

      +
      + +
    • + +
    • + + + + + +
      +

      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.

      +
      + +
    • +
    @@ -1634,7 +1692,7 @@

    Overview

    } # Better to create a command object. -cmd = UI::Command.new("Tester") { +cmd = UI::Command.new("Tester") { UI.messagebox("My Command") } cmd.menu_text = "My Command" @@ -248,10 +248,10 @@

    Overview

    - Class Method Summary + Instance Method Summary # collapse

    @@ -261,7 +261,7 @@

  • - .new(menutext) { ... } ⇒ UI::Command + #extension ⇒ SketchupExtension? @@ -276,29 +276,16 @@

    -

    The new method is used to create a new command.

    +

    The #extension method returns the command's associated extension.

  • - - -

    - Instance Method Summary - # - collapse -

    - -
    +

    Instance Method Details

    @@ -834,7 +803,7 @@

    extension = Sketchup.extensions['Sandbox Tools']
    -cmd = UI::Command.new("Tester") {}
    +cmd = UI::Command.new("Tester") {}
     cmd.extension = extension
     p cmd.extension == extension
    @@ -906,7 +875,7 @@

    extension = Sketchup.extensions['Sandbox Tools']
    -cmd = UI::Command.new("Tester") {}
    +cmd = UI::Command.new("Tester") {}
     cmd.extension = extension

    @@ -970,7 +939,7 @@

    Examples:

    -
    cmd = UI::Command.new("Tester") {}
    +      
    cmd = UI::Command.new("Tester") {}
     cmd.set_validation_proc { MF_DISABLED }
     proc = cmd.get_validation_proc
    @@ -1042,7 +1011,7 @@

    toolbar = UI::Toolbar.new "Test"
     # This command displays Hello World on the screen when clicked
    -cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
     cmd.small_icon = "ToolPencilSmall.png"
     cmd.large_icon = "ToolPencilLarge.png"
     toolbar = toolbar.add_item cmd
    @@ -1117,7 +1086,7 @@ 

    toolbar = UI::Toolbar.new "Test"
     # This command displays Hello World on the screen when clicked
    -cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
     cmd.small_icon = "ToolPencilSmall.png"
     cmd.large_icon = "ToolPencilLarge.png"
     toolbar = toolbar.add_item cmd
    @@ -1216,7 +1185,7 @@ 

    Examples:

    -
    cmd = UI::Command.new("Tester") {}
    +      
    cmd = UI::Command.new("Tester") {}
     cmd.set_validation_proc { MF_DISABLED }
     proc = cmd.proc
     proc.call
    @@ -1450,7 +1419,7 @@

    # Create a command object.
    -cmd = UI::Command.new("Tester") {
    +cmd = UI::Command.new("Tester") {
       UI.messagebox("My Command")
     }
     cmd.menu_text = "My Command"
    @@ -1594,7 +1563,7 @@ 

    toolbar = UI::Toolbar.new "Test"
     # This toolbar command displays Hello World on the screen when clicked.
    -cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
     cmd.small_icon = "ToolPencilSmall.png"
     cmd.large_icon = "ToolPencilLarge.png"
     toolbar = toolbar.add_item cmd
    @@ -1669,7 +1638,7 @@ 

    toolbar = UI::Toolbar.new "Test"
     # This toolbar command displays Hello World on the screen when clicked.
    -cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
     cmd.small_icon = "ToolPencilSmall.png"
     cmd.large_icon = "ToolPencilLarge.png"
     toolbar = toolbar.add_item cmd
    @@ -1768,7 +1737,7 @@ 

    toolbar = UI::Toolbar.new("Test")
     # This toolbar tool simply displays Hello World on the screen
     # when clicked
    -cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
     cmd.small_icon = "ToolPencilSmall.png"
     cmd.large_icon = "ToolPencilLarge.png"
     cmd.status_bar_text = "Testing the toolbars class."
    @@ -1842,7 +1811,7 @@ 

    toolbar = UI::Toolbar.new("Test")
     # This toolbar tool simply displays Hello World on the screen when clicked
    -cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
     cmd.small_icon = "ToolPencilSmall.png"
     cmd.large_icon = "ToolPencilLarge.png"
     cmd.status_bar_text = "Testing the toolbars class."
    @@ -1941,7 +1910,7 @@ 

    toolbar = UI::Toolbar.new "Test"
     # This command displays Hello World on the screen when clicked
    -cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
     cmd.tooltip = "Hello World Tool"
     toolbar = toolbar.add_item cmd
     toolbar.show
    @@ -2021,7 +1990,7 @@ 

    toolbar = UI::Toolbar.new "Test"
     # This command displays Hello World on the screen when clicked
    -cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
     cmd.tooltip = "Hello World Tool"
     toolbar = toolbar.add_item cmd
     toolbar.show
    diff --git a/UI/HtmlDialog.html b/UI/HtmlDialog.html index f0d1209..d661de0 100644 --- a/UI/HtmlDialog.html +++ b/UI/HtmlDialog.html @@ -187,6 +187,14 @@

    Overview

    +
    + 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.

    +
    +
    + +

    The Ruby HtmlDialog class allows you to create and interact with HTML dialog boxes from Ruby. This is the best way to generate complex, embedded UIs inside SketchUp, but it does generally require HTML and JavaScript expertise.

    If your goal is to simple display a website to your users, consider using #openURL, which will show them a web page in their default browser rather than inside a dialog in SketchUp.

    @@ -196,7 +204,10 @@

    Overview

    For usage examples, including how to migrate from the old WebDialog class, see github.com/SketchUp/htmldialog-examples. You may use the Trimble Modus framework for a look and feel of your dialog that matches that of SketchUp's dialogs.

    HtmlDialog uses the following versions of CEF (Chromium Embedded Framework):

    -
    SketchUp 2021.1 +
    SketchUp 2024.0 +
    +

    CEF 112

    +
    SketchUp 2021.1

    CEF 88

    SketchUp 2019.0 diff --git a/UI/Toolbar.html b/UI/Toolbar.html index 59747b2..0101774 100644 --- a/UI/Toolbar.html +++ b/UI/Toolbar.html @@ -207,7 +207,7 @@

    Overview

    toolbar = UI::Toolbar.new "Test"
     # This toolbar icon simply displays Hello World on the screen
    -cmd = UI::Command.new("Test") {
    +cmd = UI::Command.new("Test") {
       UI.messagebox "Hello World"
     }
     cmd.small_icon = "ToolPencilSmall.png"
    @@ -945,10 +945,10 @@ 

    toolbar = UI::Toolbar.new "Test"
     # This command displays Hello World on the screen when clicked
    -cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
     toolbar.add_item cmd
     toolbar = toolbar.add_separator
    -cmd = UI::Command.new("Test 2") { UI.messagebox("Hello World 2") }
    +cmd = UI::Command.new("Test 2") { UI.messagebox("Hello World 2") }
     toolbar.add_item cmd
     toolbar.show
     toolbar.each { | item |
    @@ -1104,7 +1104,7 @@ 

    toolbar = UI::Toolbar.new "Test"
     # This toolbar icon simply displays Hello World on the screen
    -cmd = UI::Command.new("Test") {
    +cmd = UI::Command.new("Test") {
       UI.messagebox "Hello World"
     }
     cmd.small_icon = "ToolPencilSmall.png"
    @@ -1247,10 +1247,10 @@ 

    toolbar = UI::Toolbar.new "Test"
     # This command displays Hello World on the screen when clicked
    -cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
    +cmd = UI::Command.new("Test") { UI.messagebox("Hello World") }
     toolbar.add_item cmd
     toolbar = toolbar.add_separator
    -cmd = UI::Command.new("Test 2") { UI.messagebox("Hello World 2") }
    +cmd = UI::Command.new("Test 2") { UI.messagebox("Hello World 2") }
     puts toolbar.name
     toolbar.show
    @@ -1381,7 +1381,7 @@

    toolbar = UI::Toolbar.new "Test"
     # This toolbar icon simply displays Hello World on the screen
    -cmd = UI::Command.new("Test") {
    +cmd = UI::Command.new("Test") {
       UI.messagebox "Hello World"
     }
     cmd.small_icon = "ToolPencilSmall.png"
    diff --git a/_index.html b/_index.html
    index 283f94c..a42aaca 100644
    --- a/_index.html
    +++ b/_index.html
    @@ -156,25 +156,25 @@ 

    File Listing

  • SketchUp Ruby API
  • -
  • Generating Geometry
  • +
  • Exporter Options
  • Extension Requirements
  • -
  • Exporter Options
  • +
  • Generating Geometry
  • -
  • Terms Of Service
  • +
  • Importer Options
  • -
  • Release Notes
  • +
  • Protecting Intellectual Property
  • -
  • Importer Options
  • +
  • Release Notes
  • -
  • Protecting Intellectual Property
  • +
  • Terms Of Service
  • LayOut Ruby API
  • @@ -489,16 +489,16 @@

    Namespace Listing A-Z

  • - Entities + Entities - (Layout) + (Sketchup)
  • - Entities + Entities - (Sketchup) + (Layout)
  • @@ -601,16 +601,16 @@

    Namespace Listing A-Z

  • - Group + Group - (Sketchup) + (Layout)
  • - Group + Group - (Layout) + (Sketchup)
  • @@ -648,16 +648,16 @@

    Namespace Listing A-Z