sketchup-api-stubs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/SketchUp/Geom/BoundingBox.rb +335 -0
  3. data/SketchUp/Geom/LatLong.rb +123 -0
  4. data/SketchUp/Geom/Point3d.rb +643 -0
  5. data/SketchUp/Geom/PolygonMesh.rb +478 -0
  6. data/SketchUp/Geom/Transformation.rb +476 -0
  7. data/SketchUp/Geom/UTM.rb +135 -0
  8. data/SketchUp/Geom/Vector3d.rb +684 -0
  9. data/SketchUp/Sketchup/Animation.rb +137 -0
  10. data/SketchUp/Sketchup/AppObserver.rb +157 -0
  11. data/SketchUp/Sketchup/ArcCurve.rb +209 -0
  12. data/SketchUp/Sketchup/AttributeDictionaries.rb +146 -0
  13. data/SketchUp/Sketchup/AttributeDictionary.rb +280 -0
  14. data/SketchUp/Sketchup/Axes.rb +149 -0
  15. data/SketchUp/Sketchup/Behavior.rb +338 -0
  16. data/SketchUp/Sketchup/Camera.rb +594 -0
  17. data/SketchUp/Sketchup/ClassificationSchema.rb +63 -0
  18. data/SketchUp/Sketchup/Classifications.rb +118 -0
  19. data/SketchUp/Sketchup/Color.rb +291 -0
  20. data/SketchUp/Sketchup/ComponentDefinition.rb +562 -0
  21. data/SketchUp/Sketchup/ComponentInstance.rb +597 -0
  22. data/SketchUp/Sketchup/Console.rb +78 -0
  23. data/SketchUp/Sketchup/ConstructionLine.rb +257 -0
  24. data/SketchUp/Sketchup/ConstructionPoint.rb +32 -0
  25. data/SketchUp/Sketchup/Curve.rb +196 -0
  26. data/SketchUp/Sketchup/DefinitionList.rb +312 -0
  27. data/SketchUp/Sketchup/DefinitionObserver.rb +73 -0
  28. data/SketchUp/Sketchup/DefinitionsObserver.rb +102 -0
  29. data/SketchUp/Sketchup/Dimension.rb +167 -0
  30. data/SketchUp/Sketchup/DimensionLinear.rb +232 -0
  31. data/SketchUp/Sketchup/DimensionObserver.rb +38 -0
  32. data/SketchUp/Sketchup/DimensionRadial.rb +87 -0
  33. data/SketchUp/Sketchup/Drawingelement.rb +400 -0
  34. data/SketchUp/Sketchup/Edge.rb +517 -0
  35. data/SketchUp/Sketchup/EdgeUse.rb +213 -0
  36. data/SketchUp/Sketchup/Entities.rb +1011 -0
  37. data/SketchUp/Sketchup/EntitiesObserver.rb +125 -0
  38. data/SketchUp/Sketchup/Entity.rb +522 -0
  39. data/SketchUp/Sketchup/EntityObserver.rb +59 -0
  40. data/SketchUp/Sketchup/ExtensionsManager.rb +129 -0
  41. data/SketchUp/Sketchup/Face.rb +737 -0
  42. data/SketchUp/Sketchup/FrameChangeObserver.rb +104 -0
  43. data/SketchUp/Sketchup/Group.rb +705 -0
  44. data/SketchUp/Sketchup/Http.rb +27 -0
  45. data/SketchUp/Sketchup/Http/Request.rb +285 -0
  46. data/SketchUp/Sketchup/Http/Response.rb +62 -0
  47. data/SketchUp/Sketchup/Image.rb +393 -0
  48. data/SketchUp/Sketchup/Importer.rb +192 -0
  49. data/SketchUp/Sketchup/InputPoint.rb +393 -0
  50. data/SketchUp/Sketchup/InstanceObserver.rb +82 -0
  51. data/SketchUp/Sketchup/InstancePath.rb +297 -0
  52. data/SketchUp/Sketchup/Layer.rb +240 -0
  53. data/SketchUp/Sketchup/Layers.rb +235 -0
  54. data/SketchUp/Sketchup/LayersObserver.rb +136 -0
  55. data/SketchUp/Sketchup/Licensing.rb +47 -0
  56. data/SketchUp/Sketchup/Licensing/ExtensionLicense.rb +88 -0
  57. data/SketchUp/Sketchup/Loop.rb +141 -0
  58. data/SketchUp/Sketchup/Material.rb +384 -0
  59. data/SketchUp/Sketchup/Materials.rb +283 -0
  60. data/SketchUp/Sketchup/MaterialsObserver.rb +141 -0
  61. data/SketchUp/Sketchup/Menu.rb +97 -0
  62. data/SketchUp/Sketchup/Model.rb +1459 -0
  63. data/SketchUp/Sketchup/ModelObserver.rb +356 -0
  64. data/SketchUp/Sketchup/OptionsManager.rb +135 -0
  65. data/SketchUp/Sketchup/OptionsProvider.rb +277 -0
  66. data/SketchUp/Sketchup/OptionsProviderObserver.rb +58 -0
  67. data/SketchUp/Sketchup/Page.rb +636 -0
  68. data/SketchUp/Sketchup/Pages.rb +349 -0
  69. data/SketchUp/Sketchup/PagesObserver.rb +76 -0
  70. data/SketchUp/Sketchup/PickHelper.rb +457 -0
  71. data/SketchUp/Sketchup/RegionalSettings.rb +43 -0
  72. data/SketchUp/Sketchup/RenderingOptions.rb +337 -0
  73. data/SketchUp/Sketchup/RenderingOptionsObserver.rb +44 -0
  74. data/SketchUp/Sketchup/SectionPlane.rb +88 -0
  75. data/SketchUp/Sketchup/Selection.rb +470 -0
  76. data/SketchUp/Sketchup/SelectionObserver.rb +115 -0
  77. data/SketchUp/Sketchup/Set.rb +253 -0
  78. data/SketchUp/Sketchup/ShadowInfo.rb +257 -0
  79. data/SketchUp/Sketchup/ShadowInfoObserver.rb +57 -0
  80. data/SketchUp/Sketchup/Style.rb +77 -0
  81. data/SketchUp/Sketchup/Styles.rb +204 -0
  82. data/SketchUp/Sketchup/Text.rb +241 -0
  83. data/SketchUp/Sketchup/Texture.rb +211 -0
  84. data/SketchUp/Sketchup/TextureWriter.rb +237 -0
  85. data/SketchUp/Sketchup/Tool.rb +808 -0
  86. data/SketchUp/Sketchup/Tools.rb +120 -0
  87. data/SketchUp/Sketchup/ToolsObserver.rb +154 -0
  88. data/SketchUp/Sketchup/UVHelper.rb +61 -0
  89. data/SketchUp/Sketchup/Vertex.rb +143 -0
  90. data/SketchUp/Sketchup/View.rb +965 -0
  91. data/SketchUp/Sketchup/ViewObserver.rb +40 -0
  92. data/SketchUp/UI/Command.rb +307 -0
  93. data/SketchUp/UI/HtmlDialog.rb +346 -0
  94. data/SketchUp/UI/Notification.rb +229 -0
  95. data/SketchUp/UI/Toolbar.rb +243 -0
  96. data/SketchUp/UI/WebDialog.rb +623 -0
  97. data/SketchUp/_top_level.rb +193 -0
  98. data/SketchUp/array.rb +593 -0
  99. data/SketchUp/geom.rb +231 -0
  100. data/SketchUp/languagehandler.rb +92 -0
  101. data/SketchUp/length.rb +210 -0
  102. data/SketchUp/numeric.rb +249 -0
  103. data/SketchUp/sketchup.rb +1290 -0
  104. data/SketchUp/sketchupextension.rb +355 -0
  105. data/SketchUp/string.rb +24 -0
  106. data/SketchUp/ui.rb +637 -0
  107. metadata +176 -0
