sketchup-api-stubs 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs/sketchup.rb +1 -1
  3. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +1 -1
  4. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +1 -1
  5. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +1 -1
  6. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +1 -1
  7. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +1 -1
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +1 -1
  9. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +21 -10
  10. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +1 -1
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +1 -1
  12. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +1 -1
  13. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +1 -1
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +1 -1
  15. data/lib/sketchup-api-stubs/stubs/Layout.rb +1 -1
  16. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +1 -1
  17. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +1 -1
  18. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +1 -1
  19. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +1 -1
  20. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +1 -1
  21. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +1 -1
  22. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +1 -1
  23. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +1 -1
  24. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +1 -1
  25. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +1 -1
  26. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +1 -1
  27. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +1 -1
  28. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +1 -1
  29. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +1 -1
  30. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +1 -1
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +1 -1
  32. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +1 -1
  33. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +1 -1
  34. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +1 -1
  35. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +1 -1
  36. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +1 -1
  37. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +1 -1
  38. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +1 -1
  39. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +1 -1
  40. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +1 -1
  41. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1 -1
  42. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +1 -1
  43. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +1 -1
  44. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +1 -1
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +1 -1
  46. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +1 -1
  47. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +1 -1
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +1 -1
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +1 -1
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +1 -1
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +1 -1
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +1 -1
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +1 -1
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +1 -1
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +1 -1
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +1 -1
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +2 -2
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +35 -45
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +1 -1
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +1 -1
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +1 -1
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +1 -1
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +76 -13
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +1 -1
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +1 -1
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +1 -1
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +1 -1
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +1 -1
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +1 -1
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +1 -1
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +1 -1
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +1 -1
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1 -1
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +1 -1
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +1 -1
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +1 -1
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +1 -1
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +224 -58
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +1 -1
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +52 -1
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +1 -1
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +48 -41
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +7 -7
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +52 -1
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +1 -1
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +1 -1
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +1 -1
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +1 -1
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +1 -1
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +1 -1
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +3 -3
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +1 -1
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +1 -1
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +2 -2
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +1 -1
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +1 -1
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +1 -1
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +1 -1
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +1 -1
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +2 -2
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +1 -1
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +1 -1
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +4 -1
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +1 -1
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +1 -1
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +1 -1
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +1 -1
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +1 -1
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +1 -1
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +1 -1
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +1 -1
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +1 -1
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +1 -1
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +1 -1
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +1 -1
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +1 -1
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +1 -1
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +1 -1
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +1 -1
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +1 -1
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +1 -1
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +1 -1
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +1 -1
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +1 -1
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +1 -1
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +1 -1
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +1 -1
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +1 -1
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +1 -1
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +1 -1
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +1 -1
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1 -1
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +1 -1
  134. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +1 -1
  135. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +98 -7
  136. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +69 -55
  137. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +1 -1
  138. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +1 -1
  139. data/lib/sketchup-api-stubs/stubs/_top_level.rb +1 -1
  140. data/lib/sketchup-api-stubs/stubs/array.rb +1 -1
  141. data/lib/sketchup-api-stubs/stubs/geom.rb +1 -1
  142. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +1 -1
  143. data/lib/sketchup-api-stubs/stubs/length.rb +1 -1
  144. data/lib/sketchup-api-stubs/stubs/numeric.rb +1 -1
  145. data/lib/sketchup-api-stubs/stubs/sketchup.rb +12 -1
  146. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +1 -1
  147. data/lib/sketchup-api-stubs/stubs/string.rb +1 -1
  148. data/lib/sketchup-api-stubs/stubs/ui.rb +8 -4
  149. metadata +3 -3
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # This observer interface is implemented to react to changes in camera
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # A Group class contains methods for manipulating groups of entities.
@@ -201,6 +201,57 @@ class Sketchup::Group < Sketchup::Drawingelement
201
201
  def explode
202
202
  end
203
203
 
