sketchup-api-stubs 0.7.10 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs/sketchup.rb +6 -0
- data/lib/sketchup-api-stubs/stubs/Array.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +25 -15
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +17 -32
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +62 -39
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +136 -104
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +56 -30
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +76 -52
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +35 -31
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +8 -16
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +135 -110
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +207 -222
- data/lib/sketchup-api-stubs/stubs/Geom.rb +6 -6
- data/lib/sketchup-api-stubs/stubs/LanguageHandler.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +11 -7
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Dictionary.rb +234 -0
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +124 -10
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +112 -4
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +4 -4
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +56 -9
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +100 -1
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +13 -14
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +5 -3
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/ReferenceEntity.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +47 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Length.rb +9 -1
- data/lib/sketchup-api-stubs/stubs/Numeric.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +65 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +2 -7
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +16 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +13 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +8 -14
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +10 -15
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +28 -14
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +15 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +7 -12
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +4 -10
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +17 -15
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +17 -17
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +3 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +11 -14
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +59 -19
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +3 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Environment.rb +406 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Environments.rb +185 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/EnvironmentsObserver.rb +113 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +3 -6
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +94 -25
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +16 -26
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +24 -17
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +11 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +4 -67
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +34 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +4 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +14 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +3 -45
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +1 -19
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +1 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +10 -3
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/LoadHandler.rb +70 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +831 -130
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +35 -22
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +146 -88
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +20 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +14 -11
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Overlay.rb +17 -44
- data/lib/sketchup-api-stubs/stubs/Sketchup/OverlaysManager.rb +1 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +158 -16
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +48 -21
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +61 -40
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +13 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +84 -91
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +9 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Snap.rb +125 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +20 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +59 -13
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +29 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +13 -31
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +9 -9
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +229 -139
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +23 -22
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +336 -99
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +34 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup.rb +71 -36
- data/lib/sketchup-api-stubs/stubs/SketchupExtension.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/String.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +21 -9
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +80 -5
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +14 -3
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +20 -3
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +9 -6
- data/lib/sketchup-api-stubs/stubs/UI.rb +77 -14
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +7 -7
- metadata +10 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# References a collection of style attributes that determine the visual
|
|
@@ -102,6 +102,9 @@ class Layout::Style
|
|
|
102
102
|
STROKE_PATTERN_SHORT_DASH = nil # Stub value.
|
|
103
103
|
STROKE_PATTERN_SOLID = nil # Stub value.
|
|
104
104
|
|
|
105
|
+
STRIKETHROUGH_NONE = nil # Stub value.
|
|
106
|
+
STRIKETHROUGH_SINGLE = nil # Stub value.
|
|
107
|
+
|
|
105
108
|
SUPER_SCRIPT = nil # Stub value.
|
|
106
109
|
|
|
107
110
|
SUB_SCRIPT = nil # Stub value.
|
|
@@ -1471,6 +1474,49 @@ class Layout::Style
|
|
|
1471
1474
|
def text_italic=(italic)
|
|
1472
1475
|
end
|
|
1473
1476
|
|
|
1477
|
+
# The {#text_strikethrough} method returns the text strike through type, or +nil+ if the
|
|
1478
|
+
# {Layout::Style} does not have a value for that setting.
|
|
1479
|
+
#
|
|
1480
|
+
# The strikethrough type can be one of the following values:
|
|
1481
|
+
# [+Layout::Style::STRIKETHROUGH_NONE+]
|
|
1482
|
+
# [+Layout::Style::STRIKETHROUGH_SINGLE+]
|
|
1483
|
+
#
|
|
1484
|
+
# @example
|
|
1485
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
1486
|
+
# page = doc.pages.first
|
|
1487
|
+
# entity = page.entities.first
|
|
1488
|
+
# style = entity.style
|
|
1489
|
+
# strikethrough_type = style.text_strikethrough
|
|
1490
|
+
#
|
|
1491
|
+
# @return [Integer, nil]
|
|
1492
|
+
#
|
|
1493
|
+
# @version LayOut 2026.0
|
|
1494
|
+
def text_strikethrough
|
|
1495
|
+
end
|
|
1496
|
+
|
|
1497
|
+
# The {#text_strikethrough=} method sets the text strike through type.
|
|
1498
|
+
#
|
|
1499
|
+
# The strikethrough type can be one of the following values:
|
|
1500
|
+
# [+Layout::Style::STRIKETHROUGH_NONE+]
|
|
1501
|
+
# [+Layout::Style::STRIKETHROUGH_SINGLE+]
|
|
1502
|
+
#
|
|
1503
|
+
# @example
|
|
1504
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
1505
|
+
# page = doc.pages.first
|
|
1506
|
+
# entity = page.entities.first
|
|
1507
|
+
# style = entity.style
|
|
1508
|
+
# style.text_strikethrough = Layout::Style::STRIKETHROUGH_SINGLE
|
|
1509
|
+
# # Set the style to apply changes
|
|
1510
|
+
# entity.style = style
|
|
1511
|
+
#
|
|
1512
|
+
# @param [Integer] strikethrough_type
|
|
1513
|
+
#
|
|
1514
|
+
# @raise [ArgumentError] if strikethrough_type is not a valid strike through type
|
|
1515
|
+
#
|
|
1516
|
+
# @version LayOut 2026.0
|
|
1517
|
+
def text_strikethrough=(strikethrough_type)
|
|
1518
|
+
end
|
|
1519
|
+
|
|
1474
1520
|
# The {#text_underline} method returns the text underline type, or +nil+ if the
|
|
1475
1521
|
# {Layout::Style} does not have a value for that setting.
|
|
1476
1522
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# Because length units are used so often in SketchUp, a special class has been
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
# Internally, all lengths in SketchUp are stored in inches. The Length class
|
|
9
9
|
# stores values in inches as well. A number of methods have been added to the
|
|
10
10
|
# Ruby Numeric class to do units conversions.
|
|
11
|
+
# {Find more info about units and lengths in this
|
|
12
|
+
# article}[https://developer.sketchup.com/article-lengthsandunits].
|
|
11
13
|
#
|
|
12
14
|
# The setting for the Length Format and Length Unit can be retrieved from the
|
|
13
15
|
# {Sketchup::Model#options} by querying the +"UnitsOptions"+
|
|
@@ -56,6 +58,12 @@
|
|
|
56
58
|
# @note Prior to SketchUp 2015, +Length+ used to be derived from +Float+. This
|
|
57
59
|
# is no longer the case.
|
|
58
60
|
#
|
|
61
|
+
# @note When serializing a Length object to a string to save for later use, e.g.
|
|
62
|
+
# in a config file, first convert them to Float objects. The string representation
|
|
63
|
+
# of a Length is rounded and uses the local decimal separator which can lead to
|
|
64
|
+
# data loss and portability issues. The string representation is intended for
|
|
65
|
+
# humans, not computers.
|
|
66
|
+
#
|
|
59
67
|
# @version SketchUp 6.0
|
|
60
68
|
class Length < Float
|
|
61
69
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The {Sketchup::Animation} interface is implemented to create animations
|
|
@@ -6,24 +6,47 @@
|
|
|
6
6
|
# {Sketchup::View}. To make your own, build a Ruby class that contains the
|
|
7
7
|
# methods described below:
|
|
8
8
|
#
|
|
9
|
-
# # This
|
|
10
|
-
# #
|
|
11
|
-
# #
|
|
12
|
-
#
|
|
13
|
-
#
|
|
9
|
+
# # This example demonstrates a simple animation with implementation of
|
|
10
|
+
# # the optional callback method stop, which is invoked
|
|
11
|
+
# # by SketchUp during specific animation events.
|
|
12
|
+
# class SimpleFloatAnimation
|
|
13
|
+
# def initialize
|
|
14
|
+
# @speed = 1.0 # Camera movement speed
|
|
15
|
+
# puts "Animation initialized"
|
|
16
|
+
# end
|
|
17
|
+
#
|
|
18
|
+
# # Required method - called for each animation frame
|
|
14
19
|
# def nextFrame(view)
|
|
20
|
+
# # Move camera upward
|
|
15
21
|
# new_eye = view.camera.eye
|
|
16
|
-
# new_eye.z = new_eye.z +
|
|
22
|
+
# new_eye.z = new_eye.z + @speed
|
|
17
23
|
# view.camera.set(new_eye, view.camera.target, view.camera.up)
|
|
18
24
|
# view.show_frame
|
|
25
|
+
#
|
|
26
|
+
# # Continue animation until reaching maximum height
|
|
19
27
|
# return new_eye.z < 500.0
|
|
20
28
|
# end
|
|
21
|
-
# end
|
|
22
29
|
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
30
|
+
# # Optional callback - called by SketchUp when animation is stopped
|
|
31
|
+
# # Note: This method is called automatically by SketchUp and cannot
|
|
32
|
+
# # be called directly to stop an animation
|
|
33
|
+
# def stop
|
|
34
|
+
# puts "Animation was stopped by SketchUp"
|
|
35
|
+
# # Cleanup code when animation ends
|
|
36
|
+
# end
|
|
37
|
+
# end
|
|
38
|
+
#
|
|
39
|
+
# # Add menu item to start the animation
|
|
40
|
+
# UI.menu("Camera").add_item("Start Animation") {
|
|
41
|
+
# animation = SimpleFloatAnimation.new
|
|
42
|
+
# Sketchup.active_model.active_view.animation = animation
|
|
43
|
+
# }
|
|
44
|
+
#
|
|
45
|
+
# # To stop the animation programmatically:
|
|
46
|
+
# UI.menu("Camera").add_item("Stop Animation") {
|
|
47
|
+
# # Setting animation to nil will trigger the stop method in our animation class
|
|
48
|
+
# Sketchup.active_model.active_view.animation = nil
|
|
49
|
+
# }
|
|
27
50
|
#
|
|
28
51
|
# {Sketchup::Animation} objects are activated by using the
|
|
29
52
|
# {Sketchup::View#animation=} method on a {Sketchup::View}
|
|
@@ -32,6 +55,35 @@
|
|
|
32
55
|
#
|
|
33
56
|
# Sketchup.active_model.active_view.animation = nil
|
|
34
57
|
#
|
|
58
|
+
#
|
|
59
|
+
# ==Managing Multiple Animations:
|
|
60
|
+
#
|
|
61
|
+
# While only one animation object can be active on a {Sketchup::View} at any
|
|
62
|
+
# given time, you can create a composite animation class to manage multiple
|
|
63
|
+
# animations simultaneously. This approach allows you to animate different
|
|
64
|
+
# elements, such as objects and the camera, within a single animation framework.
|
|
65
|
+
#
|
|
66
|
+
# Example: Combining Animations
|
|
67
|
+
#
|
|
68
|
+
# class CombinedAnimation
|
|
69
|
+
# def initialize(object_animation, camera_animation)
|
|
70
|
+
# @object_animation = object_animation
|
|
71
|
+
# @camera_animation = camera_animation
|
|
72
|
+
# end
|
|
73
|
+
#
|
|
74
|
+
# def nextFrame(view)
|
|
75
|
+
# @object_animation.nextFrame(view)
|
|
76
|
+
# @camera_animation.nextFrame(view)
|
|
77
|
+
# true
|
|
78
|
+
# end
|
|
79
|
+
# end
|
|
80
|
+
#
|
|
81
|
+
# # Usage
|
|
82
|
+
# object_animation = RotateAnimation.new
|
|
83
|
+
# camera_animation = RotateCamera.new(0.01)
|
|
84
|
+
# combined_animation = CombinedAnimation.new(object_animation, camera_animation)
|
|
85
|
+
# Sketchup.active_model.active_view.animation = combined_animation
|
|
86
|
+
#
|
|
35
87
|
# @abstract Implement the methods described in this class to create a an
|
|
36
88
|
# animation. You can not sub-class this class because it is not defined by
|
|
37
89
|
# the API.
|
|
@@ -131,7 +183,7 @@ class Sketchup::Animation
|
|
|
131
183
|
# end
|
|
132
184
|
# end
|
|
133
185
|
#
|
|
134
|
-
# @note Do not call {
|
|
186
|
+
# @note Do not call {Sketchup::View#animation=} from this method. This will
|
|
135
187
|
# cause a recursive loop and crash SketchUp 2017 and earlier versions.
|
|
136
188
|
# As of SketchUp 2018 this will raise a +RunTimeError+.
|
|
137
189
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The AttributeDictionaries class is a collection of all of the
|
|
@@ -33,14 +33,9 @@ class Sketchup::AttributeDictionaries < Sketchup::Entity
|
|
|
33
33
|
#
|
|
34
34
|
# @example
|
|
35
35
|
# model = Sketchup.active_model
|
|
36
|
+
# value = model.set_attribute("my_dictionary", "test", 110)
|
|
36
37
|
# attrdicts = model.attribute_dictionaries
|
|
37
|
-
# # Iterates through all dictionaries and prints to screen.
|
|
38
38
|
# dict = attrdicts['my_dictionary']
|
|
39
|
-
# if dict
|
|
40
|
-
# UI.messagebox("Found: " + dict.to_s)
|
|
41
|
-
# else
|
|
42
|
-
# UI.messagebox("No dictionary found.")
|
|
43
|
-
# end
|
|
44
39
|
#
|
|
45
40
|
# @param [String] key
|
|
46
41
|
# The name of the attribute dictionary.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The AttributeDictionary class allows you to attach arbitrary collections of
|
|
@@ -185,6 +185,20 @@ class Sketchup::AttributeDictionary < Sketchup::Entity
|
|
|
185
185
|
def each_pair
|
|
186
186
|
end
|
|
187
187
|
|
|
188
|
+
# The {#empty?} method is used to check if the attribute dictionary is empty.
|
|
189
|
+
#
|
|
190
|
+
# @example
|
|
191
|
+
# model = Sketchup.active_model
|
|
192
|
+
# attribute_dictionary = model.attribute_dictionary("example", true)
|
|
193
|
+
# attribute_dictionary["attribute_one"] = "1"
|
|
194
|
+
# attribute_dictionary.empty? # Returns false
|
|
195
|
+
#
|
|
196
|
+
# @return [Boolean] true if the attribute dictionary is empty, false otherwise
|
|
197
|
+
#
|
|
198
|
+
# @version SketchUp 2025.0
|
|
199
|
+
def empty?
|
|
200
|
+
end
|
|
201
|
+
|
|
188
202
|
# The keys method is used to retrieve an array with all of the attribute keys.
|
|
189
203
|
#
|
|
190
204
|
# @example
|
|
@@ -231,8 +245,7 @@ class Sketchup::AttributeDictionary < Sketchup::Entity
|
|
|
231
245
|
# attrdict["attr_one"] = "one"
|
|
232
246
|
# attrdict["attr_two"] = "two"
|
|
233
247
|
#
|
|
234
|
-
#
|
|
235
|
-
# UI.messagebox attrdict.name
|
|
248
|
+
# puts attrdict.name
|
|
236
249
|
#
|
|
237
250
|
# @return [String] the name of the attribute dictionary if
|
|
238
251
|
# successful
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# SketchUp's drawing axes consist of three colored lines (red, green, blue),
|
|
@@ -29,18 +29,18 @@ class Sketchup::Axes < Sketchup::Entity
|
|
|
29
29
|
def axes
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
# The origin method returns the origin of the axes.
|
|
32
|
+
# The {#origin} method returns the origin of the axes.
|
|
33
33
|
#
|
|
34
34
|
# @example
|
|
35
35
|
# point = Sketchup.active_model.axes.origin
|
|
36
36
|
#
|
|
37
|
-
# @return Point3d
|
|
37
|
+
# @return [Geom::Point3d]
|
|
38
38
|
#
|
|
39
39
|
# @version SketchUp 2016
|
|
40
40
|
def origin
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
# The set method allows the axes to be manipulated. The axes must always be
|
|
43
|
+
# The {#set} method allows the axes to be manipulated. The axes must always be
|
|
44
44
|
# orthogonal, otherwise an error is thrown.
|
|
45
45
|
#
|
|
46
46
|
# @example
|
|
@@ -60,7 +60,7 @@ class Sketchup::Axes < Sketchup::Entity
|
|
|
60
60
|
# @param zaxis
|
|
61
61
|
# Vector3d - The z axis to set.
|
|
62
62
|
#
|
|
63
|
-
# @return Axes - the axes object being set.
|
|
63
|
+
# @return [Sketchup::Axes] - the axes object being set.
|
|
64
64
|
#
|
|
65
65
|
# @version SketchUp 2016
|
|
66
66
|
def set(origin, xaxis, yaxis, zaxis)
|
|
@@ -90,7 +90,7 @@ class Sketchup::Axes < Sketchup::Entity
|
|
|
90
90
|
def to_a
|
|
91
91
|
end
|
|
92
92
|
|
|
93
|
-
# The transformation method returns the transformation of the axes. This is
|
|
93
|
+
# The {#transformation} method returns the transformation of the axes. This is
|
|
94
94
|
# useful when creating tools that respect the model's drawing axes.
|
|
95
95
|
#
|
|
96
96
|
# @example
|
|
@@ -107,40 +107,40 @@ class Sketchup::Axes < Sketchup::Entity
|
|
|
107
107
|
# points.each { |point| point.transform!(tr) }
|
|
108
108
|
# Sketchup.active_model.active_entities.add_face(points)
|
|
109
109
|
#
|
|
110
|
-
# @return Transformation - the transformation for the axes.
|
|
110
|
+
# @return [Geom::Transformation] - the transformation for the axes.
|
|
111
111
|
#
|
|
112
112
|
# @version SketchUp 2016
|
|
113
113
|
def transformation
|
|
114
114
|
end
|
|
115
115
|
|
|
116
|
-
# The xaxis method returns the x axis of the axes.
|
|
116
|
+
# The {#xaxis} method returns the x axis of the axes.
|
|
117
117
|
#
|
|
118
118
|
# @example
|
|
119
119
|
# vector = Sketchup.active_model.axes.xaxis
|
|
120
120
|
#
|
|
121
|
-
# @return Vector3d - the x axis for the axes.
|
|
121
|
+
# @return [Geom::Vector3d] - the x axis for the axes.
|
|
122
122
|
#
|
|
123
123
|
# @version SketchUp 2016
|
|
124
124
|
def xaxis
|
|
125
125
|
end
|
|
126
126
|
|
|
127
|
-
# The yaxis method returns the y axis of the axes.
|
|
127
|
+
# The {#yaxis} method returns the y axis of the axes.
|
|
128
128
|
#
|
|
129
129
|
# @example
|
|
130
130
|
# vector = Sketchup.active_model.axes.yaxis
|
|
131
131
|
#
|
|
132
|
-
# @return Vector3d - the y axis for the axes.
|
|
132
|
+
# @return [Geom::Vector3d] - the y axis for the axes.
|
|
133
133
|
#
|
|
134
134
|
# @version SketchUp 2016
|
|
135
135
|
def yaxis
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
-
# The zaxis method returns the z axis of the axes.
|
|
138
|
+
# The {#zaxis} method returns the z axis of the axes.
|
|
139
139
|
#
|
|
140
140
|
# @example
|
|
141
141
|
# vector = Sketchup.active_model.axes.zaxis
|
|
142
142
|
#
|
|
143
|
-
# @return Vector3d - the z axis for the axes.
|
|
143
|
+
# @return [Geom::Vector3d] - the z axis for the axes.
|
|
144
144
|
#
|
|
145
145
|
# @version SketchUp 2016
|
|
146
146
|
def zaxis
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Behavior class is used to control the "behavior" of components, which
|
|
@@ -52,26 +52,20 @@ class Sketchup::Behavior < Sketchup::Entity
|
|
|
52
52
|
# definitions = model.definitions
|
|
53
53
|
# path = Sketchup.find_support_file "Bed.skp",
|
|
54
54
|
# "Components/Components Sampler/"
|
|
55
|
-
#
|
|
56
|
-
# begin
|
|
57
|
-
# definition = definitions.load path
|
|
58
|
-
# rescue
|
|
59
|
-
# UI.messagebox $!.message
|
|
60
|
-
# end
|
|
61
|
-
#
|
|
55
|
+
# definition = definitions.load path
|
|
62
56
|
# behavior = definition.behavior
|
|
63
57
|
# b = behavior.always_face_camera?
|
|
64
58
|
# if (b)
|
|
65
|
-
#
|
|
59
|
+
# puts "Component faces camera"
|
|
66
60
|
# else
|
|
67
|
-
#
|
|
61
|
+
# puts "Component does not face camera"
|
|
68
62
|
# end
|
|
69
63
|
# status = behavior.always_face_camera = true
|
|
70
64
|
# b = behavior.always_face_camera?
|
|
71
65
|
# if (b)
|
|
72
|
-
#
|
|
66
|
+
# puts "Alwas Face Camera is equal to true"
|
|
73
67
|
# else
|
|
74
|
-
#
|
|
68
|
+
# puts "Failure"
|
|
75
69
|
# end
|
|
76
70
|
#
|
|
77
71
|
# @return [Boolean] behavior - true if the component is set to always face
|
|
@@ -236,8 +230,8 @@ class Sketchup::Behavior < Sketchup::Entity
|
|
|
236
230
|
# "Components/Components Sampler/"
|
|
237
231
|
# begin
|
|
238
232
|
# definition = definitions.load path
|
|
239
|
-
# rescue
|
|
240
|
-
#
|
|
233
|
+
# rescue => exception
|
|
234
|
+
# puts exception.message
|
|
241
235
|
# end
|
|
242
236
|
#
|
|
243
237
|
# @return [Boolean] status - true if the component's is to be cast from the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Camera class contains methods for creating and manipulating a camera.
|
|
@@ -66,7 +66,7 @@ class Sketchup::Camera
|
|
|
66
66
|
# @example
|
|
67
67
|
# Sketchup.active_model.active_view.camera.center_2d
|
|
68
68
|
#
|
|
69
|
-
# @return [Geom::Point3d]
|
|
69
|
+
# @return [Geom::Point3d]
|
|
70
70
|
#
|
|
71
71
|
# @version SketchUp 2015
|
|
72
72
|
def center_2d
|
|
@@ -312,8 +312,8 @@ class Sketchup::Camera
|
|
|
312
312
|
def initialize(*args)
|
|
313
313
|
end
|
|
314
314
|
|
|
315
|
-
# The {#is_2d?} method indicates
|
|
316
|
-
# mode.
|
|
315
|
+
# The {#is_2d?} method indicates whether the camera mode is two-point perspective or match photo
|
|
316
|
+
# mode, as opposed to a normal perspective or parallel projection camera.
|
|
317
317
|
#
|
|
318
318
|
# @example
|
|
319
319
|
# Sketchup.active_model.active_view.camera.is_2d?
|
|
@@ -365,7 +365,7 @@ class Sketchup::Camera
|
|
|
365
365
|
# @example
|
|
366
366
|
# Sketchup.active_model.active_view.camera.scale_2d
|
|
367
367
|
#
|
|
368
|
-
# @return
|
|
368
|
+
# @return [Float]
|
|
369
369
|
#
|
|
370
370
|
# @version SketchUp 2015
|
|
371
371
|
def scale_2d
|
|
@@ -388,7 +388,7 @@ class Sketchup::Camera
|
|
|
388
388
|
# @param [Geom::Point3d] target
|
|
389
389
|
# See {#target}.
|
|
390
390
|
#
|
|
391
|
-
# @param [Geom::
|
|
391
|
+
# @param [Geom::Vector3d] up
|
|
392
392
|
# See {#up}.
|
|
393
393
|
#
|
|
394
394
|
# @return [Sketchup::Camera]
|
|
@@ -432,7 +432,7 @@ class Sketchup::Camera
|
|
|
432
432
|
# camera = Sketchup::Camera.new
|
|
433
433
|
# xaxis = camera.xaxis
|
|
434
434
|
#
|
|
435
|
-
# @return [Geom::Vector3d]
|
|
435
|
+
# @return [Geom::Vector3d]
|
|
436
436
|
#
|
|
437
437
|
# @version SketchUp 6.0
|
|
438
438
|
def xaxis
|
|
@@ -449,7 +449,7 @@ class Sketchup::Camera
|
|
|
449
449
|
# # 0.0, 1.0, 0.0
|
|
450
450
|
# yaxis = camera.yaxis
|
|
451
451
|
#
|
|
452
|
-
# @return [Geom::Vector3d]
|
|
452
|
+
# @return [Geom::Vector3d]
|
|
453
453
|
#
|
|
454
454
|
# @version SketchUp 6.0
|
|
455
455
|
def yaxis
|
|
@@ -462,14 +462,9 @@ class Sketchup::Camera
|
|
|
462
462
|
# @example
|
|
463
463
|
# camera = Sketchup::Camera.new
|
|
464
464
|
# # 0.0, 1.0, 0.0
|
|
465
|
-
#
|
|
466
|
-
# if (v)
|
|
467
|
-
# UI.messagebox v.to_s
|
|
468
|
-
# else
|
|
469
|
-
# UI.messagebox "Failure"
|
|
470
|
-
# end
|
|
465
|
+
# vector = camera.zaxis
|
|
471
466
|
#
|
|
472
|
-
# @return
|
|
467
|
+
# @return [Geom::Vector3d]
|
|
473
468
|
#
|
|
474
469
|
# @version SketchUp 6.0
|
|
475
470
|
def zaxis
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Classifications class is a container/manager for all classifications in
|
|
@@ -77,7 +77,7 @@ class Sketchup::Classifications
|
|
|
77
77
|
#
|
|
78
78
|
# @example
|
|
79
79
|
# c = Sketchup.active_model.classifications
|
|
80
|
-
# file = Sketchup.find_support_file('
|
|
80
|
+
# file = Sketchup.find_support_file('IFC4.skc', 'Classifications')
|
|
81
81
|
# status = c.load_schema(file) if !file.nil?
|
|
82
82
|
#
|
|
83
83
|
# @param file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The {Sketchup::ComponentDefinition} class is used to define the contents for
|
|
@@ -37,7 +37,7 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
|
37
37
|
# c2=Sketchup.find_support_file "Fence.skp",
|
|
38
38
|
# "Components/Components Sampler/"
|
|
39
39
|
# if c1 <=> c2
|
|
40
|
-
#
|
|
40
|
+
# puts "c1 sorts before c2"
|
|
41
41
|
# end
|
|
42
42
|
#
|
|
43
43
|
# @param [Sketchup::ComponentDefinition] compdef2
|
|
@@ -58,9 +58,7 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
|
58
58
|
# "Components/Components Sampler/"
|
|
59
59
|
# c2=Sketchup.find_support_file "Fence.skp",
|
|
60
60
|
# "Components/Components Sampler/"
|
|
61
|
-
#
|
|
62
|
-
# UI.messagebox("These definitions are the same.")
|
|
63
|
-
# end
|
|
61
|
+
# c1 == c2
|
|
64
62
|
#
|
|
65
63
|
# @param [Sketchup::ComponentDefinition] compdef2
|
|
66
64
|
# The second component definition in the comparison.
|
|
@@ -258,8 +256,15 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
|
258
256
|
def guid
|
|
259
257
|
end
|
|
260
258
|
|
|
261
|
-
# The hidden method is used to determine if this component definition
|
|
262
|
-
#
|
|
259
|
+
# The {#hidden?} method is used to determine if this component definition is
|
|
260
|
+
# hidden in the component browser.
|
|
261
|
+
#
|
|
262
|
+
# This is based on how its instances are placed
|
|
263
|
+
# in the model hierarchy. For more details, see
|
|
264
|
+
# {this article}[https://developer.sketchup.com/article-hiddensubcomponents].
|
|
265
|
+
#
|
|
266
|
+
# In addition, component definitions used by Groups and Images are always hidden
|
|
267
|
+
# in the Component Browser. See {#group?} and {#image?}.
|
|
263
268
|
#
|
|
264
269
|
# @example
|
|
265
270
|
# componentdefinition = Sketchup.active_model.definitions[0]
|
|
@@ -277,12 +282,6 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
|
277
282
|
# @example
|
|
278
283
|
# componentdefinition = Sketchup.active_model.definitions[0]
|
|
279
284
|
# status = componentdefinition.image?
|
|
280
|
-
# if (status)
|
|
281
|
-
# UI.messagebox "Component definition defines an image"
|
|
282
|
-
# else
|
|
283
|
-
# UI.messagebox status.to_s
|
|
284
|
-
# UI.messagebox "Component definition does not define an image"
|
|
285
|
-
# end
|
|
286
285
|
#
|
|
287
286
|
# @return [Boolean]
|
|
288
287
|
#
|
|
@@ -408,6 +407,21 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
|
408
407
|
def live_component?
|
|
409
408
|
end
|
|
410
409
|
|
|
410
|
+
# The {#load_time} method gets the load time of the component definition. For an internal
|
|
411
|
+
# component definition, this is the time that it was created. For an external component
|
|
412
|
+
# definition, this is the time that it was added to the model.
|
|
413
|
+
#
|
|
414
|
+
# @example
|
|
415
|
+
# model = Sketchup.active_model
|
|
416
|
+
# definition = model.definitions.first
|
|
417
|
+
# definition.load_time
|
|
418
|
+
#
|
|
419
|
+
# @return [Time]
|
|
420
|
+
#
|
|
421
|
+
# @version SketchUp 2025.0
|
|
422
|
+
def load_time
|
|
423
|
+
end
|
|
424
|
+
|
|
411
425
|
# The name method retrieves the name of the component definition.
|
|
412
426
|
#
|
|
413
427
|
# @example
|
|
@@ -542,7 +556,7 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
|
542
556
|
# See {Sketchup::Model#save} for supported values.
|
|
543
557
|
# @version SketchUp 2022.0
|
|
544
558
|
#
|
|
545
|
-
# @return [Boolean] true if successful
|
|
559
|
+
# @return [Boolean] true if successful, false otherwise
|
|
546
560
|
def save_as(*args)
|
|
547
561
|
end
|
|
548
562
|
|