@@ -0,0 +1,312 @@
1
+ # Copyright:: Copyright 2017 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # A DefinitionList object holds a list of all of the ComponentDefinition
5
+ # objects in a model. This class contains methods for adding and retrieving
6
+ # definitions from the list.
7
+ #
8
+ # @version SketchUp 6.0
9
+ class Sketchup::DefinitionList < Sketchup::Entity
10
+
11
+ # Includes
12
+
13
+ include Enumerable
14
+
15
+ # Instance Methods
16
+
17
+ # The [] method is used to retrieve a component definition from the list. You
18
+ # can give an integer index in the range 0 to length, a string which
19
+ # represents the GUID (a unique internal identifier), or a string that is
20
+ # the name of the definition.
21
+ #
22
+ # @example
23
+ # path=Sketchup.find_support_file "Bed.skp",
24
+ # "Components/Components Sampler/"
25
+ # model = Sketchup.active_model
26
+ # definitions = model.definitions
27
+ # componentdefinition = definitions.load path
28
+ # component = definitions[0]
29
+ #
30
+ # @overload [](index)
31
+ #
32
+ # @param [Integer] index The index for a specific component definition.
33
+ # @return [Sketchup::ComponentDefinition, nil]
34
+ #
35
+ # @overload [](guid)
36
+ #
37
+ # @param [String] guid The name of an existing component definition.
38
+ # @return [Sketchup::ComponentDefinition, nil]
39
+ #
40
+ # @overload [](name)
41
+ #
42
+ # @param [String] name The unique GUID for the component definition.
43
+ # @return [Sketchup::ComponentDefinition, nil]
44
+ #
45
+ # @version SketchUp 6.0
46
+ def [](arg)
47
+ end
48
+
49
+ # The add method is used to add a new component definition to the definition
50
+ # list with the given name.
51
+ #
52
+ # @example
53
+ # model = Sketchup.active_model
54
+ # definitions = model.definitions
55
+ # componentdefinition = definitions.add "BedTraditional"
56
+ # component = definitions[0]
57
+ #
58
+ # @param def_name
59
+ # The new component definition to add to the definition
60
+ # list.
61
+ #
62
+ # @return componentdefinition - the ComponentDefinition object
63
+ # that was added (if successful)
64
+ #
65
+ # @version SketchUp 6.0
66
+ def add(def_name)
67
+ end
68
+
69
+ # The add_observer method is used to add an observer to the current object.
70
+ #
71
+ # @example
72
+ # definitions = Sketchup.active_model.definitions
73
+ # status = definitions.add_observer observer
74
+ #
75
+ # @param observer
76
+ # An observer.
77
+ #
78
+ # @return true if successful, false if unsuccessful.
79
+ #
80
+ # @version SketchUp 6.0
81
+ def add_observer(observer)
82
+ end
83
+
84
+ # The [] method is used to retrieve a component definition from the list. You
85
+ # can give an integer index in the range 0 to length, a string which
86
+ # represents the GUID (a unique internal identifier), or a string that is
87
+ # the name of the definition.
88
+ #
89
+ # @example
90
+ # path=Sketchup.find_support_file "Bed.skp",
91
+ # "Components/Components Sampler/"
92
+ # model = Sketchup.active_model
93
+ # definitions = model.definitions
94
+ # componentdefinition = definitions.load path
95
+ # component = definitions[0]
96
+ #
97
+ # @overload [](index)
98
+ #
99
+ # @param [Integer] index The index for a specific component definition.
100
+ # @return [Sketchup::ComponentDefinition, nil]
101
+ #
102
+ # @overload [](guid)
103
+ #
104
+ # @param [String] guid The name of an existing component definition.
105
+ # @return [Sketchup::ComponentDefinition, nil]
106
+ #
107
+ # @overload [](name)
108
+ #
109
+ # @param [String] name The unique GUID for the component definition.
110
+ # @return [Sketchup::ComponentDefinition, nil]
111
+ #
112
+ # @version SketchUp 6.0
113
+ def at(arg)
114
+ end
115
+
116
+ #
117
+ # @example
118
+ # model = Sketchup.active_model
119
+ # definitions = model.definitions
120
+ # number = definitions.count
121
+ #
122
+ # @note Since SketchUp 2014 the count method is inherited from Ruby's
123
+ # +Enumable+ mix-in module. Prior to that the {#count} method is an alias
124
+ # for {#length}.
125
+ #
126
+ # @return [Integer]
127
+ #
128
+ # @see #length
129
+ #
130
+ # @version SketchUp 6.0
131
+ def count
132
+ end
133
+
134
+ # The each method is used to iterate through all of the component definitions
135
+ # in the definition list.
136
+ #
137
+ # Throws an exception if there are no component definitions.
138
+ #
139
+ # @example
140
+ # model = Sketchup.active_model
141
+ # definitions = model.definitions
142
+ # definitions.add("BedTraditional")
143
+ # number = definitions.each { |definition| puts definition.name }
144
+ #
145
+ # @return nil
146
+ #
147
+ # @version SketchUp 6.0
148
+ #
149
+ # @yield [definition] A variable that will hold each ComponentDefinition
150
+ # object as they are found.
151
+ def each
152
+ end
153
+
154
+ # The {#length} method is used to retrieve number of component definitions in
155
+ # the list.
156
+ #
157
+ # The {#size} method is an alias for {#length} added in SketchUp 2014.
158
+ #
159
+ # @example
160
+ # model = Sketchup.active_model
161
+ # definitions = model.definitions
162
+ # number = definitions.length
163
+ #
164
+ # @return [Integer] the number of component definitions in the
165
+ # definition list if successful
166
+ #
167
+ # @version SketchUp 6.0
168
+ def length
169
+ end
170
+
171
+ # The load method is used to load a component from a file.
172
+ #
173
+ # @example
174
+ # path=Sketchup.find_support_file "Bed.skp",
175
+ # "Components/Components Sampler/"
176
+ # model = Sketchup.active_model
177
+ # definitions = model.definitions
178
+ # componentdefinition = definitions.load path
179
+ #
180
+ # @param path
181
+ # The path where the component definition file is located.
182
+ #
183
+ # @return componentdefinition - the loaded ComponentDefinition
184
+ # object if successful
185
+ #
186
+ # @version SketchUp 6.0
187
+ def load(path)
188
+ end
189
+
190
+ # The load_from_url method loads a component from a location specified by
191
+ # string url. This method throws an exception if an url string is not
192
+ # given, or an error occurs during retrieval from url and a
193
+ # load_handler was not given. Optional second parameter load_handler can be
194
+ # used to pass in a ruby object that responds to the following methods:
195
+ #
196
+ # - cancelled?(a_boolean)
197
+ # - onPercentChange(a_float)
198
+ # - onSuccess()
199
+ # - onFailure(message_string)
200
+ #
201
+ # @example
202
+ # class LoadHandler
203
+ #
204
+ # attr :error
205
+ #
206
+ # def onPercentChange(percent)
207
+ # Sketchup::set_status_text("LOADING: #{percent}%")
208
+ # end
209
+ #
210
+ # def cancelled?
211
+ # # You could, for example, show a messagebox after X seconds asking if the
212
+ # # user wants to cancel the download. If this method returns true, then
213
+ # # the download cancels.
214
+ # return false
215
+ # end
216
+ #
217
+ # def onSuccess
218
+ # Sketchup::set_status_text('')
219
+ # end
220
+ #
221
+ # def onFailure(error_message)
222
+ # self.error = error_message
223
+ # Sketchup::set_status_text('')
224
+ # end
225
+ #
226
+ # end
227
+ #
228
+ # # Replace this with a real URL...
229
+ # url = 'http://www.sketchup.com/model.skp'
230
+ # model = Sketchup.active_model
231
+ # definition = model.definitions.load_from_url(url, load_handler)
232
+ #
233
+ # if definition.nil?
234
+ # puts "Error: #{load_handler.error}"
235
+ # end
236
+ #
237
+ # @param url
238
+ # URL to load a .skp file from.
239
+ #
240
+ # @param [optional] load_handler
241
+ # Ruby object that has methods defined
242
+ # as described in the load_from_url details.
243
+ #
244
+ # @return componentdefinition - the loaded ComponentDefinition
245
+ # object if successful
246
+ #
247
+ # @version SketchUp 7.0
248
+ def load_from_url(url, load_handler)
249
+ end
250
+
251
+ # The purge_unused method is used to remove the unused component definitions.
252
+ #
253
+ # @example
254
+ # definitions = Sketchup.active_model.definitions
255
+ # definitions.purge_unused
256
+ #
257
+ # @return Sketchup::DefinitionList object
258
+ #
259
+ # @version SketchUp 6.0
260
+ def purge_unused
261
+ end
262
+
263
+ # The remove_observer method is used to remove an observer from the current
264
+ # object.
265
+ #
266
+ # @example
267
+ # definitions = Sketchup.active_model.definitions
268
+ # status = definitions.remove_observer observer
269
+ #
270
+ # @param observer
271
+ # An observer.
272
+ #
273
+ # @return true if successful, false if unsuccessful.
274
+ #
275
+ # @version SketchUp 6.0
276
+ def remove_observer(observer)
277
+ end
278
+
279
+ # The {#length} method is used to retrieve number of component definitions in
280
+ # the list.
281
+ #
282
+ # The {#size} method is an alias for {#length} added in SketchUp 2014.
283
+ #
284
+ # @example
285
+ # model = Sketchup.active_model
286
+ # definitions = model.definitions
287
+ # number = definitions.length
288
+ #
289
+ # @return [Integer] the number of component definitions in the
290
+ # definition list if successful
291
+ #
292
+ # @version SketchUp 6.0
293
+ def size
294
+ end
295
+
296
+ # The unique_name is used to generate a unique name for a definition based on
297
+ # a base_name string. For example, a base_name of "Joe" might return "Joe #2"
298
+ #
299
+ # @example
300
+ # model = Sketchup.active_model
301
+ # definitions = model.definitions
302
+ # new_name = definitions.unique_name "My Base Name"
303
+ #
304
+ # @param base_name
305
+ #
306
+ # @return new_name - the unique name.
307
+ #
308
+ # @version SketchUp 6.0
309
+ def unique_name(base_name)
310
+ end
311
+
312
+ end
@@ -0,0 +1,73 @@
1
+ # Copyright:: Copyright 2017 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # This observer interface is implemented to react to component definition
5
+ # events. To implement this observer, create a Ruby class of this type,
6
+ # override the desired methods, and add an instance of the observer to the
7
+ # definitions of interests.
8
+ #
9
+ # @example
10
+ # # This is an example of an observer that watches a specific definition
11
+ # # for new component insertions.
12
+ # class MyDefObserver < Sketchup::DefinitionObserver
13
+ # def onComponentInstanceAdded(definition, instance)
14
+ # puts "onComponentInstanceAdded(#{definition}, #{instance})"
15
+ # end
16
+ # end
17
+ #
18
+ # # Attach the observer
19
+ # Sketchup.active_model.definitions[0].add_observer(MyDefObserver.new)
20
+ #
21
+ # @version SketchUp 6.0
22
+ class Sketchup::DefinitionObserver < Sketchup::EntityObserver
23
+
24
+ # Instance Methods
25
+
26
+ # The {#onComponentInstanceAdded} method is called when a new component
27
+ # instance is added to a model.
28
+ #
29
+ # @example
30
+ # def onComponentInstanceAdded(definition, instance)
31
+ # puts "onComponentInstanceAdded(#{definition}, #{instance})"
32
+ # end
33
+ #
34
+ # @param [Sketchup::ComponentDefinition] definition
35
+ # The definition of the
36
+ # added instance
37
+ #
38
+ # @param [Sketchup::ComponentInstance] instance
39
+ # The added instance
40
+ #
41
+ # @return [nil]
42
+ #
43
+ # @version SketchUp 6.0
44
+ def onComponentInstanceAdded(definition, instance)
45
+ end
46
+
47
+ # The {#onComponentInstanceRemoved} method is called when a component
48
+ # instance is removed from a model.
49
+ #
50
+ # implemented, this method is fired on a Move + Copy operation even
51
+ # though no {Sketchup::ComponentInstance} is apparently removed.
52
+ #
53
+ # @example
54
+ # def onComponentInstanceRemoved(definition, instance)
55
+ # puts "onComponentInstanceRemoved(#{definition}, #{instance})"
56
+ # end
57
+ #
58
+ # @note Due to the underlying way that the SketchUp Move Tool is
59
+ #
60
+ # @param [Sketchup::ComponentInstance] instance
61
+ # The removed instance
62
+ #
63
+ # @param [Sketchup::ComponentDefinition] definition
64
+ # The definition of the
65
+ # instance removed
66
+ #
67
+ # @return [nil]
68
+ #
69
+ # @version SketchUp 6.0
70
+ def onComponentInstanceRemoved(definition, instance)
71
+ end
72
+
73
+ end
@@ -0,0 +1,102 @@
1
+ # Copyright:: Copyright 2017 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # This observer interface is implemented to react to events on a definitions
5
+ # collection. To implement this observer, create a Ruby class of this type,
6
+ # override the desired methods, and add an instance of the observer to the
7
+ # collection of interest.
8
+ #
9
+ # @example
10
+ # class MyDefinitionsObserver < Sketchup::DefinitionsObserver
11
+ # def onComponentAdded(definitions, definition)
12
+ # puts "onComponentAdded: #{definition.name}"
13
+ # end
14
+ # end
15
+ #
16
+ # Sketchup.active_model.definitions.add_observer(MyDefinitionsObserver.new)
17
+ #
18
+ # @version SketchUp 6.0
19
+ class Sketchup::DefinitionsObserver
20
+
21
+ # Instance Methods
22
+
23
+ # The {#onComponentAdded} method is called whenever a definition is added to
24
+ # the definitions collection.
25
+ #
26
+ # @example
27
+ # def onComponentAdded(definitions, definition)
28
+ # puts "onComponentAdded: #{definition}"
29
+ # end
30
+ #
31
+ # @param [Sketchup::DefinitionList] definitions
32
+ #
33
+ # @param [Sketchup::ComponentDefinition] definition
34
+ #
35
+ # @return [nil]
36
+ #
37
+ # @version SketchUp 6.0
38
+ def onComponentAdded(definitions, definition)
39
+ end
40
+
41
+ # The {#onComponentPropertiesChanged} method is called whenever a definition's
42
+ # name or description are changed.
43
+ #
44
+ # This does not fire when "Glue To", "Cuts Opening", or "Face Camera" settings
45
+ # are changed.
46
+ #
47
+ # @example
48
+ # def onComponentPropertiesChanged(definitions, definition)
49
+ # puts "onComponentPropertiesChanged: #{definition}"
50
+ # end
51
+ #
52
+ # @param [Sketchup::DefinitionList] definitions
53
+ #
54
+ # @param [Sketchup::ComponentDefinition] definition
55
+ #
56
+ # @return [nil]
57
+ #
58
+ # @version SketchUp 6.0
59
+ def onComponentPropertiesChanged(definitions, definition)
60
+ end
61
+
62
+ # The {#onComponentAdded} method is called whenever a definition is removed
63
+ # from the definitions collection.
64
+ #
65
+ # @example
66
+ # def onComponentRemoved(definitions, definition)
67
+ # puts "onComponentRemoved: #{definition}"
68
+ # end
69
+ #
70
+ # @note This methods fires twice for each Component/Group erased.
71
+ #
72
+ # @param [Sketchup::ComponentDefinition] definition
73
+ #
74
+ # @param [Sketchup::DefinitionList] definitions
75
+ #
76
+ # @return [nil]
77
+ #
78
+ # @version SketchUp 6.0
79
+ def onComponentRemoved(definitions, definition)
80
+ end
81
+
82
+ # The {#onComponentTypeChanged} event is fired when a component is converted to
83
+ # a group or vice versa. (In the underlying implementation, {Sketchup::Group}s
84
+ # are just a special kind of definition that is allowed to only have a single
85
+ # instance.)
86
+ #
87
+ # @example
88
+ # def onComponentTypeChanged(definitions, definition)
89
+ # puts "onComponentTypeChanged: #{definition}"
90
+ # end
91
+ #
92
+ # @param [Sketchup::DefinitionList] definitions
93
+ #
94
+ # @param [Sketchup::ComponentDefinition] definition
95
+ #
96
+ # @return [nil]
97
+ #
98
+ # @version SketchUp 6.0
99
+ def onComponentTypeChanged(definitions, definition)
100
+ end
101
+
102
+ end