sketchup-api-stubs 0.7.7 → 0.7.8
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 +2 -1
- data/lib/sketchup-api-stubs/stubs/{array.rb → Array.rb} +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +18 -4
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +16 -14
- data/lib/sketchup-api-stubs/stubs/{geom.rb → Geom.rb} +1 -1
- data/lib/sketchup-api-stubs/stubs/{languagehandler.rb → LanguageHandler.rb} +5 -4
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +76 -54
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +311 -24
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +8 -4
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +2 -1
- 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 +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +16 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +2 -2
- 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 +1 -1
- 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 +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +9 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1 -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 → Length.rb} +1 -1
- data/lib/sketchup-api-stubs/stubs/{numeric.rb → Numeric.rb} +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +13 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +50 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +7 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +1 -1
- 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 +7 -6
- 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 +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +120 -41
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesBuilder.rb +272 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +27 -7
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +4 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +7 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +8 -8
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +3 -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/Loop.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +2 -2
- 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 +68 -71
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +7 -7
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +4 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +1 -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 +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +7 -4
- 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/Style.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +2 -2
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +5 -3
- 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 +9 -5
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +14 -4
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/{sketchup.rb → Sketchup.rb} +10 -3
- data/lib/sketchup-api-stubs/stubs/{sketchupextension.rb → SketchupExtension.rb} +1 -1
- data/lib/sketchup-api-stubs/stubs/{string.rb → String.rb} +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +79 -7
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +26 -8
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +1 -1
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +18 -16
- data/lib/sketchup-api-stubs/stubs/{ui.rb → UI.rb} +25 -14
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +1 -1
- metadata +12 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The {Sketchup::PickHelper} class is used to pick entities that reside under
|
|
@@ -73,6 +73,8 @@ class Sketchup::PickHelper
|
|
|
73
73
|
# criteria can be for completely-contained or partially-contained entities,
|
|
74
74
|
# similar to how the Selection tool works.
|
|
75
75
|
#
|
|
76
|
+
# transformation) if num_picked > 0 Sketchup.active_model.selection.add(ph.all_picked) end
|
|
77
|
+
#
|
|
76
78
|
# @example
|
|
77
79
|
# boundingbox = Geom::BoundingBox.new
|
|
78
80
|
# boundingbox.add([1, 1, 1], [100, 100, 100])
|
|
@@ -82,10 +84,7 @@ class Sketchup::PickHelper
|
|
|
82
84
|
# angle = 45
|
|
83
85
|
# transformation = Geom::Transformation.new(ORIGIN, Z_AXIS, angle)
|
|
84
86
|
#
|
|
85
|
-
# num_picked = ph.boundingbox_pick(boundingbox, Sketchup::PickHelper::PICK_CROSSING,
|
|
86
|
-
# if num_picked > 0
|
|
87
|
-
# Sketchup.active_model.selection.add(ph.all_picked)
|
|
88
|
-
# end
|
|
87
|
+
# num_picked = ph.boundingbox_pick(boundingbox, Sketchup::PickHelper::PICK_CROSSING,
|
|
89
88
|
#
|
|
90
89
|
# @param bounding_box
|
|
91
90
|
# BoundingBox object defining the volume to use for picking
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# A set of the currently selected entities. Use the Model.selection method
|
|
@@ -155,7 +155,7 @@ class Sketchup::Selection
|
|
|
155
155
|
# number = selection.count
|
|
156
156
|
#
|
|
157
157
|
# @note Since SketchUp 2014 the count method is inherited from Ruby's
|
|
158
|
-
# +
|
|
158
|
+
# +Enumerable+ mix-in module. Prior to that the {#count} method is an alias
|
|
159
159
|
# for {#length}.
|
|
160
160
|
#
|
|
161
161
|
# @return [Integer]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The ShadowInfo class contains method to extract the shadow information for a
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
#
|
|
8
8
|
# The following shadow information keys are maintained in SketchUp:
|
|
9
9
|
#
|
|
10
|
-
# - +City+ (in Model Info > Geo-location > Set Manual Location...) Note that 'City' is called
|
|
10
|
+
# - +City+ (in Model Info > Geo-location > Set Manual Location...) Note that 'City' is called
|
|
11
|
+
# 'Location' in the UI
|
|
11
12
|
# - +Country+ (in Model Info > Geo-location > Set Manual Location...)
|
|
12
13
|
# - +Dark+ (in Window > Shadows)
|
|
13
14
|
# - +DayOfYear+
|
|
14
15
|
# - +DaylightSavings+
|
|
15
|
-
# - +DisplayNorth+ (in View > Toolbars > Solar North) Note that 'Toolbar' is called 'Tool Palettes'
|
|
16
|
+
# - +DisplayNorth+ (in View > Toolbars > Solar North) Note that 'Toolbar' is called 'Tool Palettes'
|
|
17
|
+
# on Mac
|
|
16
18
|
# - +DisplayOnAllFaces+ (in Window > Shadows)
|
|
17
19
|
# - +DisplayOnGroundPlane+ (in Window > Shadows)
|
|
18
20
|
# - +DisplayShadows+ (in Window > Shadows)
|
|
@@ -20,7 +22,8 @@
|
|
|
20
22
|
# - +Latitude+ (in Model Info > Geo-location > Set Manual Location...)
|
|
21
23
|
# - +Light+ (in Window > Shadows)
|
|
22
24
|
# - +Longitude+ (in Model Info > Geo-location > Set Manual Location...)
|
|
23
|
-
# - +NorthAngle+ (in View > Toolbars > Solar North) Note that 'Toolbar' is called 'Tool Palettes'
|
|
25
|
+
# - +NorthAngle+ (in View > Toolbars > Solar North) Note that 'Toolbar' is called 'Tool Palettes'
|
|
26
|
+
# on Mac
|
|
24
27
|
# - +ShadowTime+ (in Window > Shadows)
|
|
25
28
|
# - +ShadowTime_time_t+ (ShadowTime in Epoch time)
|
|
26
29
|
# - +SunDirection+ (Generated based on ShadowTime)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Styles class contains methods for manipulating a collection of styles in
|
|
@@ -94,7 +94,7 @@ class Sketchup::Styles < Sketchup::Entity
|
|
|
94
94
|
# number = styles.count
|
|
95
95
|
#
|
|
96
96
|
# @note Since SketchUp 2014 the count method is inherited from Ruby's
|
|
97
|
-
# +
|
|
97
|
+
# +Enumerable+ mix-in module. Prior to that the {#count} method is an alias
|
|
98
98
|
# for {#length}.
|
|
99
99
|
#
|
|
100
100
|
# @return [Integer]
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# Tool is the interface that you implement to create a SketchUp tool.
|
|
5
|
-
# See
|
|
6
|
-
#
|
|
5
|
+
# See
|
|
6
|
+
# {our code
|
|
7
|
+
# example}[https://github.com/SketchUp/sketchup-ruby-api-tutorials/tree/main/examples/02_custom_tool]
|
|
8
|
+
# for how to create a custom tool in Ruby.
|
|
7
9
|
#
|
|
8
10
|
# To create a new tool in Ruby, you must define a new class that implements
|
|
9
11
|
# the methods for the events that you want to respond to. You do not have
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The UV Helper class contains methods allowing you to determine the location
|
|
@@ -22,8 +22,10 @@ class Sketchup::UVHelper
|
|
|
22
22
|
# face.outer_loop.vertices.each do |vert|
|
|
23
23
|
# uvq = uv_helper.get_back_UVQ(vert.position)
|
|
24
24
|
# # "Normalize" UVQ to UV.
|
|
25
|
-
#
|
|
26
|
-
#
|
|
25
|
+
# # #x, #y and #z corresponds to U, V and Q respectively,
|
|
26
|
+
# # as SketchUp re-uses the normal Point3d objects for UVQs
|
|
27
|
+
# u = uvq.x / uvq.z
|
|
28
|
+
# v = uvq.y / uvq.z
|
|
27
29
|
# puts "u=#{u} v=#{v}""
|
|
28
30
|
# end
|
|
29
31
|
#
|
|
@@ -49,8 +51,10 @@ class Sketchup::UVHelper
|
|
|
49
51
|
# face.outer_loop.vertices.each do |vert|
|
|
50
52
|
# uvq = uv_helper.get_front_UVQ(vert.position)
|
|
51
53
|
# # "Normalize" UVQ to UV.
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
+
# # #x, #y and #z corresponds to U, V and Q respectively,
|
|
55
|
+
# # as SketchUp re-uses the normal Point3d objects for UVQs
|
|
56
|
+
# u = uvq.x / uvq.z
|
|
57
|
+
# v = uvq.y / uvq.z
|
|
54
58
|
# puts "u=#{u} v=#{v}""
|
|
55
59
|
# end
|
|
56
60
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# This class contains methods to manipulate the current point of view of the
|
|
@@ -462,10 +462,18 @@ class Sketchup::View
|
|
|
462
462
|
# around the full bounds of the text, use {#text_bounds} to compute the
|
|
463
463
|
# desired alignment.
|
|
464
464
|
#
|
|
465
|
+
# The vertical alignment can vary between fonts and platforms. It's recommended
|
|
466
|
+
# to test different fonts and find one that fits well across both platforms
|
|
467
|
+
# for your purposes.
|
|
468
|
+
#
|
|
465
469
|
# <b>Example of different vertical alignment and text bounds:</b>
|
|
466
470
|
#
|
|
467
471
|
# rdoc-image:../images/view-draw-text-with-bounds.png
|
|
468
472
|
#
|
|
473
|
+
# @bug Prior to SU2022.0, on macOS, the vertical text alignment for some fonts
|
|
474
|
+
# could appear to be offset from their expected positions. As of SU2022.0 the
|
|
475
|
+
# vertical alignment should be more accurate and consistent.
|
|
476
|
+
#
|
|
469
477
|
# @example
|
|
470
478
|
# class ExampleTool
|
|
471
479
|
# def draw(view)
|
|
@@ -505,7 +513,7 @@ class Sketchup::View
|
|
|
505
513
|
# def draw_text(view, position, text, **options)
|
|
506
514
|
# native_options = options.dup
|
|
507
515
|
# if IS_WIN && options.key?(:size)
|
|
508
|
-
# native_options[:size] = pixels_to_points(size)
|
|
516
|
+
# native_options[:size] = pixels_to_points(options[:size])
|
|
509
517
|
# end
|
|
510
518
|
# view.draw_text(position, text, **native_options)
|
|
511
519
|
# end
|
|
@@ -1192,8 +1200,7 @@ class Sketchup::View
|
|
|
1192
1200
|
# For other file formats available from the GUI in File > Export > 2D
|
|
1193
1201
|
# Graphics, .e.g `.pdf`, use {Sketchup::Model#export}.
|
|
1194
1202
|
#
|
|
1195
|
-
#
|
|
1196
|
-
#
|
|
1203
|
+
# compression = 1.0)
|
|
1197
1204
|
# @note Prefer the overload with option hash instead of this variant. This
|
|
1198
1205
|
# overload is not updated with new options.
|
|
1199
1206
|
#
|
|
@@ -1215,6 +1222,9 @@ class Sketchup::View
|
|
|
1215
1222
|
# @param [Float] compression
|
|
1216
1223
|
# Compression factor for JPEG images, between +0.0+ and +1.0+.
|
|
1217
1224
|
#
|
|
1225
|
+
# @overload write_image(filename, width = view.vpwidth, height = view.vpheight, antialias = false,
|
|
1226
|
+
#
|
|
1227
|
+
#
|
|
1218
1228
|
# @overload write_image(options)
|
|
1219
1229
|
#
|
|
1220
1230
|
# @example
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Sketchup module contains a number of important utility methods for use in
|
|
@@ -140,6 +140,11 @@ module Sketchup
|
|
|
140
140
|
# @example
|
|
141
141
|
# Sketchup.debug_mode = true
|
|
142
142
|
#
|
|
143
|
+
# @note Changing this value within your extension can cause problems for other
|
|
144
|
+
# extension developers who rely on the debug information for their own work.
|
|
145
|
+
# Only use this locally; never change this value in an extension you
|
|
146
|
+
# publish.
|
|
147
|
+
#
|
|
143
148
|
# @param [Boolean] enabled
|
|
144
149
|
# If true, SketchUp will produce debug warnings.
|
|
145
150
|
#
|
|
@@ -182,11 +187,13 @@ module Sketchup
|
|
|
182
187
|
# Returns the ExtensionsManager where you can find all registered
|
|
183
188
|
# SketchupExtension objects.
|
|
184
189
|
#
|
|
190
|
+
# #{extension.loaded?}"
|
|
191
|
+
# }
|
|
192
|
+
#
|
|
185
193
|
# @example
|
|
186
194
|
# extensions = Sketchup.extensions
|
|
187
195
|
# extensions.each{ |extension|
|
|
188
|
-
# puts "The next extension is named: #{extension.name} and its loaded? state is:
|
|
189
|
-
# }
|
|
196
|
+
# puts "The next extension is named: #{extension.name} and its loaded? state is:
|
|
190
197
|
#
|
|
191
198
|
# @return [Sketchup::ExtensionsManager] an ExtensionsManager object.
|
|
192
199
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Command class is the preferred class for adding tools to the menus and
|
|
@@ -67,6 +67,58 @@ class UI::Command
|
|
|
67
67
|
|
|
68
68
|
# Instance Methods
|
|
69
69
|
|
|
70
|
+
# The {#extension} method returns the command's associated extension.
|
|
71
|
+
#
|
|
72
|
+
# @example
|
|
73
|
+
# extension = Sketchup.extensions['Sandbox Tools']
|
|
74
|
+
# cmd = UI::Command.new("Tester") {}
|
|
75
|
+
# cmd.extension = extension
|
|
76
|
+
# p cmd.extension == extension
|
|
77
|
+
#
|
|
78
|
+
# @note This is an advanced feature that extension developers normally won't
|
|
79
|
+
# have to deal with. It's purpose is to address scenarios when SketchUp
|
|
80
|
+
# isn't able to automatically infer which extension the command belongs to.
|
|
81
|
+
#
|
|
82
|
+
# @return [SketchupExtension, nil]
|
|
83
|
+
#
|
|
84
|
+
# @version SketchUp 2022.0
|
|
85
|
+
def extension
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# The {#extension=} method explicitly sets the command's associated extension.
|
|
89
|
+
#
|
|
90
|
+
# @example
|
|
91
|
+
# extension = Sketchup.extensions['Sandbox Tools']
|
|
92
|
+
# cmd = UI::Command.new("Tester") {}
|
|
93
|
+
# cmd.extension = extension
|
|
94
|
+
#
|
|
95
|
+
# @note This is an advanced feature that extension developers normally won't
|
|
96
|
+
# have to deal with. It's purpose is to address scenarios when SketchUp
|
|
97
|
+
# isn't able to automatically infer which extension the command belongs to.
|
|
98
|
+
# These scenarios are for example an extension using a library to add its
|
|
99
|
+
# commands or command manager extensions.
|
|
100
|
+
#
|
|
101
|
+
# @param [SketchupExtension, nil] extension
|
|
102
|
+
#
|
|
103
|
+
# @version SketchUp 2022.0
|
|
104
|
+
def extension=(extension)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# The {#get_validation_proc} method returns the command's validation proc.
|
|
108
|
+
#
|
|
109
|
+
# @example
|
|
110
|
+
# cmd = UI::Command.new("Tester") {}
|
|
111
|
+
# cmd.set_validation_proc { MF_DISABLED }
|
|
112
|
+
# proc = cmd.get_validation_proc
|
|
113
|
+
#
|
|
114
|
+
# @return [Proc, nil]
|
|
115
|
+
#
|
|
116
|
+
# @see #set_validation_proc
|
|
117
|
+
#
|
|
118
|
+
# @version SketchUp 2022.0
|
|
119
|
+
def get_validation_proc
|
|
120
|
+
end
|
|
121
|
+
|
|
70
122
|
# The large_icon method returns the icon file for the command's
|
|
71
123
|
# large icon.
|
|
72
124
|
#
|
|
@@ -149,6 +201,21 @@ class UI::Command
|
|
|
149
201
|
def menu_text=(menuitem)
|
|
150
202
|
end
|
|
151
203
|
|
|
204
|
+
# The {#proc} method returns the command's proc that is called when the command
|
|
205
|
+
# is invoked.
|
|
206
|
+
#
|
|
207
|
+
# @example
|
|
208
|
+
# cmd = UI::Command.new("Tester") {}
|
|
209
|
+
# cmd.set_validation_proc { MF_DISABLED }
|
|
210
|
+
# proc = cmd.proc
|
|
211
|
+
# proc.call
|
|
212
|
+
#
|
|
213
|
+
# @return [Proc]
|
|
214
|
+
#
|
|
215
|
+
# @version SketchUp 2022.0
|
|
216
|
+
def proc
|
|
217
|
+
end
|
|
218
|
+
|
|
152
219
|
# The {#set_validation_proc} method allows you to change whether the command
|
|
153
220
|
# is enabled, checked, etc. For instance, the command toggling a dialog window
|
|
154
221
|
# may be displayed as checked while the dialog is open.
|
|
@@ -177,6 +244,8 @@ class UI::Command
|
|
|
177
244
|
#
|
|
178
245
|
# @return [UI::Command]
|
|
179
246
|
#
|
|
247
|
+
# @see #get_validation_proc
|
|
248
|
+
#
|
|
180
249
|
# @version SketchUp 6.0
|
|
181
250
|
#
|
|
182
251
|
# @yield []
|
|
@@ -236,13 +305,13 @@ class UI::Command
|
|
|
236
305
|
# command.
|
|
237
306
|
#
|
|
238
307
|
# @example
|
|
239
|
-
# toolbar = UI::Toolbar.new
|
|
308
|
+
# toolbar = UI::Toolbar.new("Test")
|
|
240
309
|
# # This toolbar tool simply displays Hello World on the screen
|
|
241
310
|
# # when clicked
|
|
242
311
|
# cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
|
|
243
312
|
# cmd.small_icon = "ToolPencilSmall.png"
|
|
244
313
|
# cmd.large_icon = "ToolPencilLarge.png"
|
|
245
|
-
# cmd.status_bar_text =
|
|
314
|
+
# cmd.status_bar_text = "Testing the toolbars class."
|
|
246
315
|
# toolbar = toolbar.add_item cmd
|
|
247
316
|
# toolbar.show
|
|
248
317
|
# puts cmd.status_bar_text
|
|
@@ -254,15 +323,15 @@ class UI::Command
|
|
|
254
323
|
end
|
|
255
324
|
|
|
256
325
|
# The status_bar_text= method is used to set the status bar text for the
|
|
257
|
-
# command.
|
|
326
|
+
# command. This should be a description what the command does.
|
|
258
327
|
#
|
|
259
328
|
# @example
|
|
260
|
-
# toolbar = UI::Toolbar.new
|
|
329
|
+
# toolbar = UI::Toolbar.new("Test")
|
|
261
330
|
# # This toolbar tool simply displays Hello World on the screen when clicked
|
|
262
331
|
# cmd = UI::Command.new("Tester") { UI.messagebox("Hello World") }
|
|
263
332
|
# cmd.small_icon = "ToolPencilSmall.png"
|
|
264
333
|
# cmd.large_icon = "ToolPencilLarge.png"
|
|
265
|
-
# cmd.status_bar_text =
|
|
334
|
+
# cmd.status_bar_text = "Testing the toolbars class."
|
|
266
335
|
# toolbar = toolbar.add_item cmd
|
|
267
336
|
# toolbar.show
|
|
268
337
|
#
|
|
@@ -293,7 +362,7 @@ class UI::Command
|
|
|
293
362
|
def tooltip
|
|
294
363
|
end
|
|
295
364
|
|
|
296
|
-
# The tooltip= method is used to define a command item's tooltip
|
|
365
|
+
# The {#tooltip=} method is used to define a command item's tooltip header. Tooltips
|
|
297
366
|
# will appear when the command is attached to a tool bar and the user hovers
|
|
298
367
|
# their cursor over the icon.
|
|
299
368
|
#
|
|
@@ -305,6 +374,9 @@ class UI::Command
|
|
|
305
374
|
# toolbar = toolbar.add_item cmd
|
|
306
375
|
# toolbar.show
|
|
307
376
|
#
|
|
377
|
+
# @note The tooltip text should repeat the commands' title text. For the command
|
|
378
|
+
# description, use {#status_bar_text}.
|
|
379
|
+
#
|
|
308
380
|
# @param [String] text
|
|
309
381
|
# The text of the tooltip.
|
|
310
382
|
#
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Ruby HtmlDialog class allows you to create and interact with HTML dialog
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
#
|
|
17
17
|
# For usage examples, including how to migrate from the old WebDialog class,
|
|
18
18
|
# see https://github.com/SketchUp/htmldialog-examples.
|
|
19
|
+
# You may use the {https://sketchup.github.io/modus-for-sketchup-extensions Trimble Modus}
|
|
20
|
+
# framework for a look and feel of your dialog that matches that of SketchUp's dialogs.
|
|
19
21
|
#
|
|
20
22
|
# HtmlDialog uses the following versions of CEF (Chromium Embedded Framework):
|
|
21
23
|
#
|
|
@@ -150,7 +152,8 @@ class UI::HtmlDialog
|
|
|
150
152
|
def execute_script(script)
|
|
151
153
|
end
|
|
152
154
|
|
|
153
|
-
# The {#get_content_size} method is used to get the content size of the HtmlDialog, in logical
|
|
155
|
+
# The {#get_content_size} method is used to get the content size of the HtmlDialog, in logical
|
|
156
|
+
# pixels.
|
|
154
157
|
#
|
|
155
158
|
# @example
|
|
156
159
|
# width, height = dialog.get_content_size
|
|
@@ -192,7 +195,8 @@ class UI::HtmlDialog
|
|
|
192
195
|
|
|
193
196
|
# The new method is used to create a new HtmlDialog.
|
|
194
197
|
#
|
|
195
|
-
#
|
|
198
|
+
# In SketchUp 2021.1 +use_content_size+ was added.
|
|
199
|
+
# When set to +true+, +width+, +height+, +min_width+,
|
|
196
200
|
# +max width+, +min_height+, +max_height+ will represent the size of the
|
|
197
201
|
# content area of the window. This excludes the titlebar and the window frame.
|
|
198
202
|
# When +use_content_size+ is set to +false+ (the default value),
|
|
@@ -210,6 +214,23 @@ class UI::HtmlDialog
|
|
|
210
214
|
# [+UI::HtmlDialog::STYLE_UTILITY+] HtmlDialog is shown with small titlebar
|
|
211
215
|
# and stays on top of SketchUp.
|
|
212
216
|
#
|
|
217
|
+
# @bug Prior to SketchUp 2019 the +:width+ and +:height+ provided is ignored
|
|
218
|
+
# if a +:preference_key+ is also present. To work around this bug on older
|
|
219
|
+
# versions use {#set_size} after you initialize the dialog.
|
|
220
|
+
#
|
|
221
|
+
# @bug SketchUp 2022.0 fixed a bug where position was set incorrectly when
|
|
222
|
+
# +use_content_size+ was set to +true+.
|
|
223
|
+
#
|
|
224
|
+
# @bug SketchUp 2022.0 fixed a bug where +max_height+ and +max_width+ were swapped
|
|
225
|
+
# when +use_content_size+ was set to +true+.
|
|
226
|
+
#
|
|
227
|
+
# @bug SketchUp 2022.0 fixed a bug where +use_content_size+ was not persisted (when
|
|
228
|
+
# +preferences_key+ is set).
|
|
229
|
+
#
|
|
230
|
+
# @bug SketchUp 2022.0 fixed a bug on Mac where size and position of the
|
|
231
|
+
# HtmlDialog were not persisted when SketchUp was closed without first
|
|
232
|
+
# closing the HtmlDialog window.
|
|
233
|
+
#
|
|
213
234
|
# @example With options Hash
|
|
214
235
|
# dialog = UI::HtmlDialog.new(
|
|
215
236
|
# {
|
|
@@ -249,10 +270,6 @@ class UI::HtmlDialog
|
|
|
249
270
|
# dialog.set_url("https://www.sketchup.com")
|
|
250
271
|
# dialog.show
|
|
251
272
|
#
|
|
252
|
-
# @note Prior to SketchUp 2019 the +:width+ and +:height+ provided is ignored
|
|
253
|
-
# if a +:preference_key+ is also present. To work around this bug on older
|
|
254
|
-
# versions use {#set_size} after you initialize the dialog.
|
|
255
|
-
#
|
|
256
273
|
# @note Prefix +preference_key+ with something unique to your extension.
|
|
257
274
|
#
|
|
258
275
|
# @note If there is no reference kept to the HtmlDialog object, the window
|
|
@@ -316,7 +333,8 @@ class UI::HtmlDialog
|
|
|
316
333
|
def set_can_close
|
|
317
334
|
end
|
|
318
335
|
|
|
319
|
-
# The {#set_content_size} method is used to set the content size of the HtmlDialog, in logical
|
|
336
|
+
# The {#set_content_size} method is used to set the content size of the HtmlDialog, in logical
|
|
337
|
+
# pixels.
|
|
320
338
|
#
|
|
321
339
|
# @example
|
|
322
340
|
# dialog.set_content_size(600, 400)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright:: Copyright
|
|
1
|
+
# Copyright:: Copyright 2022 Trimble Inc.
|
|
2
2
|
# License:: The MIT License (MIT)
|
|
3
3
|
|
|
4
4
|
# The Ruby WebDialog class allows you to create and interact with DHTML dialog
|
|
@@ -177,6 +177,22 @@ class UI::WebDialog
|
|
|
177
177
|
|
|
178
178
|
# The +new+ method is used to create a new webdialog.
|
|
179
179
|
#
|
|
180
|
+
# 250, left = 0, top = 0, resizable = true)
|
|
181
|
+
# @param [String] dialog_title The title to be displayed in the webdialog.
|
|
182
|
+
# @param [Boolean] scrollable true if you want to allow scrollbars, false
|
|
183
|
+
# if you do not want to allow scrollbars.
|
|
184
|
+
# @param [String, nil] pref_key The registry entry where the location and
|
|
185
|
+
# size of the dialog will be saved.
|
|
186
|
+
# If preferences_key is not included, the
|
|
187
|
+
# location and size will not be stored.
|
|
188
|
+
# @param [Integer] width The width of the webdialog.
|
|
189
|
+
# @param [Integer] height The height of the webdialog.
|
|
190
|
+
# @param [Integer] left The number of pixels from the left.
|
|
191
|
+
# @param [Integer] top The number of pixels from the top.
|
|
192
|
+
# @param [Integer] resizable true if you want the webdialog to be resizable,
|
|
193
|
+
# false if not.
|
|
194
|
+
# @return [UI::WebDialog]
|
|
195
|
+
#
|
|
180
196
|
# @example
|
|
181
197
|
# dlg = UI::WebDialog.new("Show sketchup.com", true,
|
|
182
198
|
# "ShowSketchupDotCom", 739, 641, 150, 150, true);
|
|
@@ -191,22 +207,8 @@ class UI::WebDialog
|
|
|
191
207
|
# user's OS. On Mac, Safari is embedded, while on the PC whatever version of
|
|
192
208
|
# Internet Explorer is installed will be embedded.
|
|
193
209
|
#
|
|
194
|
-
# @overload initialize(dialog_title = "", scrollable = true, pref_key = nil, width = 250, height =
|
|
210
|
+
# @overload initialize(dialog_title = "", scrollable = true, pref_key = nil, width = 250, height =
|
|
195
211
|
#
|
|
196
|
-
# @param [String] dialog_title The title to be displayed in the webdialog.
|
|
197
|
-
# @param [Boolean] scrollable true if you want to allow scrollbars, false
|
|
198
|
-
# if you do not want to allow scrollbars.
|
|
199
|
-
# @param [String, nil] pref_key The registry entry where the location and
|
|
200
|
-
# size of the dialog will be saved.
|
|
201
|
-
# If preferences_key is not included, the
|
|
202
|
-
# location and size will not be stored.
|
|
203
|
-
# @param [Integer] width The width of the webdialog.
|
|
204
|
-
# @param [Integer] height The height of the webdialog.
|
|
205
|
-
# @param [Integer] left The number of pixels from the left.
|
|
206
|
-
# @param [Integer] top The number of pixels from the top.
|
|
207
|
-
# @param [Integer] resizable true if you want the webdialog to be resizable,
|
|
208
|
-
# false if not.
|
|
209
|
-
# @return [UI::WebDialog]
|
|
210
212
|
#
|
|
211
213
|
# @overload initialize(properties)
|
|
212
214
|
#
|