204
+ # The {#glued_to} method is used to retrieve the entity that this group is
205
+ # glued to.
206
+ #
207
+ # @example
208
+ # point = Geom::Point3d.new(10, 20, 30)
209
+ # transform = Geom::Transformation.new(point)
210
+ # model = Sketchup.active_model
211
+ # entities = model.active_entities
212
+ # group = entities.add_group
213
+ # group.entities.add_face([[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]])
214
+ # status = group.glued_to
215
+ #
216
+ # @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil]
217
+ #
218
+ # @version SketchUp 2021.1
219
+ def glued_to
220
+ end
221
+
222
+ # The {glued_to=} method glues this group to a drawing element.
223
+ # When moving this other drawing elment with the Move tool, the glued group moves with it.
224
+ #
225
+ # @example
226
+ # model = Sketchup.active_model
227
+ # entities = model.active_entities
228
+ #
229
+ # # Create a face
230
+ # face = entities.add_face([[0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0]])
231
+ #
232
+ # # Create a group
233
+ # definitions = model.definitions
234
+ # group = entities.add_group
235
+ # group.entities.add_face([[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]])
236
+ #
237
+ # # Make group "gluable"
238
+ # group.definition.behavior.is2d = true
239
+ #
240
+ # # Glue the group to the face.
241
+ # # If you now move the face, the group will follow.
242
+ # group.glued_to = face
243
+ #
244
+ # @param [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] drawing_element
245
+ #
246
+ # @raise ArgumentError if the {Sketchup::Behavior} for this group doesn't allow gluing,
247
+ # if the alignment is wrong, or if this would lead to cyclic gluing.
248
+ #
249
+ # @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] the entity the group was glued to.
250
+ #
251
+ # @version SketchUp 2021.1
252
+ def glued_to=(drawing_element)
253
+ end
254
+
204
255
  # The guid method is used to get the base 64 encoded unique id
205
256
  # for this SketchUp object.
206
257
  #
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The {Sketchup::Http} module provides interfaces to create asynchronous HTTP
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # Http::Request objects allows you to send HTTP request to HTTP servers.
@@ -11,9 +11,9 @@ class Sketchup::Http::Request
11
11
  # Gets the http body that is going to be used when sending the request.
12
12
  #
13
13
  # @example
14
- # request = Sketchup::Http::Request.new("http://localhost:8080")
14
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
15
15
  #
16
- # request.start do |request, response|
16
+ # @request.start do |request, response|
17
17
  # puts "body: #{request.body}"
18
18
  # end
19
19
  #
@@ -26,10 +26,10 @@ class Sketchup::Http::Request
26
26
  # Sets the http body that is going to be used when sending the request.
27
27
  #
28
28
  # @example
29
- # request = Sketchup::Http::Request.new("http://localhost:8080")
30
- # request.body = "Hello World"
29
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
30
+ # @request.body = "Hello World"
31
31
  #
32
- # request.start do |request, response|
32
+ # @request.start do |request, response|
33
33
  # puts "body: #{request.body}"
34
34
  # end
35
35
  #
@@ -45,12 +45,12 @@ class Sketchup::Http::Request
45
45
  # Cancels the request.
46
46
  #
47
47
  # @example
48
- # request = Sketchup::Http::Request.new("http://localhost:8080")
49
- # request.start do |request, response|
48
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
49
+ # @request.start do |request, response|
50
50
  # puts "body: #{response.body}"
51
51
  # end
52
52
  #
53
- # request.cancel
53
+ # @request.cancel
54
54
  #
55
55
  # @return [true]
56
56
  #
@@ -61,10 +61,10 @@ class Sketchup::Http::Request
61
61
  # Returns the http headers that are going to be used when sending the request.
62
62
  #
63
63
  # @example
64
- # request = Sketchup::Http::Request.new("http://localhost:8080")
65
- # request.headers = { :key1 => "value1", :key2 => "value2" }
64
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
65
+ # @request.headers = { :key1 => "value1", :key2 => "value2" }
66
66
  #
67
- # request.headers.each do |key, value|
67
+ # @request.headers.each do |key, value|
68
68
  # puts "#{key}: #{value}"
