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
|
# The Geom module defines a number of Module methods that let you perform
|
|
@@ -73,12 +73,12 @@ module Geom
|
|
|
73
73
|
# @param [Geom::Point3d] point1
|
|
74
74
|
# @param [Geom::Point3d] point2
|
|
75
75
|
# @param [Geom::Point3d] point3
|
|
76
|
-
# @return [Array(
|
|
76
|
+
# @return [Array(Float, Float, Float, Float)] A plane
|
|
77
77
|
#
|
|
78
78
|
# @overload fit_plane_to_points(points)
|
|
79
79
|
#
|
|
80
80
|
# @param [Array<Geom::Point3d>] points
|
|
81
|
-
# @return [Array(
|
|
81
|
+
# @return [Array(Float, Float, Float, Float)] A plane
|
|
82
82
|
#
|
|
83
83
|
# @version SketchUp 6.0
|
|
84
84
|
def self.fit_plane_to_points(*args)
|
|
@@ -125,7 +125,7 @@ module Geom
|
|
|
125
125
|
#
|
|
126
126
|
# @param [Array(Geom::Point3d, Geom::Vector3d)] line
|
|
127
127
|
#
|
|
128
|
-
# @param [Array(Geom::Point3d, Geom::
|
|
128
|
+
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane
|
|
129
129
|
#
|
|
130
130
|
# @return [Geom::Point3d, nil] A Point3d object. Returns +nil+ if they do not
|
|
131
131
|
# intersect.
|
|
@@ -149,11 +149,11 @@ module Geom
|
|
|
149
149
|
# # This will return a line [Point3d(10, 20, 0), Vector3d(0, 0, 1)].
|
|
150
150
|
# line = Geom.intersect_plane_plane(plane1, plane2)
|
|
151
151
|
#
|
|
152
|
-
# @param [Array(Geom::Point3d, Geom::
|
|
152
|
+
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane1
|
|
153
153
|
# The first plane to
|
|
154
154
|
# intersect
|
|
155
155
|
#
|
|
156
|
-
# @param [Array(Geom::Point3d, Geom::
|
|
156
|
+
# @param [Array(Geom::Point3d, Geom::Vector3d)] plane2
|
|
157
157
|
# The second plane to
|
|
158
158
|
# intersect
|
|
159
159
|
#
|
|
@@ -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 an auto-text definition. Some auto-text definitions are mandatory.
|
|
@@ -451,8 +451,8 @@ class Layout::AutoTextDefinition
|
|
|
451
451
|
# [+Layout::AutoTextDefinition::NUMBER_STYLE_LC_ROMAN+]
|
|
452
452
|
#
|
|
453
453
|
# @deprecated LayOut 2022.0 This method is deprecated in favor of the more generic {#number_style}
|
|
454
|
-
# method that also works on +Layout::
|
|
455
|
-
# +Layout::
|
|
454
|
+
# method that also works on +Layout::AutoTextDefinition::TYPE_PAGE_COUNT+ and
|
|
455
|
+
# +Layout::AutoTextDefinition::TYPE_SEQUENCE+ {Layout::AutoTextDefinition}s.
|
|
456
456
|
#
|
|
457
457
|
# @example
|
|
458
458
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -460,7 +460,9 @@ class Layout::AutoTextDefinition
|
|
|
460
460
|
# Layout::AutoTextDefinition::TYPE_PAGE_NUMBER) number_style = page_number_def.number_style
|
|
461
461
|
#
|
|
462
462
|
# @raise [ArgumentError] if the {Layout::AutoTextDefinition}'s type is not
|
|
463
|
-
# +Layout::AutoTextDefinition::TYPE_PAGE_NUMBER
|
|
463
|
+
# +Layout::AutoTextDefinition::TYPE_PAGE_NUMBER+,
|
|
464
|
+
# +Layout::AutoTextDefinition::TYPE_PAGE_COUNT+, or
|
|
465
|
+
# +Layout::AutoTextDefinition::TYPE_SEQUENCE+.
|
|
464
466
|
#
|
|
465
467
|
# @return [Integer]
|
|
466
468
|
#
|
|
@@ -480,8 +482,8 @@ class Layout::AutoTextDefinition
|
|
|
480
482
|
# [+Layout::AutoTextDefinition::NUMBER_STYLE_LC_ROMAN+]
|
|
481
483
|
#
|
|
482
484
|
# @deprecated LayOut 2022.0 This method is deprecated in favor of the more generic {#number_style=}
|
|
483
|
-
# method that also works on +Layout::
|
|
484
|
-
# +Layout::
|
|
485
|
+
# method that also works on +Layout::AutoTextDefinition::TYPE_PAGE_COUNT+ and
|
|
486
|
+
# +Layout::AutoTextDefinition::TYPE_SEQUENCE+ {Layout::AutoTextDefinition}s.
|
|
485
487
|
#
|
|
486
488
|
# @example
|
|
487
489
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -492,7 +494,9 @@ class Layout::AutoTextDefinition
|
|
|
492
494
|
# @param [Integer] number_style
|
|
493
495
|
#
|
|
494
496
|
# @raise [ArgumentError] if the {Layout::AutoTextDefinition}'s type is not
|
|
495
|
-
# +Layout::AutoTextDefinition::TYPE_PAGE_NUMBER
|
|
497
|
+
# +Layout::AutoTextDefinition::TYPE_PAGE_NUMBER+,
|
|
498
|
+
# +Layout::AutoTextDefinition::TYPE_PAGE_COUNT+, or
|
|
499
|
+
# +Layout::AutoTextDefinition::TYPE_SEQUENCE+.
|
|
496
500
|
#
|
|
497
501
|
# @raise [ArgumentError] if +number_style+ is not a valid page numbering style
|
|
498
502
|
#
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
|
+
# License:: The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
# This is the interface to a LayOut dictionary. A {Layout::Dictionary} wraps key/value pairs.
|
|
5
|
+
#
|
|
6
|
+
# @example
|
|
7
|
+
# dict = Layout::Dictionary.new
|
|
8
|
+
#
|
|
9
|
+
# @version LayOut 2026.0
|
|
10
|
+
class Layout::Dictionary
|
|
11
|
+
|
|
12
|
+
# Includes
|
|
13
|
+
|
|
14
|
+
include Enumerable
|
|
15
|
+
|
|
16
|
+
# Instance Methods
|
|
17
|
+
|
|
18
|
+
# The {#[]} method retrieves the value for a given key.
|
|
19
|
+
#
|
|
20
|
+
# @example
|
|
21
|
+
# dictionary = Layout::Dictionary.new
|
|
22
|
+
# dictionary['test'] = 115
|
|
23
|
+
#
|
|
24
|
+
# # value will contain 115
|
|
25
|
+
# value = dictionary["test"]
|
|
26
|
+
#
|
|
27
|
+
# @param [String] key
|
|
28
|
+
# The name of the attribute.
|
|
29
|
+
#
|
|
30
|
+
# @return [String, Boolean, Integer, Float, Layout::Dictionary, nil]
|
|
31
|
+
#
|
|
32
|
+
# @version LayOut 2026.0
|
|
33
|
+
def [](key)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# The {#[]=} method sets a value for a given key.
|
|
37
|
+
#
|
|
38
|
+
# Creates a new dictionary entry for the given key if needed.
|
|
39
|
+
#
|
|
40
|
+
# @example
|
|
41
|
+
# dictionary = Layout::Dictionary.new
|
|
42
|
+
# dictionary['test'] = 110
|
|
43
|
+
# value = dictionary['test2'] = 120
|
|
44
|
+
# p value
|
|
45
|
+
#
|
|
46
|
+
# @param [String] key
|
|
47
|
+
# The valid key.
|
|
48
|
+
#
|
|
49
|
+
# @param [String, Boolean, Integer, Float, Hash, Layout::Dictionary, nil] value
|
|
50
|
+
#
|
|
51
|
+
# @version LayOut 2026.0
|
|
52
|
+
def []=(key, value)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# The {#delete_key} method deletes a key/value pair from the dictionary.
|
|
56
|
+
#
|
|
57
|
+
# @example
|
|
58
|
+
# dictionary = Layout::Dictionary.new
|
|
59
|
+
# dictionary["attr_one"] = "one"
|
|
60
|
+
# dictionary["attr_two"] = "two"
|
|
61
|
+
#
|
|
62
|
+
# # Delete a key/value pair and get the deleted value.
|
|
63
|
+
# value = dictionary.delete_key("attr_one")
|
|
64
|
+
#
|
|
65
|
+
# @param [String] key
|
|
66
|
+
# The key to be deleted.
|
|
67
|
+
#
|
|
68
|
+
# @return [String, Boolean, Integer, Float, Layout::Dictionary, nil]
|
|
69
|
+
#
|
|
70
|
+
# @version LayOut 2026.0
|
|
71
|
+
def delete_key(key)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# The {#each_pair} method is an alias for {#each}.
|
|
75
|
+
#
|
|
76
|
+
# @example
|
|
77
|
+
# dictionary = Layout::Dictionary.new
|
|
78
|
+
# dictionary["attr_one"] = "one"
|
|
79
|
+
# dictionary["attr_two"] = "two"
|
|
80
|
+
#
|
|
81
|
+
# # iterates through all attributes and prints the key to the screen
|
|
82
|
+
# dictionary.each_pair { | key, value |
|
|
83
|
+
# puts "#{key} = #{value}"
|
|
84
|
+
# }
|
|
85
|
+
#
|
|
86
|
+
# @see #each
|
|
87
|
+
#
|
|
88
|
+
# @version LayOut 2026.0
|
|
89
|
+
#
|
|
90
|
+
# @yield [key, value]
|
|
91
|
+
#
|
|
92
|
+
# @yieldparam [String] key
|
|
93
|
+
#
|
|
94
|
+
# @yieldparam [Object] value
|
|
95
|
+
def each
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# The {#each_key} method iterates through all of the dictionary keys.
|
|
99
|
+
#
|
|
100
|
+
# @example
|
|
101
|
+
# dictionary = Layout::Dictionary.new
|
|
102
|
+
# dictionary["attr_one"] = "one"
|
|
103
|
+
# dictionary["attr_two"] = "two"
|
|
104
|
+
#
|
|
105
|
+
# # iterates through all attributes and prints the key to the screen
|
|
106
|
+
# dictionary.each_key { |key| puts key }
|
|
107
|
+
#
|
|
108
|
+
# @version LayOut 2026.0
|
|
109
|
+
#
|
|
110
|
+
# @yieldparam [String] key
|
|
111
|
+
def each_key
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# The {#each_pair} method is an alias for {#each}.
|
|
115
|
+
#
|
|
116
|
+
# @example
|
|
117
|
+
# dictionary = Layout::Dictionary.new
|
|
118
|
+
# dictionary["attr_one"] = "one"
|
|
119
|
+
# dictionary["attr_two"] = "two"
|
|
120
|
+
#
|
|
121
|
+
# # iterates through all attributes and prints the key to the screen
|
|
122
|
+
# dictionary.each_pair { | key, value |
|
|
123
|
+
# puts "#{key} = #{value}"
|
|
124
|
+
# }
|
|
125
|
+
#
|
|
126
|
+
# @see #each
|
|
127
|
+
#
|
|
128
|
+
# @version LayOut 2026.0
|
|
129
|
+
#
|
|
130
|
+
# @yield [key, value]
|
|
131
|
+
#
|
|
132
|
+
# @yieldparam [String] key
|
|
133
|
+
#
|
|
134
|
+
# @yieldparam [Object] value
|
|
135
|
+
def each_pair
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# The {#empty?} method checks if the dictionary is empty.
|
|
139
|
+
#
|
|
140
|
+
# @example
|
|
141
|
+
# dictionary = Layout::Dictionary.new
|
|
142
|
+
# dictionary["attribute_one"] = "1"
|
|
143
|
+
# dictionary.empty? # Returns false
|
|
144
|
+
#
|
|
145
|
+
# @return [Boolean]
|
|
146
|
+
#
|
|
147
|
+
# @version LayOut 2026.0
|
|
148
|
+
def empty?
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# The {#initialize} method creates a new {Layout::Dictionary}.
|
|
152
|
+
#
|
|
153
|
+
# @example
|
|
154
|
+
# doc = Layout::Dictionary.new
|
|
155
|
+
# doc2 = Layout::Dictionary.new({"String key" => "string value", "Number key" => 42})
|
|
156
|
+
#
|
|
157
|
+
# @overload initialize
|
|
158
|
+
#
|
|
159
|
+
# @return [Layout::Dictionary]
|
|
160
|
+
#
|
|
161
|
+
# @overload initialize(dict)
|
|
162
|
+
#
|
|
163
|
+
# @param [Hash, Layout::Dictionary] hash
|
|
164
|
+
# @return [Layout::Dictionary]
|
|
165
|
+
#
|
|
166
|
+
# @raise [ArgumentError] if dict isn't a dictionary or hash
|
|
167
|
+
#
|
|
168
|
+
# @version LayOut 2026.0
|
|
169
|
+
def initialize(*args)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# The {#keys} method retrieves an array with all of the dictionary keys.
|
|
173
|
+
#
|
|
174
|
+
# @example
|
|
175
|
+
# dictionary = Layout::Dictionary.new
|
|
176
|
+
# dictionary["attr_one"] = "one"
|
|
177
|
+
# dictionary["attr_two"] = "two"
|
|
178
|
+
#
|
|
179
|
+
# # Gets an array of keys
|
|
180
|
+
# keys = dictionary.keys
|
|
181
|
+
#
|
|
182
|
+
# @return [Array<String>] an array of keys within the dictionary if successful
|
|
183
|
+
#
|
|
184
|
+
# @version LayOut 2026.0
|
|
185
|
+
def keys
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# The {#length} method retrieves the size (number of elements) of a dictionary.
|
|
189
|
+
#
|
|
190
|
+
# @example
|
|
191
|
+
# dictionary = Layout::Dictionary.new
|
|
192
|
+
# dictionary['Hello'] = 'World'
|
|
193
|
+
# number = dictionary.length
|
|
194
|
+
#
|
|
195
|
+
# @return [Integer]
|
|
196
|
+
#
|
|
197
|
+
# @see #size
|
|
198
|
+
#
|
|
199
|
+
# @version LayOut 2026.0
|
|
200
|
+
def length
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# The {#length} method retrieves the size (number of elements) of a dictionary.
|
|
204
|
+
#
|
|
205
|
+
# @example
|
|
206
|
+
# dictionary = Layout::Dictionary.new
|
|
207
|
+
# dictionary['Hello'] = 'World'
|
|
208
|
+
# number = dictionary.length
|
|
209
|
+
#
|
|
210
|
+
# @return [Integer]
|
|
211
|
+
#
|
|
212
|
+
# @see #size
|
|
213
|
+
#
|
|
214
|
+
# @version LayOut 2026.0
|
|
215
|
+
def size
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# The {#values} method retrieves an array with all of the dictionary values.
|
|
219
|
+
#
|
|
220
|
+
# @example
|
|
221
|
+
# dictionary = Layout::Dictionary.new
|
|
222
|
+
# dictionary["attr_one"] = "one"
|
|
223
|
+
# dictionary["attr_two"] = "two"
|
|
224
|
+
#
|
|
225
|
+
# # Gets an array of values
|
|
226
|
+
# values = dictionary.values
|
|
227
|
+
#
|
|
228
|
+
# @return [Array<Object>] an array of values within the dictionary if successful
|
|
229
|
+
#
|
|
230
|
+
# @version LayOut 2026.0
|
|
231
|
+
def values
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# This is the interface to a LayOut document. A {Layout::Document} is the 2D
|
|
@@ -129,10 +129,33 @@ class Layout::Document
|
|
|
129
129
|
#
|
|
130
130
|
# @raise [ArgumentError] if entity already belongs to a {Layout::Document}
|
|
131
131
|
#
|
|
132
|
+
# @return [Layout::Entity] The {Layout::Entity} that was added to the {Layout::Document}.
|
|
133
|
+
#
|
|
132
134
|
# @version LayOut 2018
|
|
133
135
|
def add_entity(*args)
|
|
134
136
|
end
|
|
135
137
|
|
|
138
|
+
# The {#attribute_dictionary} method returns a copy of the document's attribute dictionary with the
|
|
139
|
+
# given name.
|
|
140
|
+
#
|
|
141
|
+
# is no attribute dictionary
|
|
142
|
+
#
|
|
143
|
+
# @example
|
|
144
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
145
|
+
# doc.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
146
|
+
# attributes = doc.attribute_dictionary("jane_doe_doc_maker")
|
|
147
|
+
# # Adding to this Layout::Dictionary does not apply to the document's attribute dictionary, use
|
|
148
|
+
# #Layout::Document#set_attribute.
|
|
149
|
+
# attributes.merge!(doc_id: 42)
|
|
150
|
+
#
|
|
151
|
+
# @param [String] name
|
|
152
|
+
#
|
|
153
|
+
# @return [Layout::Dictionary, nil] A copy of the document's attribute dictionary, or nil if there
|
|
154
|
+
#
|
|
155
|
+
# @version LayOut 2026.0
|
|
156
|
+
def attribute_dictionary(name)
|
|
157
|
+
end
|
|
158
|
+
|
|
136
159
|
# The {#auto_text_definitions} method returns an array of
|
|
137
160
|
# {Layout::AutoTextDefinition}'s in the {Layout::Document}.
|
|
138
161
|
#
|
|
@@ -146,6 +169,33 @@ class Layout::Document
|
|
|
146
169
|
def auto_text_definitions
|
|
147
170
|
end
|
|
148
171
|
|
|
172
|
+
# The {#delete_attribute} method is used to delete an attribute from a document.
|
|
173
|
+
#
|
|
174
|
+
# @overload delete_attribute(dictionary_name)
|
|
175
|
+
#
|
|
176
|
+
# @param [String] dictionary_name The name of an attribute dictionary.
|
|
177
|
+
# @return [Boolean]
|
|
178
|
+
#
|
|
179
|
+
# @example
|
|
180
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
181
|
+
# doc.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
182
|
+
# doc.delete_attribute("jane_doe_doc_maker")
|
|
183
|
+
#
|
|
184
|
+
# @overload delete_attribute(dictionary_name, key)
|
|
185
|
+
#
|
|
186
|
+
# @param [String] dictionary_name The name of an attribute dictionary.
|
|
187
|
+
# @param [String] key An attribute key.
|
|
188
|
+
# @return [Boolean]
|
|
189
|
+
#
|
|
190
|
+
# @example
|
|
191
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
192
|
+
# doc.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
193
|
+
# doc.delete_attribute("jane_doe_doc_maker", "made_by_doc_maker")
|
|
194
|
+
#
|
|
195
|
+
# @version LayOut 2026.0
|
|
196
|
+
def delete_attribute(*args)
|
|
197
|
+
end
|
|
198
|
+
|
|
149
199
|
# The {#export} method exports the {Layout::Document} to a given file format.
|
|
150
200
|
# It knows which format to export based on the file extension you place on the
|
|
151
201
|
# file name. For example, a filename of "thing.pdf" will export a PDF file,
|
|
@@ -157,47 +207,64 @@ class Layout::Document
|
|
|
157
207
|
# doc = Layout::Document.open("c:/path/to/document.layout")
|
|
158
208
|
#
|
|
159
209
|
# # Export pdf file on a PC, with default settings.
|
|
160
|
-
#
|
|
210
|
+
# doc.export("c:/my_export.pdf")
|
|
161
211
|
#
|
|
162
212
|
# # Export pages one through three at high quality, compressing jpeg images
|
|
163
213
|
# # at 0.75 compression quality (valid range is 0.0 - 1.0). Note that the
|
|
164
214
|
# # first page of a {Layout::Document} is index 0.
|
|
165
215
|
# options = { start_page: 1,
|
|
166
216
|
# end_page: 3,
|
|
167
|
-
# compress_images:
|
|
217
|
+
# compress_images: true,
|
|
168
218
|
# compress_quality: 0.75 }
|
|
169
219
|
#
|
|
170
|
-
#
|
|
220
|
+
# doc.export("c:/my_export.pdf", options)
|
|
171
221
|
#
|
|
172
222
|
# # Export pages one and three through five. Note that page_range starts at
|
|
173
223
|
# # index 1.
|
|
174
224
|
# # `page_range` support added in LayOut 2024.0.
|
|
175
225
|
# options = { page_range: "1,3-5",
|
|
176
|
-
# compress_images:
|
|
226
|
+
# compress_images: true,
|
|
177
227
|
# compress_quality: 0.75 }
|
|
178
228
|
#
|
|
179
|
-
#
|
|
229
|
+
# doc.export("c:/my_export.pdf", options)
|
|
180
230
|
#
|
|
181
231
|
# @example Image Set Export Examples
|
|
182
232
|
# doc = Layout::Document.open("c:/path/to/document.layout")
|
|
183
233
|
#
|
|
184
234
|
# # Export png files on macOS, with default settings.
|
|
185
|
-
#
|
|
235
|
+
# doc.export("/Users/<username>/Desktop/pngs/page.png")
|
|
186
236
|
#
|
|
187
237
|
# # Export pages one through three at 300 dpi as JPGs.
|
|
188
238
|
# options = { start_page: 1,
|
|
189
239
|
# end_page: 3,
|
|
190
240
|
# dpi: 300 }
|
|
191
|
-
#
|
|
241
|
+
# doc.export('c:/page.jpg', options)
|
|
192
242
|
#
|
|
193
243
|
# # Export pages one and three through five. Note that page_range starts at
|
|
194
244
|
# # index 1.
|
|
195
245
|
# # `page_range` support added in LayOut 2024.0.
|
|
196
246
|
# options = { page_range: "1,3-5",
|
|
197
|
-
# compress_images:
|
|
247
|
+
# compress_images: true,
|
|
198
248
|
# compress_quality: 0.75 }
|
|
199
249
|
#
|
|
200
|
-
#
|
|
250
|
+
# doc.export("c:/my_export.png", options)
|
|
251
|
+
#
|
|
252
|
+
# @option options [Integer] :start_page The first page to export.
|
|
253
|
+
#
|
|
254
|
+
# @option options [Integer] :end_page The last page to export.
|
|
255
|
+
#
|
|
256
|
+
# @option options [String] :page_range A string specifying the range of pages to export. The
|
|
257
|
+
# format can include individual page numbers and ranges of pages, separated by commas (e.g.,
|
|
258
|
+
# "1,3-5"). This was added in LayOut 2024.0
|
|
259
|
+
#
|
|
260
|
+
# @option options [Boolean] :compress_images Whether to compress images in the document. This is
|
|
261
|
+
# valid only for image compression for PDF exports.
|
|
262
|
+
#
|
|
263
|
+
# @option options [Float] :compress_quality The compression quality for JPEG images. This is
|
|
264
|
+
# valid only for the quality of the compression of images for PDF exports.
|
|
265
|
+
#
|
|
266
|
+
# @option options [Integer] :dpi The resolution in dots per inch for the exported images. This
|
|
267
|
+
# option is only valid for image exports.
|
|
201
268
|
#
|
|
202
269
|
# @param [String] file_path
|
|
203
270
|
# The file or image set to create. The directory
|
|
@@ -218,6 +285,37 @@ class Layout::Document
|
|
|
218
285
|
def export(file_path, options = nil)
|
|
219
286
|
end
|
|
220
287
|
|
|
288
|
+
# The {#get_attribute} method is used to retrieve the value of an attribute in
|
|
289
|
+
# the document's attribute dictionary.
|
|
290
|
+
#
|
|
291
|
+
# If the third parameter, +default_value+, is not passed and there is no
|
|
292
|
+
# attribute that matches the given name, it returns +nil+.
|
|
293
|
+
#
|
|
294
|
+
# If +default_value+ is provided and there is no matching attribute it returns
|
|
295
|
+
# the given value. It does not create an attribute with that name though.
|
|
296
|
+
#
|
|
297
|
+
# @example
|
|
298
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
299
|
+
# # Read an attribute value from the document. In this case this will return the
|
|
300
|
+
# # default value provided: 42.
|
|
301
|
+
# doc.get_attribute("jane_doe_doc_maker", "doc_id", 42)
|
|
302
|
+
#
|
|
303
|
+
# @param [String] name
|
|
304
|
+
# The name of an attribute dictionary.
|
|
305
|
+
#
|
|
306
|
+
# @param [String] key
|
|
307
|
+
# An attribute key.
|
|
308
|
+
#
|
|
309
|
+
# @param [String, Boolean, Integer, Float, Hash, Layout::Dictionary, nil] default_value
|
|
310
|
+
# A default
|
|
311
|
+
# value to return if no attribute is found.
|
|
312
|
+
#
|
|
313
|
+
# @return [String, Boolean, Integer, Float, Layout::Dictionary, nil] the retrieved value.
|
|
314
|
+
#
|
|
315
|
+
# @version LayOut 2026.0
|
|
316
|
+
def get_attribute(name, key, default_value = nil)
|
|
317
|
+
end
|
|
318
|
+
|
|
221
319
|
# The {#grid} method returns the {Layout::Grid} for a {Layout::Document}.
|
|
222
320
|
#
|
|
223
321
|
# @example
|
|
@@ -486,6 +584,22 @@ class Layout::Document
|
|
|
486
584
|
def save(*args)
|
|
487
585
|
end
|
|
488
586
|
|
|
587
|
+
# The {#set_attribute} method adds an attribute to the document's attribute dictionary.
|
|
588
|
+
#
|
|
589
|
+
# @example
|
|
590
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
591
|
+
# doc.set_attribute "jane_doe_doc_maker", "doc_id", 42
|
|
592
|
+
#
|
|
593
|
+
# @param [String] name
|
|
594
|
+
# The name of an attribute dictionary.
|
|
595
|
+
# @param [String] key An attribute key.
|
|
596
|
+
# @param [String, Boolean, Integer, Float, Hash, Layout::Dictionary, nil] value The value for the
|
|
597
|
+
# attribute.
|
|
598
|
+
#
|
|
599
|
+
# @version LayOut 2026.0
|
|
600
|
+
def set_attribute(name, key, value)
|
|
601
|
+
end
|
|
602
|
+
|
|
489
603
|
# The {#shared_entities} method returns the {Layout::Entities}
|
|
490
604
|
# that exist on shared {Layout::Layer}s in the {Layout::Document}.
|
|
491
605
|
#
|