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
|
# An entity is an object shown on a page of a LayOut document.
|
|
@@ -34,6 +34,28 @@ class Layout::Entity
|
|
|
34
34
|
def ==(other)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
+
# The {#attribute_dictionary} method returns a copy of the entity's attribute dictionary with the
|
|
38
|
+
# given name.
|
|
39
|
+
#
|
|
40
|
+
# no attribute dictionary
|
|
41
|
+
#
|
|
42
|
+
# @example
|
|
43
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
44
|
+
# entity = doc.pages.first.entities.first
|
|
45
|
+
# entity.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
46
|
+
# attributes = entity.attribute_dictionary("jane_doe_doc_maker")
|
|
47
|
+
# # Adding to this Layout::Dictionary does not apply to the entity's attribute dictionary, use
|
|
48
|
+
# #Layout::Entity#set_attribute.
|
|
49
|
+
# attributes.merge!(doc_id: 42)
|
|
50
|
+
#
|
|
51
|
+
# @param [String] name
|
|
52
|
+
#
|
|
53
|
+
# @return [Layout::Dictionary, nil] A copy of the entity's attribute dictionary, or nil if there is
|
|
54
|
+
#
|
|
55
|
+
# @version LayOut 2026.0
|
|
56
|
+
def attribute_dictionary(name)
|
|
57
|
+
end
|
|
58
|
+
|
|
37
59
|
# The {#bounds} method returns the 2D rectangular bounds of the {Layout::Entity}.
|
|
38
60
|
#
|
|
39
61
|
# @example
|
|
@@ -47,6 +69,35 @@ class Layout::Entity
|
|
|
47
69
|
def bounds
|
|
48
70
|
end
|
|
49
71
|
|
|
72
|
+
# The {#delete_attribute} method is used to delete an attribute from an entity.
|
|
73
|
+
#
|
|
74
|
+
# @overload delete_attribute(dictionary_name)
|
|
75
|
+
#
|
|
76
|
+
# @param [String] dictionary_name The name of an attribute dictionary.
|
|
77
|
+
# @return [Boolean]
|
|
78
|
+
#
|
|
79
|
+
# @example
|
|
80
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
81
|
+
# entity = doc.pages.first.entities.first
|
|
82
|
+
# entity.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
83
|
+
# entity.delete_attribute("jane_doe_doc_maker")
|
|
84
|
+
#
|
|
85
|
+
# @overload delete_attribute(dictionary_name, key)
|
|
86
|
+
#
|
|
87
|
+
# @param [String] dictionary_name The name of an attribute dictionary.
|
|
88
|
+
# @param [String] key An attribute key.
|
|
89
|
+
# @return [Boolean]
|
|
90
|
+
#
|
|
91
|
+
# @example
|
|
92
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
93
|
+
# entity = doc.pages.first.entities.first
|
|
94
|
+
# entity.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
95
|
+
# entity.delete_attribute("jane_doe_doc_maker", "made_by_doc_maker")
|
|
96
|
+
#
|
|
97
|
+
# @version LayOut 2026.0
|
|
98
|
+
def delete_attribute(*args)
|
|
99
|
+
end
|
|
100
|
+
|
|
50
101
|
# The {#document} method returns the {Layout::Document} that the
|
|
51
102
|
# {Layout::Entity} belongs to, or +nil+ if it is not in a {Layout::Document}.
|
|
52
103
|
#
|
|
@@ -76,6 +127,38 @@ class Layout::Entity
|
|
|
76
127
|
def drawing_bounds
|
|
77
128
|
end
|
|
78
129
|
|
|
130
|
+
# The {#get_attribute} method is used to retrieve the value of an attribute in
|
|
131
|
+
# the entity's attribute dictionary.
|
|
132
|
+
#
|
|
133
|
+
# If the third parameter, +default_value+, is not passed and there is no
|
|
134
|
+
# attribute that matches the given name, it returns +nil+.
|
|
135
|
+
#
|
|
136
|
+
# If +default_value+ is provided and there is no matching attribute it returns
|
|
137
|
+
# the given value. It does not create an attribute with that name though.
|
|
138
|
+
#
|
|
139
|
+
# @example
|
|
140
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
141
|
+
# entity = doc.pages.first.entities.first
|
|
142
|
+
# # Read an attribute value from the entity. In this case this will return the
|
|
143
|
+
# # default value provided: 42.
|
|
144
|
+
# entity.get_attribute("jane_doe_doc_maker", "doc_id", 42)
|
|
145
|
+
#
|
|
146
|
+
# @param [String] name
|
|
147
|
+
# The name of an attribute dictionary.
|
|
148
|
+
#
|
|
149
|
+
# @param [String] key
|
|
150
|
+
# An attribute key.
|
|
151
|
+
#
|
|
152
|
+
# @param [String, Boolean, Integer, Float, Hash, Layout::Dictionary, nil] default_value
|
|
153
|
+
# A default
|
|
154
|
+
# value to return if no attribute is found.
|
|
155
|
+
#
|
|
156
|
+
# @return [String, Boolean, Integer, Float, Layout::Dictionary, nil] the retrieved value.
|
|
157
|
+
#
|
|
158
|
+
# @version LayOut 2026.0
|
|
159
|
+
def get_attribute(name, key, default_value = nil)
|
|
160
|
+
end
|
|
161
|
+
|
|
79
162
|
# The {#group} method returns the {Layout::Group} the {Layout::Entity} belongs
|
|
80
163
|
# to, or +nil+ if it is not in a {Layout::Group}.
|
|
81
164
|
#
|
|
@@ -145,9 +228,12 @@ class Layout::Entity
|
|
|
145
228
|
#
|
|
146
229
|
# @example
|
|
147
230
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
#
|
|
231
|
+
# # We consider that there are two rectangle objects in the entities.
|
|
232
|
+
# entities = doc.layers.first.layer_instance(doc.pages.first).entities
|
|
233
|
+
# # We move the first rectangle to a new group.
|
|
234
|
+
# group = Layout::Group.new([entities.first])
|
|
235
|
+
# # We move the second rectangle to the same group.
|
|
236
|
+
# entities[1].first.move_to_group(new_group)
|
|
151
237
|
#
|
|
152
238
|
# @param [Layout::Group] group
|
|
153
239
|
#
|
|
@@ -246,6 +332,23 @@ class Layout::Entity
|
|
|
246
332
|
def page
|
|
247
333
|
end
|
|
248
334
|
|
|
335
|
+
# The {#set_attribute} method adds an attribute to the entity's attribute dictionary.
|
|
336
|
+
#
|
|
337
|
+
# @example
|
|
338
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
339
|
+
# entity = doc.pages.first.entities.first
|
|
340
|
+
# entity.set_attribute("jane_doe_doc_maker", "doc_id", 42)
|
|
341
|
+
#
|
|
342
|
+
# @param [String] name
|
|
343
|
+
# The name of an attribute dictionary.
|
|
344
|
+
# @param [String] key An attribute key.
|
|
345
|
+
# @param [String, Boolean, Integer, Float, Hash, Layout::Dictionary, nil] value The value for the
|
|
346
|
+
# attribute.
|
|
347
|
+
#
|
|
348
|
+
# @version LayOut 2026.0
|
|
349
|
+
def set_attribute(name, key, value)
|
|
350
|
+
end
|
|
351
|
+
|
|
249
352
|
# The {#style} method returns the {Layout::Style} of the {Layout::Entity}. If
|
|
250
353
|
# the {Layout::Entity} is a {Layout::Group}, +nil+ will be returned, as they
|
|
251
354
|
# do not have a {Layout::Style}.
|
|
@@ -283,6 +386,9 @@ class Layout::Entity
|
|
|
283
386
|
# transform = Geom::Transformation2d.new([1.0, 0.0, 0.0, 1.0, 1.0, 1.0])
|
|
284
387
|
# entity = entities.first.transform!(transform)
|
|
285
388
|
#
|
|
389
|
+
# @note Since LayOut 2026.1, passing a non-invertible transformation raises
|
|
390
|
+
# an `ArgumentError`.
|
|
391
|
+
#
|
|
286
392
|
# @param [Geom::Transformation2d] transformation
|
|
287
393
|
#
|
|
288
394
|
# @raise [LockedLayerError] if the {Layout::Entity} is on a locked
|
|
@@ -290,6 +396,8 @@ class Layout::Entity
|
|
|
290
396
|
#
|
|
291
397
|
# @raise [LockedEntityError] if the {Layout::Entity} is locked
|
|
292
398
|
#
|
|
399
|
+
# @raise [ArgumentError] if the transformation matrix is not invertible
|
|
400
|
+
#
|
|
293
401
|
# @version LayOut 2018
|
|
294
402
|
def transform!(transformation)
|
|
295
403
|
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
|
# A group is a special type of {Layout::Entity} that does not belong to a
|
|
@@ -92,7 +92,7 @@ class Layout::Group < Layout::Entity
|
|
|
92
92
|
def remove_scale_factor(resize_behavior)
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
-
# The {#scale_factor} method returns the
|
|
95
|
+
# The {#scale_factor} method returns the scale factor associated with the
|
|
96
96
|
# {Layout::Group}.
|
|
97
97
|
#
|
|
98
98
|
# @example
|
|
@@ -166,7 +166,7 @@ class Layout::Group < Layout::Entity
|
|
|
166
166
|
def scale_units
|
|
167
167
|
end
|
|
168
168
|
|
|
169
|
-
# The {#scale_units=} method sets the
|
|
169
|
+
# The {#scale_units=} method sets the units format for the scale of the
|
|
170
170
|
# {Layout::Group}.
|
|
171
171
|
#
|
|
172
172
|
# The units format can be any of the following values:
|
|
@@ -197,7 +197,7 @@ class Layout::Group < Layout::Entity
|
|
|
197
197
|
def scale_units=(units_format)
|
|
198
198
|
end
|
|
199
199
|
|
|
200
|
-
# The {#set_scale_factor} method sets the
|
|
200
|
+
# The {#set_scale_factor} method sets the scale factor for the
|
|
201
201
|
# {Layout::Group}.
|
|
202
202
|
#
|
|
203
203
|
# The units format can be any of the following values:
|
|
@@ -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 linear dimension entity. A {Layout::LinearDimension} is composed
|
|
@@ -22,6 +22,10 @@ class Layout::LinearDimension < Layout::Entity
|
|
|
22
22
|
|
|
23
23
|
# Constants
|
|
24
24
|
|
|
25
|
+
DIMENSION_LINE_ALIGNED = nil # Stub value.
|
|
26
|
+
DIMENSION_LINE_HORIZONTAL = nil # Stub value.
|
|
27
|
+
DIMENSION_LINE_VERTICAL = nil # Stub value.
|
|
28
|
+
|
|
25
29
|
LEADER_LINE_TYPE_BEZIER = nil # Stub value.
|
|
26
30
|
LEADER_LINE_TYPE_HIDDEN = nil # Stub value.
|
|
27
31
|
LEADER_LINE_TYPE_SINGLE_SEGMENT = nil # Stub value.
|
|
@@ -302,18 +306,33 @@ class Layout::LinearDimension < Layout::Entity
|
|
|
302
306
|
# height = 1.0
|
|
303
307
|
# dim = Layout::LinearDimension.new(start_point, end_point, height)
|
|
304
308
|
#
|
|
305
|
-
# @
|
|
309
|
+
# @overload initialize(start_point, end_point, height)
|
|
306
310
|
#
|
|
307
|
-
#
|
|
311
|
+
# @version LayOut 2018
|
|
312
|
+
# @param [Geom::Point2d] start_point
|
|
313
|
+
# @param [Geom::Point2d] end_point
|
|
314
|
+
# @param [Numeric] height Distance from the start and end points to the
|
|
315
|
+
# dimension line
|
|
308
316
|
#
|
|
309
|
-
# @
|
|
310
|
-
# Distance from the start and end points to the
|
|
311
|
-
# dimension line
|
|
317
|
+
# @overload initialize(start_point, end_point, height, alignment)
|
|
312
318
|
#
|
|
313
|
-
#
|
|
319
|
+
# @version LayOut 2026.0
|
|
320
|
+
# @param [Geom::Point2d] start_point
|
|
321
|
+
# @param [Geom::Point2d] end_point
|
|
322
|
+
# @param [Numeric] height Distance from the start and end points to the
|
|
323
|
+
# dimension line
|
|
324
|
+
# @param [Integer] alignment The alignment type for the dimension line
|
|
314
325
|
#
|
|
315
|
-
#
|
|
316
|
-
|
|
326
|
+
# alignment can be one of the following:
|
|
327
|
+
# [+Layout::LinearDimension::DIMENSION_LINE_ALIGNED+]
|
|
328
|
+
# [+Layout::LinearDimension::DIMENSION_LINE_VERTICAL+]
|
|
329
|
+
# [+Layout::LinearDimension::DIMENSION_LINE_HORIZONTAL+]
|
|
330
|
+
#
|
|
331
|
+
# @raise [RangeError] if alignment is not a valid alignment type
|
|
332
|
+
# @raise [ArgumentError] if a dimension couldn't be created with the provided arguments
|
|
333
|
+
#
|
|
334
|
+
# @return [Layout::LinearDimension]
|
|
335
|
+
def initialize(*args)
|
|
317
336
|
end
|
|
318
337
|
|
|
319
338
|
# The {#leader_line_type} method returns the type of leader line the
|
|
@@ -368,6 +387,34 @@ class Layout::LinearDimension < Layout::Entity
|
|
|
368
387
|
def leader_line_type=(type)
|
|
369
388
|
end
|
|
370
389
|
|
|
390
|
+
# The {#leader_line_visible?} method returns whether the leader line is currently visible.
|
|
391
|
+
#
|
|
392
|
+
# @example
|
|
393
|
+
# start_point = Geom::Point2d.new(1, 1)
|
|
394
|
+
# end_point = Geom::Point2d.new(1, 1.2)
|
|
395
|
+
# height = 1.0
|
|
396
|
+
# dim = Layout::LinearDimension.new(start_point, end_point, height)
|
|
397
|
+
# dim.leader_line_type = Layout::LinearDimension::LEADER_LINE_TYPE_TWO_SEGMENT
|
|
398
|
+
# # Will be false since the text is not automatically positioned away from the dimension line
|
|
399
|
+
# visible = dim.leader_line_visible?
|
|
400
|
+
#
|
|
401
|
+
# # Position the text away from the dimension line.
|
|
402
|
+
# text_pos = Geom::Point2d.new(1, 1.5)
|
|
403
|
+
# anchor_type = Layout::FormattedText::ANCHOR_TYPE_TOP_LEFT
|
|
404
|
+
# dim.text = Layout::FormattedText.new("<>", text_pos, anchor_type)
|
|
405
|
+
# # Will be true since the text is positioned away from the dimension line
|
|
406
|
+
# visible = dim.leader_line_visible?
|
|
407
|
+
#
|
|
408
|
+
# dim.leader_line_type = Layout::LinearDimension::LEADER_LINE_TYPE_HIDDEN
|
|
409
|
+
# # Will be false, even though the text is positioned away from the dimension line
|
|
410
|
+
# visible = dim.leader_line_visible?
|
|
411
|
+
#
|
|
412
|
+
# @return [Boolean]
|
|
413
|
+
#
|
|
414
|
+
# @version LayOut 2026.0
|
|
415
|
+
def leader_line_visible?
|
|
416
|
+
end
|
|
417
|
+
|
|
371
418
|
# The {#scale} method returns the scale being used for the
|
|
372
419
|
# {Layout::LinearDimension}.
|
|
373
420
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# Class for a single page in a LayOut document.
|
|
@@ -25,6 +25,56 @@ class Layout::Page
|
|
|
25
25
|
def ==(other)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# The {#attribute_dictionary} method returns a copy of the page's attribute dictionary with the
|
|
29
|
+
# given name.
|
|
30
|
+
#
|
|
31
|
+
# @example
|
|
32
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
33
|
+
# page = doc.pages.first
|
|
34
|
+
# page.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
35
|
+
# attributes = page.attribute_dictionary("jane_doe_doc_maker")
|
|
36
|
+
# # Adding to this Layout::Dictionary does not apply to the page's attribute dictionary, use
|
|
37
|
+
# # Layout::Page#set_attribute.
|
|
38
|
+
# attributes.merge!(doc_id: 42)
|
|
39
|
+
#
|
|
40
|
+
# @param [String] name
|
|
41
|
+
#
|
|
42
|
+
# @return [Layout::Dictionary, nil] A copy of the page's attribute dictionary, or nil if there is
|
|
43
|
+
# no attribute dictionary
|
|
44
|
+
#
|
|
45
|
+
# @version LayOut 2026.0
|
|
46
|
+
def attribute_dictionary(name)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# The {#delete_attribute} method is used to delete an attribute from a page.
|
|
50
|
+
#
|
|
51
|
+
# @overload delete_attribute(dictionary_name)
|
|
52
|
+
#
|
|
53
|
+
# @param [String] dictionary_name The name of an attribute dictionary.
|
|
54
|
+
# @return [Boolean]
|
|
55
|
+
#
|
|
56
|
+
# @example
|
|
57
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
58
|
+
# page = doc.pages.first
|
|
59
|
+
# page.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
60
|
+
# page.delete_attribute("jane_doe_doc_maker")
|
|
61
|
+
#
|
|
62
|
+
# @overload delete_attribute(dictionary_name, key)
|
|
63
|
+
#
|
|
64
|
+
# @param [String] dictionary_name The name of an attribute dictionary.
|
|
65
|
+
# @param [String] key An attribute key.
|
|
66
|
+
# @return [Boolean]
|
|
67
|
+
#
|
|
68
|
+
# @example
|
|
69
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
70
|
+
# page = doc.pages.first
|
|
71
|
+
# page.set_attribute("jane_doe_doc_maker", "made_by_doc_maker", true)
|
|
72
|
+
# page.delete_attribute("jane_doe_doc_maker", "made_by_doc_maker")
|
|
73
|
+
#
|
|
74
|
+
# @version LayOut 2026.0
|
|
75
|
+
def delete_attribute(*args)
|
|
76
|
+
end
|
|
77
|
+
|
|
28
78
|
# The {#document} method returns the {Layout::Document} that the {Layout::Page}
|
|
29
79
|
# belongs to.
|
|
30
80
|
#
|
|
@@ -55,6 +105,38 @@ class Layout::Page
|
|
|
55
105
|
def entities
|
|
56
106
|
end
|
|
57
107
|
|
|
108
|
+
# The {#get_attribute} method is used to retrieve the value of an attribute in
|
|
109
|
+
# the page's attribute dictionary.
|
|
110
|
+
#
|
|
111
|
+
# If the third parameter, +default_value+, is not passed and there is no
|
|
112
|
+
# attribute that matches the given name, it returns +nil+.
|
|
113
|
+
#
|
|
114
|
+
# If +default_value+ is provided and there is no matching attribute it returns
|
|
115
|
+
# the given value. It does not create an attribute with that name though.
|
|
116
|
+
#
|
|
117
|
+
# @example
|
|
118
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
119
|
+
# page = doc.pages.first
|
|
120
|
+
# # Read an attribute value from the page. In this case this will return the
|
|
121
|
+
# # default value provided: 42.
|
|
122
|
+
# page.get_attribute("jane_doe_doc_maker", "doc_id", 42)
|
|
123
|
+
#
|
|
124
|
+
# @param [String] name
|
|
125
|
+
# The name of an attribute dictionary.
|
|
126
|
+
#
|
|
127
|
+
# @param [String] key
|
|
128
|
+
# An attribute key.
|
|
129
|
+
#
|
|
130
|
+
# @param [String, Boolean, Integer, Float, Hash, Layout::Dictionary, nil] default_value
|
|
131
|
+
# A default
|
|
132
|
+
# value to return if no attribute is found.
|
|
133
|
+
#
|
|
134
|
+
# @return [String, Boolean, Integer, Float, Layout::Dictionary, nil] the retrieved value.
|
|
135
|
+
#
|
|
136
|
+
# @version LayOut 2026.0
|
|
137
|
+
def get_attribute(name, key, default_value = nil)
|
|
138
|
+
end
|
|
139
|
+
|
|
58
140
|
# The {#in_presentation=} method sets whether the {Layout::Page} is included in
|
|
59
141
|
# presentations.
|
|
60
142
|
#
|
|
@@ -156,6 +238,23 @@ class Layout::Page
|
|
|
156
238
|
def nonshared_entities
|
|
157
239
|
end
|
|
158
240
|
|
|
241
|
+
# The {#set_attribute} method adds an attribute to the page's attribute dictionary.
|
|
242
|
+
#
|
|
243
|
+
# @example
|
|
244
|
+
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
245
|
+
# page = doc.pages.first
|
|
246
|
+
# page.set_attribute("jane_doe_doc_maker", "doc_id", 42)
|
|
247
|
+
#
|
|
248
|
+
# @param [String] name
|
|
249
|
+
# The name of an attribute dictionary.
|
|
250
|
+
# @param [String] key An attribute key.
|
|
251
|
+
# @param [String, Boolean, Integer, Float, Hash, Layout::Dictionary, nil] value The value for the
|
|
252
|
+
# attribute.
|
|
253
|
+
#
|
|
254
|
+
# @version LayOut 2026.0
|
|
255
|
+
def set_attribute(name, key, value)
|
|
256
|
+
end
|
|
257
|
+
|
|
159
258
|
# The {#set_layer_visibility} method sets whether a {Layout::Layer} is visible
|
|
160
259
|
# on the {Layout::Page}.
|
|
161
260
|
#
|
|
@@ -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}'s paper space information. The
|
|
@@ -24,8 +24,7 @@ class Layout::PageInfo
|
|
|
24
24
|
|
|
25
25
|
# Instance Methods
|
|
26
26
|
|
|
27
|
-
# The {bottom_margin} method returns the paper's bottom margin in
|
|
28
|
-
# units.
|
|
27
|
+
# The {bottom_margin} method returns the paper's bottom margin in inches.
|
|
29
28
|
#
|
|
30
29
|
# @example
|
|
31
30
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -37,7 +36,7 @@ class Layout::PageInfo
|
|
|
37
36
|
def bottom_margin
|
|
38
37
|
end
|
|
39
38
|
|
|
40
|
-
# The {#bottom_margin=} method sets the paper's bottom margin in
|
|
39
|
+
# The {#bottom_margin=} method sets the paper's bottom margin in inches.
|
|
41
40
|
#
|
|
42
41
|
# @example
|
|
43
42
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -114,7 +113,7 @@ class Layout::PageInfo
|
|
|
114
113
|
def display_resolution=(resolution)
|
|
115
114
|
end
|
|
116
115
|
|
|
117
|
-
# The {#height} method returns the paper height in
|
|
116
|
+
# The {#height} method returns the paper height in inches.
|
|
118
117
|
#
|
|
119
118
|
# @example
|
|
120
119
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -126,7 +125,7 @@ class Layout::PageInfo
|
|
|
126
125
|
def height
|
|
127
126
|
end
|
|
128
127
|
|
|
129
|
-
# The {#height=} method sets the paper height in
|
|
128
|
+
# The {#height=} method sets the paper height in inches.
|
|
130
129
|
#
|
|
131
130
|
# @example
|
|
132
131
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -212,7 +211,7 @@ class Layout::PageInfo
|
|
|
212
211
|
def image_output_resolution=(resolution)
|
|
213
212
|
end
|
|
214
213
|
|
|
215
|
-
# The {#left_margin} method returns the paper's left margin in
|
|
214
|
+
# The {#left_margin} method returns the paper's left margin in inches.
|
|
216
215
|
#
|
|
217
216
|
# @example
|
|
218
217
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -224,7 +223,7 @@ class Layout::PageInfo
|
|
|
224
223
|
def left_margin
|
|
225
224
|
end
|
|
226
225
|
|
|
227
|
-
# The {#left_margin=} method sets the paper's left margin in
|
|
226
|
+
# The {#left_margin=} method sets the paper's left margin in inches.
|
|
228
227
|
#
|
|
229
228
|
# @example
|
|
230
229
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -352,7 +351,7 @@ class Layout::PageInfo
|
|
|
352
351
|
def print_paper_color?
|
|
353
352
|
end
|
|
354
353
|
|
|
355
|
-
# The {#right_margin} method returns the paper's right margin in
|
|
354
|
+
# The {#right_margin} method returns the paper's right margin in inches.
|
|
356
355
|
#
|
|
357
356
|
# @example
|
|
358
357
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -364,7 +363,7 @@ class Layout::PageInfo
|
|
|
364
363
|
def right_margin
|
|
365
364
|
end
|
|
366
365
|
|
|
367
|
-
# The {#right_margin=} sets the paper's right margin in
|
|
366
|
+
# The {#right_margin=} sets the paper's right margin in inches.
|
|
368
367
|
#
|
|
369
368
|
# @example
|
|
370
369
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -403,7 +402,7 @@ class Layout::PageInfo
|
|
|
403
402
|
def show_margins?
|
|
404
403
|
end
|
|
405
404
|
|
|
406
|
-
# The {#top_margin} method returns the paper's top margin in
|
|
405
|
+
# The {#top_margin} method returns the paper's top margin in inches.
|
|
407
406
|
#
|
|
408
407
|
# @example
|
|
409
408
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -415,7 +414,7 @@ class Layout::PageInfo
|
|
|
415
414
|
def top_margin
|
|
416
415
|
end
|
|
417
416
|
|
|
418
|
-
# The {#top_margin} method sets the paper's top margin in
|
|
417
|
+
# The {#top_margin} method sets the paper's top margin in inches.
|
|
419
418
|
#
|
|
420
419
|
# @example
|
|
421
420
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -430,7 +429,7 @@ class Layout::PageInfo
|
|
|
430
429
|
def top_margin=(margin)
|
|
431
430
|
end
|
|
432
431
|
|
|
433
|
-
# The {#width} method returns the paper width in
|
|
432
|
+
# The {#width} method returns the paper width in inches.
|
|
434
433
|
#
|
|
435
434
|
# @example
|
|
436
435
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -442,7 +441,7 @@ class Layout::PageInfo
|
|
|
442
441
|
def width
|
|
443
442
|
end
|
|
444
443
|
|
|
445
|
-
# The {#width=} method sets the paper width in
|
|
444
|
+
# The {#width=} method sets the paper width in inches.
|
|
446
445
|
#
|
|
447
446
|
# @example
|
|
448
447
|
# doc = Layout::Document.open("C:/path/to/document.layout")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2026 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# A path entity represents a continuous, multi-segment polyline or bezier
|
|
@@ -27,8 +27,8 @@ class Layout::Path < Layout::Entity
|
|
|
27
27
|
# @example
|
|
28
28
|
# center = Geom::Point2d.new(5, 5)
|
|
29
29
|
# radius = 2.0
|
|
30
|
-
# start_angle =
|
|
31
|
-
# end_angle =
|
|
30
|
+
# start_angle = 3.14159
|
|
31
|
+
# end_angle = 6.28319
|
|
32
32
|
# arc = Layout::Path.new_arc(center, radius, start_angle, end_angle)
|
|
33
33
|
#
|
|
34
34
|
# @param [Geom::Point2d] center_point
|
|
@@ -36,8 +36,10 @@ class Layout::Path < Layout::Entity
|
|
|
36
36
|
# @param [Float] radius
|
|
37
37
|
#
|
|
38
38
|
# @param [Float] start_angle
|
|
39
|
+
# in radians
|
|
39
40
|
#
|
|
40
41
|
# @param [Float] end_angle
|
|
42
|
+
# in radians
|
|
41
43
|
#
|
|
42
44
|
# @raise [ArgumentError] if radius is less than or equal to zero
|
|
43
45
|
#
|