69
69
  # end
70
70
  #
@@ -77,10 +77,10 @@ class Sketchup::Http::Request
77
77
  # Sets the http headers that are going to be used when sending the request.
78
78
  #
79
79
  # @example
80
- # request = Sketchup::Http::Request.new("http://localhost:8080")
81
- # request.headers = { :key1 => "value1", :key2 => "value2" }
80
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
81
+ # @request.headers = { :key1 => "value1", :key2 => "value2" }
82
82
  #
83
- # request.headers.each do |key, value|
83
+ # @request.headers.each do |key, value|
84
84
  # puts "#{key}: #{value}"
85
85
  # end
86
86
  #
@@ -96,10 +96,7 @@ class Sketchup::Http::Request
96
96
  # The new method is used to create a new Sketchup::Http::Request.
97
97
  #
98
98
  # The default port is 80, to use a different port define it in the URL when
99
- # creating a new Http::Request
100
- #
101
- # Keeping a reference to the request is necessary in order to ensure the use of
102
- # the response.
99
+ # creating a new {Sketchup::Http::Request}.
103
100
  #
104
101
  # The +method+ parameter accepts any custom http method or one of the
105
102
  # following:
@@ -111,12 +108,16 @@ class Sketchup::Http::Request
111
108
  # * +Sketchup::Http::OPTIONS+
112
109
  #
113
110
  # @example
114
- # request = Sketchup::Http::Request.new("http://localhost:8080", Sketchup::Http::GET)
111
+ # @request = Sketchup::Http::Request.new("http://localhost:8080", Sketchup::Http::GET)
115
112
  #
116
- # request.start do |request, response|
113
+ # @request.start do |request, response|
117
114
  # puts "body: #{response.body}"
118
115
  # end
119
116
  #
117
+ # @note If no reference is kept to the {Sketchup::Http::Request}, it can be garbage collected,
118
+ # making the download silently fail. This is especially noticeable for larger downloads that
119
+ # takes longer time.
120
+ #
120
121
  # @param [String] url
121
122
  # The targetted URL.
122
123
  #
@@ -133,9 +134,9 @@ class Sketchup::Http::Request
133
134
  # Returns the http method that is going to be used when sending the request.
134
135
  #
135
136
  # @example
136
- # request = Sketchup::Http::Request.new("http://localhost:8080")
137
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
137
138
  #
138
- # request.start do |request, response|
139
+ # @request.start do |request, response|
139
140
  # puts "request.method: #{request.method}"
140
141
  # end
141
142
  #
@@ -155,10 +156,10 @@ class Sketchup::Http::Request
155
156
  # * +Sketchup::Http::OPTIONS+
156
157
  #
157
158
  # @example
158
- # request = Sketchup::Http::Request.new("http://localhost:8080")
159
- # request.method = Sketchup::Http::POST
159
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
160
+ # @request.method = Sketchup::Http::POST
160
161
  #
161
- # request.start do |request, response|
162
+ # @request.start do |request, response|
162
163
  # puts "request.method: #{request.method}"
163
164
  # end
164
165
  #
@@ -175,14 +176,20 @@ class Sketchup::Http::Request
175
176
  # have received data from the server until the download finishes.
176
177
  #
177
178
  # @example
178
- # request = Sketchup::Http::Request.new("http://localhost:8080")
179
- #
180
- # request.set_download_progress_callback do |current, total|
181
- # puts "download current: #{current}"
182
- # puts "download total: #{total}"
179
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
180
+ #
181
+ # @request.set_download_progress_callback do |current, total|
182
+ # if total == -1
183
+ # puts "#{current}B"
184
+ # else
185
+ # percentage = (current.to_f / total * 100).round
186
+ # puts "#{current}B / #{total}B (#{percentage}%)"
187
+ # end
183
188
  # end
184
189
  #
185
- # request.start
190
+ # @request.start
191
+ #
192
+ # @note +total+ is -1 if the server doesn't specify a file size in the response header.
186
193
  #
