sketchup-api-stubs 0.3.1 → 0.4.0
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 +5 -5
- data/.yardopts +7 -7
- data/SketchUp/Geom/BoundingBox.rb +7 -15
- data/SketchUp/Geom/Bounds2d.rb +18 -18
- data/SketchUp/Geom/LatLong.rb +6 -6
- data/SketchUp/Geom/OrientedBounds2d.rb +1 -1
- data/SketchUp/Geom/Point2d.rb +42 -6
- data/SketchUp/Geom/Point3d.rb +32 -21
- data/SketchUp/Geom/PolygonMesh.rb +22 -17
- data/SketchUp/Geom/Transformation.rb +35 -35
- data/SketchUp/Geom/Transformation2d.rb +153 -13
- data/SketchUp/Geom/UTM.rb +1 -1
- data/SketchUp/Geom/Vector2d.rb +45 -9
- data/SketchUp/Geom/Vector3d.rb +11 -11
- data/SketchUp/Layout.rb +1 -1
- data/SketchUp/Layout/AngularDimension.rb +25 -25
- data/SketchUp/Layout/AutoTextDefinition.rb +5 -5
- data/SketchUp/Layout/AutoTextDefinitions.rb +1 -1
- data/SketchUp/Layout/ConnectionPoint.rb +1 -1
- data/SketchUp/Layout/Document.rb +6 -5
- data/SketchUp/Layout/Ellipse.rb +1 -1
- data/SketchUp/Layout/Entities.rb +1 -1
- data/SketchUp/Layout/Entity.rb +16 -16
- data/SketchUp/Layout/FormattedText.rb +21 -21
- data/SketchUp/Layout/Grid.rb +1 -1
- data/SketchUp/Layout/Group.rb +18 -18
- data/SketchUp/Layout/Image.rb +6 -6
- data/SketchUp/Layout/Label.rb +15 -15
- data/SketchUp/Layout/Layer.rb +5 -5
- data/SketchUp/Layout/LayerInstance.rb +3 -3
- data/SketchUp/Layout/Layers.rb +1 -1
- data/SketchUp/Layout/LinearDimension.rb +25 -25
- data/SketchUp/Layout/LockedEntityError.rb +1 -1
- data/SketchUp/Layout/LockedLayerError.rb +1 -1
- data/SketchUp/Layout/Page.rb +3 -3
- data/SketchUp/Layout/PageInfo.rb +1 -1
- data/SketchUp/Layout/Pages.rb +1 -1
- data/SketchUp/Layout/Path.rb +47 -27
- data/SketchUp/Layout/Rectangle.rb +8 -8
- data/SketchUp/Layout/SketchUpModel.rb +61 -26
- data/SketchUp/Layout/Style.rb +18 -17
- data/SketchUp/Layout/Table.rb +14 -14
- data/SketchUp/Layout/TableCell.rb +5 -5
- data/SketchUp/Layout/TableColumn.rb +7 -7
- data/SketchUp/Layout/TableRow.rb +7 -7
- data/SketchUp/Sketchup/Animation.rb +1 -1
- data/SketchUp/Sketchup/AppObserver.rb +1 -1
- data/SketchUp/Sketchup/ArcCurve.rb +1 -1
- data/SketchUp/Sketchup/AttributeDictionaries.rb +1 -1
- data/SketchUp/Sketchup/AttributeDictionary.rb +7 -7
- data/SketchUp/Sketchup/Axes.rb +4 -4
- data/SketchUp/Sketchup/Behavior.rb +1 -1
- data/SketchUp/Sketchup/Camera.rb +30 -41
- data/SketchUp/Sketchup/ClassificationSchema.rb +1 -1
- data/SketchUp/Sketchup/Classifications.rb +1 -1
- data/SketchUp/Sketchup/Color.rb +1 -1
- data/SketchUp/Sketchup/ComponentDefinition.rb +3 -3
- data/SketchUp/Sketchup/ComponentInstance.rb +10 -10
- data/SketchUp/Sketchup/Console.rb +5 -5
- data/SketchUp/Sketchup/ConstructionLine.rb +11 -11
- data/SketchUp/Sketchup/ConstructionPoint.rb +1 -1
- data/SketchUp/Sketchup/Curve.rb +1 -1
- data/SketchUp/Sketchup/DefinitionList.rb +12 -9
- data/SketchUp/Sketchup/DefinitionObserver.rb +6 -7
- data/SketchUp/Sketchup/DefinitionsObserver.rb +3 -3
- data/SketchUp/Sketchup/Dimension.rb +1 -1
- data/SketchUp/Sketchup/DimensionLinear.rb +81 -1
- data/SketchUp/Sketchup/DimensionObserver.rb +1 -1
- data/SketchUp/Sketchup/DimensionRadial.rb +1 -1
- data/SketchUp/Sketchup/Drawingelement.rb +1 -1
- data/SketchUp/Sketchup/Edge.rb +13 -16
- data/SketchUp/Sketchup/EdgeUse.rb +1 -1
- data/SketchUp/Sketchup/Entities.rb +181 -100
- data/SketchUp/Sketchup/EntitiesObserver.rb +1 -1
- data/SketchUp/Sketchup/Entity.rb +29 -26
- data/SketchUp/Sketchup/EntityObserver.rb +1 -1
- data/SketchUp/Sketchup/ExtensionsManager.rb +1 -1
- data/SketchUp/Sketchup/Face.rb +7 -7
- data/SketchUp/Sketchup/FrameChangeObserver.rb +4 -4
- data/SketchUp/Sketchup/Group.rb +1 -1
- data/SketchUp/Sketchup/Http.rb +1 -1
- data/SketchUp/Sketchup/Http/Request.rb +3 -3
- data/SketchUp/Sketchup/Http/Response.rb +1 -1
- data/SketchUp/Sketchup/Image.rb +1 -1
- data/SketchUp/Sketchup/ImageRep.rb +16 -16
- data/SketchUp/Sketchup/Importer.rb +1 -1
- data/SketchUp/Sketchup/InputPoint.rb +8 -4
- data/SketchUp/Sketchup/InstanceObserver.rb +1 -1
- data/SketchUp/Sketchup/InstancePath.rb +15 -12
- data/SketchUp/Sketchup/Layer.rb +27 -1
- data/SketchUp/Sketchup/Layers.rb +1 -1
- data/SketchUp/Sketchup/LayersObserver.rb +1 -1
- data/SketchUp/Sketchup/Licensing.rb +1 -1
- data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +1 -1
- data/SketchUp/Sketchup/LineStyle.rb +24 -0
- data/SketchUp/Sketchup/LineStyles.rb +123 -0
- data/SketchUp/Sketchup/Loop.rb +1 -1
- data/SketchUp/Sketchup/Material.rb +16 -10
- data/SketchUp/Sketchup/Materials.rb +9 -1
- data/SketchUp/Sketchup/MaterialsObserver.rb +3 -3
- data/SketchUp/Sketchup/Menu.rb +1 -1
- data/SketchUp/Sketchup/Model.rb +47 -21
- data/SketchUp/Sketchup/ModelObserver.rb +3 -3
- data/SketchUp/Sketchup/OptionsManager.rb +1 -1
- data/SketchUp/Sketchup/OptionsProvider.rb +5 -5
- data/SketchUp/Sketchup/OptionsProviderObserver.rb +1 -1
- data/SketchUp/Sketchup/Page.rb +1 -1
- data/SketchUp/Sketchup/Pages.rb +13 -8
- data/SketchUp/Sketchup/PagesObserver.rb +1 -1
- data/SketchUp/Sketchup/PickHelper.rb +49 -50
- data/SketchUp/Sketchup/RegionalSettings.rb +1 -1
- data/SketchUp/Sketchup/RenderingOptions.rb +4 -4
- data/SketchUp/Sketchup/RenderingOptionsObserver.rb +3 -3
- data/SketchUp/Sketchup/SectionPlane.rb +1 -1
- data/SketchUp/Sketchup/Selection.rb +3 -3
- data/SketchUp/Sketchup/SelectionObserver.rb +3 -3
- data/SketchUp/Sketchup/Set.rb +1 -1
- data/SketchUp/Sketchup/ShadowInfo.rb +3 -3
- data/SketchUp/Sketchup/ShadowInfoObserver.rb +1 -1
- data/SketchUp/Sketchup/Style.rb +1 -1
- data/SketchUp/Sketchup/Styles.rb +1 -1
- data/SketchUp/Sketchup/Text.rb +28 -1
- data/SketchUp/Sketchup/Texture.rb +1 -1
- data/SketchUp/Sketchup/TextureWriter.rb +13 -13
- data/SketchUp/Sketchup/Tool.rb +68 -64
- data/SketchUp/Sketchup/Tools.rb +13 -1
- data/SketchUp/Sketchup/ToolsObserver.rb +13 -13
- data/SketchUp/Sketchup/UVHelper.rb +1 -1
- data/SketchUp/Sketchup/Vertex.rb +1 -1
- data/SketchUp/Sketchup/View.rb +57 -56
- data/SketchUp/Sketchup/ViewObserver.rb +2 -2
- data/SketchUp/UI/Command.rb +4 -1
- data/SketchUp/UI/HtmlDialog.rb +23 -14
- data/SketchUp/UI/Notification.rb +10 -10
- data/SketchUp/UI/Toolbar.rb +1 -1
- data/SketchUp/UI/WebDialog.rb +38 -20
- data/SketchUp/_top_level.rb +32 -34
- data/SketchUp/array.rb +125 -112
- data/SketchUp/geom.rb +2 -2
- data/SketchUp/languagehandler.rb +1 -1
- data/SketchUp/length.rb +1 -1
- data/SketchUp/numeric.rb +3 -3
- data/SketchUp/sketchup.rb +11 -11
- data/SketchUp/sketchupextension.rb +6 -2
- data/SketchUp/string.rb +1 -1
- data/SketchUp/ui.rb +14 -14
- data/autoload/sketchup.rb +2 -0
- metadata +5 -3
data/SketchUp/Sketchup/Color.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The {Sketchup::ComponentDefinition} class is used to define the contents for
|
|
@@ -548,11 +548,11 @@ class Sketchup::ComponentDefinition < Sketchup::Drawingelement
|
|
|
548
548
|
# @raise [NotImplementedError] when trying to set the value of "choice"
|
|
549
549
|
# attributes.
|
|
550
550
|
#
|
|
551
|
+
# @raise [RuntimeError] if the attributes being set are corrupt.
|
|
552
|
+
#
|
|
551
553
|
# @raise [TypeError] when trying to set a value that is not valid for the
|
|
552
554
|
# attribute.
|
|
553
555
|
#
|
|
554
|
-
# @raise [RuntimeError] if the attributes being set are corrupt.
|
|
555
|
-
#
|
|
556
556
|
# @return [Boolean] true if the path was valid, false otherwise.
|
|
557
557
|
#
|
|
558
558
|
# @version SketchUp 2015
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The {Sketchup::ComponentInstance} class is used to represent component
|
|
@@ -266,24 +266,24 @@ class Sketchup::ComponentInstance < Sketchup::Drawingelement
|
|
|
266
266
|
def locked?
|
|
267
267
|
end
|
|
268
268
|
|
|
269
|
-
# The make_unique method is used to create a component definition for this
|
|
269
|
+
# The {#make_unique} method is used to create a component definition for this
|
|
270
270
|
# instance that is not used by any other instances.
|
|
271
271
|
#
|
|
272
272
|
# @example
|
|
273
|
-
# point = Geom::Point3d.new
|
|
274
|
-
# transform = Geom::Transformation.new
|
|
273
|
+
# point = Geom::Point3d.new(10,20,30)
|
|
274
|
+
# transform = Geom::Transformation.new(point)
|
|
275
275
|
# model = Sketchup.active_model
|
|
276
276
|
# entities = model.active_entities
|
|
277
277
|
#
|
|
278
|
-
# path = Sketchup.find_support_file
|
|
279
|
-
# "Components/Components Sampler/"
|
|
278
|
+
# path = Sketchup.find_support_file("Bed.skp",
|
|
279
|
+
# "Components/Components Sampler/")
|
|
280
280
|
# definitions = model.definitions
|
|
281
|
-
# componentdefinition = definitions.load
|
|
282
|
-
# instance = entities.add_instance
|
|
281
|
+
# componentdefinition = definitions.load(path)
|
|
282
|
+
# instance = entities.add_instance(componentdefinition, transform)
|
|
283
283
|
# # Returns unique component instance
|
|
284
|
-
#
|
|
284
|
+
# instance.make_unique
|
|
285
285
|
#
|
|
286
|
-
# @return [
|
|
286
|
+
# @return [Sketchup::ComponentInstance] returns itself
|
|
287
287
|
#
|
|
288
288
|
# @version SketchUp 6.0
|
|
289
289
|
def make_unique
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Console class is used by SketchUp to direct $stdout and $stderr to the
|
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
# not produce any output.
|
|
14
14
|
#
|
|
15
15
|
# @example
|
|
16
|
-
# t = Thread.new { puts 'This will not be written to the console.' }
|
|
17
|
-
# t.join
|
|
18
|
-
#
|
|
19
|
-
# @example
|
|
20
16
|
# # By default $stdout is directed to SKETCHUP_CONSOLE.
|
|
21
17
|
# p $stdout
|
|
22
18
|
#
|
|
@@ -24,6 +20,10 @@
|
|
|
24
20
|
# # SketchUp console is by using the SKETCHUP_CONSOLE constant.
|
|
25
21
|
# p SKETCHUP_CONSOLE
|
|
26
22
|
#
|
|
23
|
+
# @example
|
|
24
|
+
# t = Thread.new { puts 'This will not be written to the console.' }
|
|
25
|
+
# t.join
|
|
26
|
+
#
|
|
27
27
|
# @version SketchUp 2014
|
|
28
28
|
class Sketchup::Console
|
|
29
29
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The ConstructionLine class contains methods for modifying construction
|
|
@@ -214,25 +214,26 @@ class Sketchup::ConstructionLine < Sketchup::Drawingelement
|
|
|
214
214
|
def start=(arg)
|
|
215
215
|
end
|
|
216
216
|
|
|
217
|
-
# The stipple method is used to retrieve the stipple pattern used to display
|
|
217
|
+
# The {#stipple} method is used to retrieve the stipple pattern used to display
|
|
218
218
|
# the construction line.
|
|
219
219
|
#
|
|
220
220
|
# @example
|
|
221
221
|
# model = Sketchup.active_model
|
|
222
222
|
# entities = model.active_entities
|
|
223
|
-
# point1 = Geom::Point3d.new(0,0,0)
|
|
224
|
-
# point2 = Geom::Point3d.new(20,20,20)
|
|
223
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
|
224
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
|
225
225
|
# constline = entities.add_cline(point1, point2)
|
|
226
|
-
#
|
|
226
|
+
# puts constline.stipple
|
|
227
227
|
#
|
|
228
|
-
# @return
|
|
228
|
+
# @return [String]
|
|
229
229
|
#
|
|
230
230
|
# @version SketchUp 6.0
|
|
231
231
|
def stipple
|
|
232
232
|
end
|
|
233
233
|
|
|
234
|
-
# The stipple= method is used to set the stipple pattern used to display
|
|
234
|
+
# The {#stipple=} method is used to set the stipple pattern used to display
|
|
235
235
|
# the construction line. The stipple pattern is given as a string.
|
|
236
|
+
#
|
|
236
237
|
# Valid strings are:
|
|
237
238
|
# - <code>"."</code> (Dotted Line),
|
|
238
239
|
# - <code>"-"</code> (Short Dashes Line),
|
|
@@ -242,13 +243,12 @@ class Sketchup::ConstructionLine < Sketchup::Drawingelement
|
|
|
242
243
|
# @example
|
|
243
244
|
# model = Sketchup.active_model
|
|
244
245
|
# entities = model.active_entities
|
|
245
|
-
# point1 = Geom::Point3d.new(0,0,0)
|
|
246
|
-
# point2 = Geom::Point3d.new(20,20,20)
|
|
246
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
|
247
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
|
247
248
|
# constline = entities.add_cline(point1, point2)
|
|
248
249
|
# constline.stipple = "-.-"
|
|
249
250
|
#
|
|
250
|
-
# @param pattern
|
|
251
|
-
# - the stipple pattern to use
|
|
251
|
+
# @param [String, Integer] pattern
|
|
252
252
|
#
|
|
253
253
|
# @version SketchUp 6.0
|
|
254
254
|
def stipple=(pattern)
|
data/SketchUp/Sketchup/Curve.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# A DefinitionList object holds a list of all of the ComponentDefinition
|
|
@@ -32,14 +32,14 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
|
32
32
|
# @param [Integer] index The index for a specific component definition.
|
|
33
33
|
# @return [Sketchup::ComponentDefinition, nil]
|
|
34
34
|
#
|
|
35
|
-
# @overload [](
|
|
35
|
+
# @overload [](name)
|
|
36
36
|
#
|
|
37
|
-
# @param [String]
|
|
37
|
+
# @param [String] name The unique GUID for the component definition.
|
|
38
38
|
# @return [Sketchup::ComponentDefinition, nil]
|
|
39
39
|
#
|
|
40
|
-
# @overload [](
|
|
40
|
+
# @overload [](guid)
|
|
41
41
|
#
|
|
42
|
-
# @param [String]
|
|
42
|
+
# @param [String] guid The name of an existing component definition.
|
|
43
43
|
# @return [Sketchup::ComponentDefinition, nil]
|
|
44
44
|
#
|
|
45
45
|
# @version SketchUp 6.0
|
|
@@ -99,14 +99,14 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
|
99
99
|
# @param [Integer] index The index for a specific component definition.
|
|
100
100
|
# @return [Sketchup::ComponentDefinition, nil]
|
|
101
101
|
#
|
|
102
|
-
# @overload [](
|
|
102
|
+
# @overload [](name)
|
|
103
103
|
#
|
|
104
|
-
# @param [String]
|
|
104
|
+
# @param [String] name The unique GUID for the component definition.
|
|
105
105
|
# @return [Sketchup::ComponentDefinition, nil]
|
|
106
106
|
#
|
|
107
|
-
# @overload [](
|
|
107
|
+
# @overload [](guid)
|
|
108
108
|
#
|
|
109
|
-
# @param [String]
|
|
109
|
+
# @param [String] guid The name of an existing component definition.
|
|
110
110
|
# @return [Sketchup::ComponentDefinition, nil]
|
|
111
111
|
#
|
|
112
112
|
# @version SketchUp 6.0
|
|
@@ -178,6 +178,9 @@ class Sketchup::DefinitionList < Sketchup::Entity
|
|
|
178
178
|
# @param [String] path
|
|
179
179
|
# The path where the component definition file is located.
|
|
180
180
|
#
|
|
181
|
+
# @raise RuntimeError If filename is an invalid SketchUp model. Added in
|
|
182
|
+
# SketchUp 2019. Possible that prior versions of SketchUp will crash.
|
|
183
|
+
#
|
|
181
184
|
# @return [Sketchup::ComponentDefinition] the loaded ComponentDefinition
|
|
182
185
|
# object if successful
|
|
183
186
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# This observer interface is implemented to react to component definition
|
|
@@ -47,23 +47,22 @@ class Sketchup::DefinitionObserver < Sketchup::EntityObserver
|
|
|
47
47
|
# The {#onComponentInstanceRemoved} method is called when a component
|
|
48
48
|
# instance is removed from a model.
|
|
49
49
|
#
|
|
50
|
-
# implemented, this method is fired on a Move + Copy operation even
|
|
51
|
-
# though no {Sketchup::ComponentInstance} is apparently removed.
|
|
52
|
-
#
|
|
53
50
|
# @example
|
|
54
51
|
# def onComponentInstanceRemoved(definition, instance)
|
|
55
52
|
# puts "onComponentInstanceRemoved(#{definition}, #{instance})"
|
|
56
53
|
# end
|
|
57
54
|
#
|
|
58
55
|
# @note Due to the underlying way that the SketchUp Move Tool is
|
|
59
|
-
#
|
|
60
|
-
#
|
|
61
|
-
# The removed instance
|
|
56
|
+
# implemented, this method is fired on a Move + Copy operation even
|
|
57
|
+
# though no {Sketchup::ComponentInstance} is apparently removed.
|
|
62
58
|
#
|
|
63
59
|
# @param [Sketchup::ComponentDefinition] definition
|
|
64
60
|
# The definition of the
|
|
65
61
|
# instance removed
|
|
66
62
|
#
|
|
63
|
+
# @param [Sketchup::ComponentInstance] instance
|
|
64
|
+
# The removed instance
|
|
65
|
+
#
|
|
67
66
|
# @return [nil]
|
|
68
67
|
#
|
|
69
68
|
# @version SketchUp 6.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# This observer interface is implemented to react to events on a definitions
|
|
@@ -69,10 +69,10 @@ class Sketchup::DefinitionsObserver
|
|
|
69
69
|
#
|
|
70
70
|
# @note This methods fires twice for each Component/Group erased.
|
|
71
71
|
#
|
|
72
|
-
# @param [Sketchup::ComponentDefinition] definition
|
|
73
|
-
#
|
|
74
72
|
# @param [Sketchup::DefinitionList] definitions
|
|
75
73
|
#
|
|
74
|
+
# @param [Sketchup::ComponentDefinition] definition
|
|
75
|
+
#
|
|
76
76
|
# @return [nil]
|
|
77
77
|
#
|
|
78
78
|
# @version SketchUp 6.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The DimensionLinear class represents linear dimensions.
|
|
@@ -108,6 +108,46 @@ class Sketchup::DimensionLinear < Sketchup::Dimension
|
|
|
108
108
|
def end=(pt_or_entity)
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
+
# The {#end_attached_to} method will return the attached end point via an array
|
|
112
|
+
# containing the {Sketchup::InstancePath} and {Geom::Point3d}.
|
|
113
|
+
#
|
|
114
|
+
# @example
|
|
115
|
+
# # Assuming you have a valid dimension selected that is attached to a
|
|
116
|
+
# # component instance
|
|
117
|
+
# dim = Sketchup.active_model.selection[0]
|
|
118
|
+
# dim.end_attached_to
|
|
119
|
+
#
|
|
120
|
+
# @return [Array(Sketchup::InstancePath, Geom::Point3d), nil]
|
|
121
|
+
#
|
|
122
|
+
# @version SketchUp 2019
|
|
123
|
+
def end_attached_to
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# The {#end_attached_to=} method will attach the ending point to the
|
|
127
|
+
# {Sketchup::InstancePath} and {Geom::Point3d}.
|
|
128
|
+
#
|
|
129
|
+
# @example
|
|
130
|
+
# # Assuming you have a valid dimension selected that is attached to a
|
|
131
|
+
# # component instance
|
|
132
|
+
# dim = Sketchup.active_model.selection[0]
|
|
133
|
+
# # get the path (instance_path, point)
|
|
134
|
+
# path = dim.end_attached_to
|
|
135
|
+
# instance_path = path[0]
|
|
136
|
+
# instance = instance_path.to_a[0]
|
|
137
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
|
138
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
|
139
|
+
# instance.definition.entities.add_edges(point1, point2)
|
|
140
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
|
141
|
+
# new_instance_path = Sketchup::InstancePath.new([instance, edge])
|
|
142
|
+
# point2 = point2.transform(new_instance_path.transformation.inverse)
|
|
143
|
+
# dim.end_attached_to = [new_instance_path, point2]
|
|
144
|
+
#
|
|
145
|
+
# @param [Array(Sketchup::InstancePath, Geom::Point3d)] path
|
|
146
|
+
#
|
|
147
|
+
# @version SketchUp 2019
|
|
148
|
+
def end_attached_to=(path)
|
|
149
|
+
end
|
|
150
|
+
|
|
111
151
|
# The offset_vector method returns the parallel offset vector from the
|
|
112
152
|
# reference line to the dimension line measured from the 'start' reference
|
|
113
153
|
# point.
|
|
@@ -189,6 +229,46 @@ class Sketchup::DimensionLinear < Sketchup::Dimension
|
|
|
189
229
|
def start=(pt_or_entity)
|
|
190
230
|
end
|
|
191
231
|
|
|
232
|
+
# The {#start_attached_to} method will return the attached start point via an
|
|
233
|
+
# array containing the {Sketchup::InstancePath} and {Geom::Point3d}.
|
|
234
|
+
#
|
|
235
|
+
# @example
|
|
236
|
+
# # Assuming you have a valid dimension selected that is attached to a
|
|
237
|
+
# # component instance
|
|
238
|
+
# dim = Sketchup.active_model.selection[0]
|
|
239
|
+
# dim.start_attached_to
|
|
240
|
+
#
|
|
241
|
+
# @return [Array(Sketchup::InstancePath, Geom::Point3d), nil]
|
|
242
|
+
#
|
|
243
|
+
# @version SketchUp 2019
|
|
244
|
+
def start_attached_to
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# The {#start_attached_to=} method will attach the starting point to the
|
|
248
|
+
# {Sketchup::InstancePath} and {Geom::Point3d}.
|
|
249
|
+
#
|
|
250
|
+
# @example
|
|
251
|
+
# # Assuming you have a valid dimension selected that is attached to a
|
|
252
|
+
# # component instance
|
|
253
|
+
# dim = Sketchup.active_model.selection[0]
|
|
254
|
+
# # get the path (instance_path, point)
|
|
255
|
+
# path = dim.start_attached_to
|
|
256
|
+
# instance_path = path[0]
|
|
257
|
+
# instance = instance_path.to_a[0]
|
|
258
|
+
# point1 = Geom::Point3d.new(0, 0, 0)
|
|
259
|
+
# point2 = Geom::Point3d.new(20, 20, 20)
|
|
260
|
+
# instance.definition.entities.add_edges(point1, point2)
|
|
261
|
+
# edge = instance.definition.entities.grep(Sketchup::Edge).first
|
|
262
|
+
# new_instance_path = Sketchup::InstancePath.new([instance, edge])
|
|
263
|
+
# point2 = point2.transform(new_instance_path.transformation.inverse)
|
|
264
|
+
# dim.start_attached_to = [new_instance_path, point2]
|
|
265
|
+
#
|
|
266
|
+
# @param [Array(Sketchup::InstancePath, Geom::Point3d)] path
|
|
267
|
+
#
|
|
268
|
+
# @version SketchUp 2019
|
|
269
|
+
def start_attached_to=(path)
|
|
270
|
+
end
|
|
271
|
+
|
|
192
272
|
# The text_position method returns the position of the text along the dimension
|
|
193
273
|
# line. Valid values are class constants:
|
|
194
274
|
# - DimensionLinear::TEXT_OUTSIDE_START
|
data/SketchUp/Sketchup/Edge.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2019 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Edge class contains methods modifying and extracting information for
|
|
@@ -209,32 +209,29 @@ class Sketchup::Edge < Sketchup::Drawingelement
|
|
|
209
209
|
def find_faces
|
|
210
210
|
end
|
|
211
211
|
|
|
212
|
-
# The length method is used to retrieve the length of an edge in current
|
|
212
|
+
# The {#length} method is used to retrieve the length of an edge in current
|
|
213
213
|
# units.
|
|
214
214
|
#
|
|
215
|
-
# You can pass in an optional Transformation (or an array that can
|
|
216
|
-
# transformation), to correct for a parent group's transformation.
|
|
217
|
-
# if an edge is inside of a group that is scaled to 200%, the
|
|
218
|
-
# will return the unscaled length of the edge. So by passing a
|
|
219
|
-
# transformation object to this method, you can account for that to get
|
|
220
|
-
# "visual" length of the edge.
|
|
215
|
+
# You can pass in an optional {Geom::Transformation} (or an array that can
|
|
216
|
+
# represent a transformation), to correct for a parent group's transformation.
|
|
217
|
+
# For example, if an edge is inside of a group that is scaled to 200%, the
|
|
218
|
+
# length method will return the unscaled length of the edge. So by passing a
|
|
219
|
+
# 200% transformation object to this method, you can account for that to get
|
|
220
|
+
# the "visual" length of the edge.
|
|
221
221
|
#
|
|
222
222
|
# @example
|
|
223
|
-
# edge = Sketchup.active_model.entities.add_line([0,0,0],[100,100,0])
|
|
224
|
-
# length
|
|
225
|
-
# if (length)
|
|
226
|
-
# UI.messagebox length
|
|
227
|
-
# end
|
|
223
|
+
# edge = Sketchup.active_model.entities.add_line([0, 0, 0], [100, 100, 0])
|
|
224
|
+
# puts "#{edge.length} (#{edge.length.inspect})"
|
|
228
225
|
#
|
|
229
226
|
# @overload length
|
|
230
227
|
#
|
|
231
|
-
# @return [Length] the length of the edge
|
|
228
|
+
# @return [Length] the length of the edge
|
|
232
229
|
#
|
|
233
230
|
# @overload length(transform)
|
|
234
231
|
#
|
|
235
232
|
# @param transform [Geom::Transformation] A Transformation object or array
|
|
236
|
-
#
|
|
237
|
-
# @return [Length] the length of the edge
|
|
233
|
+
# that can be interpreted as a Transformation object.
|
|
234
|
+
# @return [Length] the length of the edge
|
|
238
235
|
#
|
|
239
236
|
# @version SketchUp 6.0
|
|
240
237
|
def length(*args)
|