187
194
  # @return [Boolean]
188
195
  #
@@ -202,9 +209,9 @@ class Sketchup::Http::Request
202
209
  # uploaded data to the server until the upload finishes.
203
210
  #
204
211
  # @example
205
- # request = Sketchup::Http::Request.new("http://localhost:8080")
212
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
206
213
  #
207
- # request.set_upload_progress_callback do |current, total|
214
+ # @request.set_upload_progress_callback do |current, total|
208
215
  # puts "upload current: #{current}"
209
216
  # puts "upload total: #{total}"
210
217
  # end
@@ -228,9 +235,9 @@ class Sketchup::Http::Request
228
235
  # Starts the request and optionally add a callback block.
229
236
  #
230
237
  # @example
231
- # request = Sketchup::Http::Request.new("http://localhost:8080")
238
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
232
239
  #
233
- # request.start do |request, response|
240
+ # @request.start do |request, response|
234
241
  # puts "body: #{response.body}"
235
242
  # end
236
243
  #
@@ -257,9 +264,9 @@ class Sketchup::Http::Request
257
264
  # * +Sketchup::Http::STATUS_FAILED+
258
265
  #
259
266
  # @example
260
- # request = Sketchup::Http::Request.new("http://localhost:8080")
261
- # request.start
262
- # puts "response.status: #{request.status}"
267
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
268
+ # @request.start
269
+ # puts "response.status: #{@request.status}"
263
270
  #
264
271
  # @return [int]
265
272
  #
@@ -270,9 +277,9 @@ class Sketchup::Http::Request
270
277
  # Returns a copy of the Request's URL.
271
278
  #
272
279
  # @example
273
- # request = Sketchup::Http::Request.new("http://localhost:8080")
280
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
274
281
  #
275
- # request.start do |request, response|
282
+ # @request.start do |request, response|
276
283
  # puts "url: #{request.url}"
277
284
  # end
278
285
  #
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # Http::Response objects allows you to get the response information from the
@@ -15,9 +15,9 @@ class Sketchup::Http::Response
15
15
  # no charset is specified, ASCII-8BIT will be used.
16
16
  #
17
17
  # @example
18
- # request = Sketchup::Http::Request.new("http://localhost:8080")
18
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
19
19
  #
20
- # request.start do |request, response|
20
+ # @request.start do |request, response|
21
21
  # puts "body: " + response.body
22
22
  # end
23
23
  #
@@ -30,9 +30,9 @@ class Sketchup::Http::Response
30
30
  # Returns the http headers that were sent by the server.
31
31
  #
32
32
  # @example
33
- # request = Sketchup::Http::Request.new("http://localhost:8080")
33
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
34
34
  #
35
- # request.start do |request, response|
35
+ # @request.start do |request, response|
36
36
  # response.headers.each do |key, value|
37
37
  # puts "#{key}: #{value}"
38
38
  # end
@@ -47,9 +47,9 @@ class Sketchup::Http::Response
47
47
  # Returns the HTTP response status code as defined in rfc2616.
48
48
  #
49
49
  # @example
50
- # request = Sketchup::Http::Request.new("http://localhost:8080")
50
+ # @request = Sketchup::Http::Request.new("http://localhost:8080")
51
51
  #
52
- # request.start do |request, response|
52
+ # @request.start do |request, response|
53
53
  # puts "http status code: #{response.status_code}"
54
54
  # end
55
55
  #
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # An Image object represents a raster image placed in the Model.
@@ -39,6 +39,53 @@ class Sketchup::Image < Sketchup::Drawingelement
39
39
  def explode
40
40
  end
41
41
 
42
+ # The {#glued_to} method is used to retrieve the entity that this image is
43
+ # glued to.
44
+ #
45
+ # @example
46
+ # point = Geom::Point3d.new(10, 20, 30)
47
+ # transform = Geom::Transformation.new(point)
48
+ # model = Sketchup.active_model
49
+ # entities = model.active_entities
50
+ # group = entities.add_group
51
+ # group.entities.add_face([[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]])
52
+ # status = group.glued_to
53
+ #
54
+ # @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil]
55
+ #
56
+ # @version SketchUp 2021.1
57
+ def glued_to
58
+ end
59
+
60
+ # The {glued_to=} method glues this image to a drawing element.
61
+ # When moving this other drawing elment with the Move tool, the image moves with it.
62
+ #
63
+ # @example
64
+ # model = Sketchup.active_model
65
+ # entities = model.active_entities
66
+ #
67
+ # # Create a face
68
+ # face = entities.add_face([[0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0]])
69
+ #
70
+ # # Create a group
71
+ # path = "Plugins/su_dynamiccomponents/images"
72
+ # image_file = Sketchup.find_support_file("report_tool.png", path)
73
+ # image = model.active_entities.add_image(image_file, ORIGIN, 300)
74
+ #
75
+ # # Glue the group to the face.
76
+ # # If you now move the face, the group will follow.
77
+ # image.glued_to = face
78
+ #
79
+ # @param [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] drawing_element
80
+ #
81
+ # @raise ArgumentError if this would lead to cyclic gluing.
82
+ #
83
+ # @return [Sketchup::Face, Sketchup::Group, Sketchup::ComponentInstance, Sketchup::Image, nil] the entity the group was glued to.
84
+ #
85
+ # @version SketchUp 2021.1
86
+ def glued_to=(drawing_element)
87
+ end
88
+
42
89
  # The height method is used to retrieve the height of the image.
43
90
  #
44
91
  # The height is given in inches.
@@ -92,6 +139,8 @@ class Sketchup::Image < Sketchup::Drawingelement
92
139
  # The {#image_rep} method returns a copy of a {Sketchup::ImageRep} object
93
140
  # representing the pixel data.
94
141
  #
142
+ # @bug Prior to SketchUp 2021.1, SketchUp crashes when the Image is corrupt and lacks image data.
143
+ #
95
144
  # @example
96
145
  # model = Sketchup.active_model
97
146
  # path = "Plugins/su_dynamiccomponents/images"
@@ -99,6 +148,8 @@ class Sketchup::Image < Sketchup::Drawingelement
99
148
  # image = model.active_entities.add_image(image_file, ORIGIN, 300)
100
149
  # image_rep = image.image_rep
101
150
  #
151
+ # @raise ArgumentError if the Image is corrupt and lacks image data.
152
+ #
102
153
  # @return [Sketchup::ImageRep]
103
154
  #
104
155
  # @version SketchUp 2018
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # References an image representation object.
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The Importer interface lets you build your own importers for SketchUp. To
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The {Sketchup::InputPoint} class is used to pick 3d points and/or entities
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # This observer interface is implemented to react to component instance
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The {Sketchup::InstancePath} class represent the instance path to a given
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # The Layer class contains methods modifying and extracting information for a
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
1
+ # Copyright:: Copyright 2021 Trimble Inc.
2
2
  # License:: The MIT License (MIT)
3
3
 
4
4
  # Allows layers to be organized in folders. Folders may have duplicate names.
@@ -39,7 +39,7 @@ class Sketchup::LayerFolder < Sketchup::Entity
39
39
  # +0+ if the receiver and +other+ are equal.
40
40
  # +nil+ if +other+ is not comparable with the receiver.
41
41
  #
42
- # @version SketchUp 2020.2
42
+ # @version SketchUp 2021.0
43
43
  def <=>(other)
44
44
  end
45
45
 
@@ -165,7 +165,7 @@ class Sketchup::LayerFolder < Sketchup::Entity
165
165
  # model = Sketchup.active_model
166
166
  # layers = model.layers
167
167
  # folder1 = layers.add_folder('Hello')
168
- # folder1.add_folder('World)
168
+ # folder1.add_folder('World')
169
169
  # folder1.each_folder { | folder | puts folder.name }
170
170
  #
171
171
  # @version SketchUp 2021.0