sketchup-api-stubs 0.7.4 → 0.7.5

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.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sketchup-api-stubs.rb +1 -1
  3. data/lib/sketchup-api-stubs/sketchup.rb +147 -145
  4. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -318
  5. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
  6. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
  7. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  8. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
  10. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +498 -492
  11. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
  13. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
  14. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +691 -691
  16. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  17. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -573
  18. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +179 -174
  20. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  21. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +515 -514
  22. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  23. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -143
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
  25. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
  26. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
  27. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  28. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
  29. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -371
  30. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  31. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  32. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -220
  33. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
  34. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  36. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  37. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
  38. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -204
  39. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  40. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  41. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -694
  42. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  43. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  44. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  47. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -140
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +286 -281
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -328
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -577
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -281
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +577 -562
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +604 -593
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -194
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +362 -329
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -72
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -102
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -312
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -38
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +396 -390
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +502 -508
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1126 -1119
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -125
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -544
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -59
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +126 -125
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +751 -750
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +699 -697
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +417 -409
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -226
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -190
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +405 -393
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -82
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -303
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +327 -285
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -244
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -136
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -112
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -416
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +318 -311
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -141
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -95
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1651 -1638
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -356
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +131 -132
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -770
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +363 -353
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -76
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -456
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -44
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +459 -454
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +257 -257
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -57
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -211
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -225
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +835 -829
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -154
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +71 -61
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1307 -1301
  134. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
  135. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +317 -310
  136. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +387 -356
  137. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +255 -229
  138. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
  139. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
  140. data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
  141. data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
  142. data/lib/sketchup-api-stubs/stubs/geom.rb +351 -348
  143. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
  144. data/lib/sketchup-api-stubs/stubs/length.rb +278 -278
  145. data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
  146. data/lib/sketchup-api-stubs/stubs/sketchup.rb +1342 -1310
  147. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
  148. data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
  149. data/lib/sketchup-api-stubs/stubs/ui.rb +668 -667
  150. metadata +4 -2
@@ -1,1310 +1,1342 @@
1
- # Copyright:: Copyright 2020 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # The Sketchup module contains a number of important utility methods for use in
5
- # your Ruby scripts. Many of the classes in the API are implemented beneath
6
- # this module. You can think of the Sketchup module as the "root" of the
7
- # application tree. Most ruby calls start from the currently active model, and
8
- # this is accessed via the Sketchup.active_model method.
9
- #
10
- # @example
11
- # # Grab a handle to the currently active model (aka the one the user is
12
- # # looking at in SketchUp.)
13
- # model = Sketchup.active_model
14
- #
15
- # # Grab other handles to commonly used collections inside the model.
16
- # entities = model.entities
17
- # layers = model.layers
18
- # materials = model.materials
19
- # component_definitions = model.definitions
20
- # selection = model.selection
21
- #
22
- # # Now that we have our handles, we can start pulling objects and making
23
- # # method calls that are useful.
24
- # first_entity = entities[0]
25
- # UI.messagebox("First thing in your model is a " + first_entity.typename)
26
- #
27
- # number_materials = materials.length
28
- # UI.messagebox("Your model has " + number_materials.to_s + " materials.")
29
- #
30
- # new_edge = entities.add_line( [0,0,0], [500,500,0])
31
- #
32
- # @version SketchUp 6.0
33
- module Sketchup
34
-
35
- # Class Methods
36
-
37
- # The active_model method returns the currently active SketchUp model. On the
38
- # PC, this is the only model that one can have access to via the API, but
39
- # Macintosh versions of SketchUp can have multiple models open at once, in
40
- # which case the method will return the model that the user currently has
41
- # focused.
42
- #
43
- # @example
44
- # model = Sketchup.active_model
45
- # if !model
46
- # UI.messagebox("Failure")
47
- # else
48
- # # code acting on the model
49
- # end
50
- #
51
- # @return [Sketchup::Model] active model object if successful, false if
52
- # unsuccessful
53
- #
54
- # @version SketchUp 6.0
55
- def self.active_model
56
- end
57
-
58
- # The add_observer method is used to add an observer to the current object.
59
- #
60
- # @example
61
- # status = Sketchup.add_observer(observer)
62
- #
63
- # @param [Object] observer
64
- # An observer.
65
- #
66
- # @return [Boolean] true if successful, false if unsuccessful.
67
- #
68
- # @version SketchUp 6.0
69
- def self.add_observer(observer)
70
- end
71
-
72
- # The app_name method is used to retrieve the current application name.
73
- #
74
- # @example
75
- # name = Sketchup.app_name
76
- #
77
- # @return [String] the name of the application, either
78
- # "SketchUp Pro" or "SketchUp".
79
- # Note: For versions earlier than SketchUp8 M4
80
- # (Mac 8.0.15157 and Windows 8.0.15158) this function will
81
- # return "Google SketchUp Pro" or "Google SketchUp".
82
- #
83
- # @version SketchUp 6.0
84
- def self.app_name
85
- end
86
-
87
- # The break_edges= method can be used to disable or enable the break edges
88
- # feature. Break edges is the SketchUp 7 feature that automatically splits
89
- # edges that the user draws which cross over one another.
90
- #
91
- # This feature is always on by default and cannot be disabled by the user
92
- # via the user interface, but you can call this method to disable it. Be
93
- # cautious in doing so, however, as the resulting model could then be altered
94
- # when the user later draws lines into it with the break edges feature
95
- # reactivated.
96
- #
97
- # @example
98
- # Sketchup.break_edges = false
99
- #
100
- # @param [Boolean] enabled
101
- # If true, break edges will be turned on. If false, it
102
- # will be deactivated.
103
- #
104
- # @return [Boolean] true if break edges was turned on.
105
- #
106
- # @version SketchUp 7.0
107
- def self.break_edges=(enabled)
108
- end
109
-
110
- # The break_edges? method indicates whether the break edges feature is
111
- # currently turned on. Break edges is the SketchUp 7 feature that
112
- # automatically splits edges that the user draws which cross over one another.
113
- # This feature is always on by default and cannot be disabled by the user
114
- # via the user interface.
115
- #
116
- # @example
117
- # is_on = Sketchup.break_edges?
118
- #
119
- # @return [Boolean]
120
- #
121
- # @version SketchUp 7.0
122
- def self.break_edges?
123
- end
124
-
125
- # The create_texture_writer method is used to create a TextureWriter object.
126
- #
127
- # @example
128
- # texturewriter = Sketchup.create_texture_writer
129
- #
130
- # @return [Sketchup::TextureWriter] a texturewriter object if successful.
131
- #
132
- # @version SketchUp 6.0
133
- def self.create_texture_writer
134
- end
135
-
136
- # The debug_mode= method lets you controls whether SketchUp will output
137
- # warnings to the console when it detects incorrect usage of the API.
138
- # The setting takes effect right away, no need to restart SketchUp.
139
- #
140
- # @example
141
- # Sketchup.debug_mode = true
142
- #
143
- # @param [Boolean] enabled
144
- # If true, SketchUp will produce debug warnings.
145
- #
146
- # @return [Boolean]
147
- #
148
- # @version SketchUp 2016
149
- def self.debug_mode=(enabled)
150
- end
151
-
152
- # The debug_mode? controls whether SketchUp will output warnings to the console
153
- # when it detects incorrect usage of the API.
154
- #
155
- # @example
156
- # debug_mode = Sketchup.debug_mode?
157
- #
158
- # @return [Boolean]
159
- #
160
- # @version SketchUp 2016
161
- def self.debug_mode?
162
- end
163
-
164
- # The display_name_from_action method is used to gets a user-friendly name
165
- # from an action string. See Sketchup.send_action for a list of valid
166
- # action strings.
167
- #
168
- # @example
169
- # Sketchup.display_name_from_action("viewRight:")
170
- #
171
- # @note This method has been non-functional on Mac since SketchUp 8.
172
- #
173
- # @param [String] action_name
174
- # An action string.
175
- #
176
- # @return [String] a friendly name.
177
- #
178
- # @version SketchUp 6.0
179
- def self.display_name_from_action(action_name)
180
- end
181
-
182
- # Returns the ExtensionsManager where you can find all registered
183
- # SketchupExtension objects.
184
- #
185
- # @example
186
- # extensions = Sketchup.extensions
187
- # extensions.each{ |extension|
188
- # puts "The next extension is named: #{extension.name} and its loaded? state is: #{extension.loaded?}"
189
- # }
190
- #
191
- # @return [Sketchup::ExtensionsManager] an ExtensionsManager object.
192
- #
193
- # @version SketchUp 8.0 M2
194
- def self.extensions
195
- end
196
-
197
- # The file_new method is used to create a new file.
198
- #
199
- # @example
200
- # new_sketchup = Sketchup.file_new
201
- #
202
- # @return [Module] The Sketchup module.
203
- #
204
- # @version SketchUp 6.0
205
- def self.file_new
206
- end
207
-
208
- # The find_support_files method is used to retrieve the relative path and name
209
- # of a file within the SketchUp installation directory.
210
- #
211
- # Forward slashes must be used to delimit between directory names.
212
- #
213
- # @example
214
- # help_file = Sketchup.find_support_file("help.html", "Plugins/")
215
- # if help_file
216
- # # Print out the help_file full path
217
- # UI.messagebox(help_file)
218
- #
219
- # # Open the help_file in a web browser
220
- # UI.openURL("file://" + help_file)
221
- # else
222
- # UI.messagebox("Failure")
223
- # end
224
- #
225
- # @param [String] filename
226
- # Name of the filename you want to find.
227
- #
228
- # @param [String] directory
229
- # directory relative to the SketchUp
230
- # installation directory.
231
- #
232
- # @return [String] the entire path if successful. If unsuccessful,
233
- # the method returns false.
234
- #
235
- # @version SketchUp 6.0
236
- def self.find_support_file(filename, directory)
237
- end
238
-
239
- # The find_support_files method is used to retrieve the path and name of all
240
- # matching files within the SketchUp installation directory.
241
- #
242
- # Forward slashes must be used to delimit between directory names.
243
- #
244
- # @example
245
- # files = Sketchup.find_support_files('rb', 'Plugins')
246
- #
247
- # @param [String] filename
248
- # Extension of the files to be found.
249
- #
250
- # @param [String] directory
251
- # directory relative to the SketchUp installation
252
- # directory. Without this the result will
253
- # be empty.
254
- #
255
- # @return [Array<String>] an array of files. If unsuccessful, the method
256
- # returns false.
257
- #
258
- # @version SketchUp 6.0
259
- def self.find_support_files(filename, directory)
260
- end
261
-
262
- # The fix_shadow_strings= method lets you control whether shadow rendering
263
- # attempts to fix an artifact commonly referred to as "strings". The fix
264
- # is actually very model dependent and not controllable from the UI, so this
265
- # method can be used to control it.
266
- #
267
- # @example
268
- # Sketchup.fix_shadow_strings = true
269
- #
270
- # @param [Boolean] enabled
271
- # If true, shadow strings fix will be turned on. If
272
- # false, it will be deactivated.
273
- #
274
- # @return [Boolean] true if shadow strings fix was turned on.
275
- #
276
- # @version SketchUp 8.0 M1
277
- def self.fix_shadow_strings=(enabled)
278
- end
279
-
280
- # The fix_shadow_strings? method indicates whether the a fix for a shadow
281
- # rendering artifact commonly referred to as "strings" is enabled. The fix
282
- # is actually very model dependent and not controllable from the UI, so this
283
- # method can be used to test it.
284
- #
285
- # @example
286
- # is_on = Sketchup.fix_shadow_strings?
287
- #
288
- # @return [Boolean]
289
- #
290
- # @version SketchUp 8.0 M1
291
- def self.fix_shadow_strings?
292
- end
293
-
294
- # The format_angle method takes a number as an angle in radians and formats it
295
- # into degrees. For example, format_angle(Math::PI) will return 180.0.
296
- #
297
- # @example
298
- # degrees = Sketchup.format_angle(Math::PI)
299
- #
300
- # @param [Numeric] number
301
- # A number to be formatted.
302
- #
303
- # @return [String] an angle in degrees if successful, false if unsuccessful
304
- #
305
- # @version SketchUp 6.0
306
- def self.format_angle(number)
307
- end
308
-
309
- # The #{format_area} method formats a number as an area using the current units
310
- # settings.
311
- #
312
- # The +number+ must be in square inches.
313
- #
314
- # @example
315
- # number = 3.m * 4.m # This will result in 12m2 in inches.
316
- # formatted_area = Sketchup.format_area(number)
317
- #
318
- # @param [Numeric] number
319
- # A number to be formatted.
320
- #
321
- # @return [String]
322
- #
323
- # @version SketchUp 6.0
324
- def self.format_area(number)
325
- end
326
-
327
- # The format_degrees method formats a number as an angle given in degrees. For
328
- # example, 10 becomes 10.0. This is the equivalent to a to_f call.
329
- #
330
- # @example
331
- # degrees = Sketchup.format_degrees(number)
332
- #
333
- # @param [Numeric] number
334
- # A number to be formatted.
335
- #
336
- # @return [String] degrees if successful, false if unsuccessful.
337
- #
338
- # @version SketchUp 6.0
339
- def self.format_degrees(number)
340
- end
341
-
342
- # The {.format_length} method formats a number as a length using the current
343
- # units settings.
344
- #
345
- # The default unit setting is inches. For example, 10 becomes 10".
346
- #
347
- # @example
348
- # length = Sketchup.format_length(10)
349
- #
350
- # @overload format_length(number)
351
- #
352
- # @param [Numeric] number A number to be formatted.
353
- #
354
- # @overload format_length(number, precision)
355
- #
356
- # @param [Numeric] number A number to be formatted.
357
- # @param [Integer] number A custom precision. Negative number will strip
358
- # trailing zeros.
359
- #
360
- # @return [String]
361
- #
362
- # @version SketchUp 6.0
363
- def self.format_length(*args)
364
- end
365
-
366
- # The #{format_volume} method formats a number as a volume using the current
367
- # units settings.
368
- #
369
- # The +number+ must be in cubic inches.
370
- #
371
- # @example
372
- # number = 3.m * 4.m * 5.m # This will result in 60m3 in inches.
373
- # formatted_volume = Sketchup.format_area(number)
374
- #
375
- # @param [Numeric] number
376
- # A number to be formatted.
377
- #
378
- # @return [String]
379
- #
380
- # @version SketchUp 2019.2
381
- def self.format_volume(number)
382
- end
383
-
384
- # The get_datfile_info method is used to retrieve the value for the given key
385
- # from Sketchup.dat.
386
- #
387
- # If the key is not found, default_value is returned.
388
- #
389
- # @example
390
- # value = Sketchup.get_datfile_info(key, default_value)
391
- #
392
- # @param [String] key
393
- # The key whose value you want to retrieve.
394
- #
395
- # @param [String] default_value
396
- # The default value you want returned if key is not
397
- # available.
398
- #
399
- # @return [String] a string value if successful.
400
- #
401
- # @version SketchUp 6.0
402
- def self.get_datfile_info(key, default_value)
403
- end
404
-
405
- # The {.get_i18n_datfile_info} method is used to retrieve the value for the
406
- # given key from the internationalization file that SketchUp uses to work
407
- # in multiple languages.
408
- #
409
- # If the +key+ is not found, +default_value+ is returned.
410
- #
411
- # @example
412
- # value = Sketchup.get_i18n_datfile_info(key, default_value)
413
- #
414
- # @param [String] key
415
- # The key whose value you want to retrieve.
416
- #
417
- # @param [String] default_value
418
- # The default value you want returned if key is not
419
- # available.
420
- #
421
- # @return [String]
422
- #
423
- # @version SketchUp 6.0
424
- def self.get_i18n_datfile_info(key, default_value)
425
- end
426
-
427
- # The os_language method returns the language code for the language SketchUp
428
- # is running in. This is an alias for the get_locale method.
429
- #
430
- # Valid return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW,
431
- # pt-BR, nl, ru.
432
- # If the OS language does not have corresponding folder and files in the
433
- # SketchUp Resources folder, the returned language is, by default, en-US.
434
- #
435
- # @example
436
- # language = Sketchup.os_language
437
- #
438
- # @return [String] a code representing the language SketchUp
439
- # is displaying.
440
- #
441
- # @version SketchUp 6.0
442
- def self.get_locale
443
- end
444
-
445
- # The get_resource_path is used to retrieve the directory where "resource"
446
- # files are stored by SketchUp. Resource files include things like language
447
- # localization files.
448
- #
449
- # @example
450
- # directory = Sketchup.get_resource_path("Styles.strings")
451
- #
452
- # @param [String] filename
453
- # The filename of a resource file in the resource directory hierarchy.
454
- #
455
- # @return [String] the directory path to the resources folder.
456
- #
457
- # @version SketchUp 6.0
458
- def self.get_resource_path(filename)
459
- end
460
-
461
- # The get_shortcuts method retrieves an array of all keyboard shortcuts
462
- # currently registered with SketchUp. Each shortcut is returned as a
463
- # string with the shortcut and the command separated by a tab, similar
464
- # to "Ctrl+A\tEdit/Select All"
465
- #
466
- # @example
467
- # shortcuts = Sketchup.get_shortcuts
468
- #
469
- # @return [Array<String>] an array of shortcut strings.
470
- #
471
- # @version SketchUp 6.0
472
- def self.get_shortcuts
473
- end
474
-
475
- # Installs the contents of a ZIP archive file into SketchUp's Plugins folder.
476
- # If the ZIP contains subfolders, these will be preserved. This allows for a
477
- # Ruby API plugin or Extension developer to distribute their plugin as a single
478
- # file regardless of how many asset files must be included.
479
- #
480
- # The user will be shown a warning message that they must agree to before the
481
- # install proceeds. If they do not agree, an Interrupt error will be raised.
482
- # If the user does agree but there is a problem with the unzip process, an
483
- # Exception will be raised. You can capture these states via a begin/rescue.
484
- # See the example below.
485
- #
486
- # If the install is successful, any Ruby files that have been added to
487
- # the Plugins folder will immediately be executed, saving the user a restart.
488
- #
489
- # To create an archive file, use your favorite tool (7zip, Winzip, etc.) to zip
490
- # up any files and folders in your plugins directory. If the archive contains a
491
- # SketchupExtension that you would like users to be able to install from the
492
- # Preferences > Extensions panel, rename your file to have a .rbz file
493
- # extension.
494
- #
495
- # @example
496
- # path = 'c:/temp/SomePluginPackage.zip'
497
- # begin
498
- # Sketchup.install_from_archive(path)
499
- # rescue Interrupt => error
500
- # UI.messagebox("User said 'no': " + error)
501
- # rescue Exception => error
502
- # UI.messagebox("Error during unzip: " + error)
503
- # end
504
- #
505
- # @param [String] filename
506
- # The path to the RBZ or ZIP file to install.
507
- #
508
- # @raise [Exception] If the archive cannot be installed.
509
- #
510
- # @raise [Interrupt] If the user cancel the installation.
511
- #
512
- # @raise [Exception] If the archive cannot be found.
513
- #
514
- # @return [Boolean]
515
- #
516
- # @version SketchUp 8.0 M2
517
- def self.install_from_archive(filename)
518
- end
519
-
520
- # This methods indicates whether the host SketchUp application is 64bit.
521
- # Useful for extensions that ship with binaries and need to determine
522
- # which versions to load.
523
- #
524
- # @example
525
- # # For backward compatibility, check for the existence of the method
526
- # # and load 32bit binaries for SketchUp versions that do not have this
527
- # # method.
528
- # if Sketchup.respond_to?(:is_64bit?) && Sketchup.is_64bit?
529
- # # Load 64bit binaries.
530
- # else
531
- # # Load 32bit binaries.
532
- # end
533
- #
534
- # @return [Boolean]
535
- #
536
- # @version SketchUp 2015
537
- def self.is_64bit?
538
- end
539
-
540
- # The is_online method is used to verify a connection to the Internet. This
541
- # method can take some time to execute, so be careful not to call it more often
542
- # than you need.
543
- #
544
- # @example
545
- # status = Sketchup.is_online
546
- #
547
- # @return [Boolean] true if successful, false if unsuccessful.
548
- #
549
- # @version SketchUp 6.0
550
- def self.is_online
551
- end
552
-
553
- # Returns a boolean flag indicating whether the application is SketchUp Pro.
554
- # Note that after the free trial period, SketchUp Pro will revert to regular
555
- # SketchUp and this method will return false until the user registers
556
- # the product.
557
- #
558
- # @example
559
- # if Sketchup.is_pro?
560
- # UI.messagebox("You are running SU Pro.")
561
- # end
562
- #
563
- # @return [Boolean]
564
- #
565
- # @version SketchUp 7.0
566
- def self.is_pro?
567
- end
568
-
569
- # The is_valid_filename? method is used to determine whether a filename
570
- # contains illegal characters.
571
- #
572
- # @example
573
- # status = Sketchup.is_valid_filename?(filename)
574
- #
575
- # @param [String] filename
576
- # A filename string.
577
- #
578
- # @return [Boolean]
579
- #
580
- # @version SketchUp 6.0
581
- def self.is_valid_filename?(filename)
582
- end
583
-
584
- # The load method is used to include encrypted and nonencrypted ruby files.
585
- #
586
- # You do not need to include the file extension on the path. This method will
587
- # look for .rb first (unencrypted) and then .rbe (encrypted) and finally .rbs
588
- # (the deprecated scrambled format) files.
589
- # See the "Distributing your Plugin" article for details.
590
- #
591
- # @example
592
- # sfile = "application_loader" # file extension not required
593
- # status = Sketchup.load(sfile)
594
- #
595
- # @param [String] path
596
- # The path, including the filename, to the file you want
597
- # to require.
598
- #
599
- # @return [Boolean] True if the file is included. False if the
600
- # file is not included.
601
- #
602
- # @version SketchUp 6.0
603
- def self.load(path)
604
- end
605
-
606
- # The open_file method is used to open a file.
607
- #
608
- # @example
609
- # result = Sketchup.open_file("C:\\model.skp")
610
- #
611
- # @param [String] filename
612
- # The path and filename to open.
613
- #
614
- # @return [Boolean] true if opening the file succeeded,
615
- # false otherwise.
616
- #
617
- # @version SketchUp 6.0
618
- def self.open_file(filename)
619
- end
620
-
621
- # The os_language method returns the language code for the language SketchUp
622
- # is running in. This is an alias for the get_locale method.
623
- #
624
- # Valid return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW,
625
- # pt-BR, nl, ru.
626
- # If the OS language does not have corresponding folder and files in the
627
- # SketchUp Resources folder, the returned language is, by default, en-US.
628
- #
629
- # @example
630
- # language = Sketchup.os_language
631
- #
632
- # @return [String] a code representing the language SketchUp
633
- # is displaying.
634
- #
635
- # @version SketchUp 6.0
636
- def self.os_language
637
- end
638
-
639
- # The parse_length method parses a string as a length.
640
- #
641
- # For example, "200" becomes 200.0.
642
- #
643
- # @example
644
- # float = Sketchup.parse_length("2'") # Returns 24 (representing inches)
645
- # length = float.to_l # Convert to a Length type if needed.
646
- #
647
- # @param [String] string
648
- # The string to be parsed as a number.
649
- #
650
- # @return [Float] the numerical representation of the string if
651
- # successful, or nil if unsuccessful.
652
- #
653
- # @version SketchUp 6.0
654
- def self.parse_length(string)
655
- end
656
-
657
- # This methods returns a symbol indicating the current platform.
658
- #
659
- # It should be used over RUBY_PLATFORM as this returns a different value for
660
- # Windows since SketchUp 2014.
661
- #
662
- # Older SketchUp versions still need to check
663
- # <code>RUBY_PLATFORM.include?('mswin')</code> or
664
- # <code>RUBY_PLATFORM.include?('darwin')</code>.
665
- #
666
- # Possible return values:
667
- # - :platform_win
668
- # - :platform_osx
669
- #
670
- # @example
671
- # module MyExtension
672
- # IS_WIN = Sketchup.platform == :platform_win
673
- # IS_OSX = Sketchup.platform == :platform_osx
674
- # end
675
- #
676
- # @return [Symbol] Current OS platform.
677
- #
678
- # @version SketchUp 2014
679
- def self.platform
680
- end
681
-
682
- # The plugins_disabled= method lets you control whether SketchUp will load
683
- # Ruby scripts from the plugins directory at startup time. This is primarily
684
- # a trouble-shooting method. If you are having strange behavior in SketchUp
685
- # that you suspect is from a bad script, you can type
686
- # Sketchup.plugins_disabled=true into the Ruby console and restart SketchUp
687
- # to see if the problem is fixed.
688
- #
689
- # @example
690
- # # Type this in the Ruby console then restart SketchUp.
691
- # Sketchup.plugins_disabled = true
692
- #
693
- # # To reactivate plugins, type this into the Ruby console and restart.
694
- # Sketchup.plugins_disabled = false
695
- #
696
- # @param [Boolean] enabled
697
- # If true, the plugins directory will not load.
698
- #
699
- # @return [Boolean] true if plugins were disabled.
700
- #
701
- # @version SketchUp 8.0 M2
702
- def self.plugins_disabled=(enabled)
703
- end
704
-
705
- # The plugins_disabled? method indicates whether Ruby scripts in the plugins
706
- # directory will be loaded at startup time.
707
- #
708
- # @example
709
- # is_disabled = Sketchup.plugins_disabled?
710
- #
711
- # @return [Boolean]
712
- #
713
- # @version SketchUp 8.0 M2
714
- def self.plugins_disabled?
715
- end
716
-
717
- # The quit method is used to terminate the application. This will pop-up the
718
- # usual model save prompts if there are unsaved models open. User can cancel
719
- # the model save, in which case the application will not terminate.
720
- #
721
- # @example
722
- # Sketchup.quit
723
- # # Do not expect code to execute reliably after this point.
724
- #
725
- # @return self
726
- #
727
- # @version SketchUp 2014
728
- def self.quit
729
- end
730
-
731
- # The read_default method is used to retrieve the string associated with a
732
- # value within the specified sub-section section of a .INI file or registry
733
- # (within the Software > SketchUp > SketchUp [Version] section).
734
- #
735
- # @example
736
- # result = Sketchup.read_default("section", "variable", "default")
737
- #
738
- # @param [String] section
739
- # A section in an .INI or registry.
740
- #
741
- # @param [String] variable
742
- # A variable within the section.
743
- #
744
- # @param [Object] default
745
- # A default value if the value is not found.
746
- #
747
- # @return [Object, nil] if unsuccessful, the value of the default
748
- # if successful.
749
- #
750
- # @version SketchUp 6.0
751
- def self.read_default(section, variable, default = nil)
752
- end
753
-
754
- # The register_extension method is used to register an extension with
755
- # SketchUp's extension manager (in SketchUp preferences).
756
- #
757
- # @example
758
- # utilities_extension = SketchupExtension.new("Utilities Tools",
759
- # "Utilities/utilitiesTools.rb")
760
- #
761
- # utilities_extension.description = "Adds Tools->Utilities to the " +
762
- # "SketchUp inteface. The Utilities submenu contains two tools: " +
763
- # "Create Face and Query Tool."
764
- #
765
- # Sketchup.register_extension(utilities_extension, false)
766
- #
767
- # @note It is recommended to set +load_on_start+ to true unless you have a very
768
- # good reason not to.
769
- #
770
- # @param [SketchupExtension] extension
771
- # A SketchupExtension object.
772
- #
773
- # @param [Boolean] load_on_start
774
- # Passing true into this will load the
775
- # extension immediately and set it so
776
- # that it will load automatically
777
- # whenever SketchUp restarts.
778
- #
779
- # @return [Boolean] +true+ if extension registered properly
780
- #
781
- # @version SketchUp 6.0
782
- def self.register_extension(extension, load_on_start = false)
783
- end
784
-
785
- # The register_importer method is used to register an importer with SketchUp.
786
- #
787
- # @example
788
- # status = Sketchup.register_importer(importer)
789
- #
790
- # @param [Sketchup::Importer] importer
791
- # An Importer object representing the importer.
792
- #
793
- # @return [Boolean] true if successful, false if unsuccessful.
794
- #
795
- # @version SketchUp 6.0
796
- def self.register_importer(importer)
797
- end
798
-
799
- # The remove_observer method is used to remove an observer from the current
800
- # object.
801
- #
802
- # @example
803
- # status = Sketchup.remove_observer(observer)
804
- #
805
- # @param [Sketchup::AppObserver] observer
806
- # An observer.
807
- #
808
- # @return [Boolean] true if successful, false if unsuccessful.
809
- #
810
- # @version SketchUp 6.0
811
- def self.remove_observer(observer)
812
- end
813
-
814
- # The require method is used to include encrypted and nonencrypted ruby files.
815
- # This is an alias of the Sketchup.load method.
816
- #
817
- # You do not need to include the file extension on the path. This method will
818
- # look for .rbe first (encrypted) and then .rbs (the deprecated scrambled
819
- # format) and finally .rb (unencrypted) files. The loading order was changed
820
- # in SketchUp 2016 when the new .rbe encryption was introduced. Prior to
821
- # SketchUp 2016 the loading order was first .rb then .rbs.
822
- #
823
- # @example
824
- # sfile = "application_loader" # file extension not required
825
- # status = Sketchup::require(sfile)
826
- #
827
- # @param [String] path
828
- # The path, including the filename, to the file you want
829
- # to require.
830
- #
831
- # @return [Boolean] True if the file is included. False if the
832
- # file is not included.
833
- #
834
- # @version SketchUp 6.0
835
- def self.require(path)
836
- end
837
-
838
- # The save_thumbnail method is used to generate a thumbnail for any SKP file -
839
- # not necessarily the loaded model.
840
- #
841
- # @example
842
- # status = Sketchup.save_thumbnail("skp_filename", "image_filename")
843
- #
844
- # @param [String] skp_filename
845
- # The name of the SketchUp file whose model you want
846
- # represented in the thumbnail.
847
- #
848
- # @param [String] img_filename
849
- # The name of the file where the thumbnail will be saved.
850
- #
851
- # @return [Boolean] true if successful, false if unsuccessful.
852
- #
853
- # @version SketchUp 6.0
854
- def self.save_thumbnail(skp_filename, img_filename)
855
- end
856
-
857
- # The send_action method sends a message to the message queue to perform some
858
- # action asynchronously.
859
- #
860
- # Valid actions are:
861
- # - showRubyPanel:
862
- # - viewBack:
863
- # - viewBottom:
864
- # - viewFront:
865
- # - viewIso:
866
- # - viewLeft:
867
- # - viewRight:
868
- # - viewTop:
869
- # - viewPerspective:
870
- # - viewShowAxes:
871
- # - viewShowHidden:
872
- # - viewZoomExtents:
873
- # - viewZoomToSelection:
874
- # - viewUndo:
875
- # - selectOrbitTool:
876
- # - selectPositionCameraTool:
877
- # - selectDollyTool:
878
- # - selectTurnTool:
879
- # - selectWalkTool:
880
- # - selectZoomTool:
881
- # - selectFieldOfViewTool:
882
- # - selectZoomWindowTool:
883
- # - pageAdd:
884
- # - pageDelete:
885
- # - pageUpdate:
886
- # - pageNext:
887
- # - pagePrevious:
888
- # - renderWireframe:
889
- # - renderHiddenLine:
890
- # - renderMonochrome:
891
- # - renderShaded:
892
- # - renderTextures:
893
- # - selectArcTool:
894
- # - selectArc3PointTool:
895
- # - selectArc3PointPieTool:
896
- # - selectAxisTool:
897
- # - selectCircleTool:
898
- # - selectEraseTool:
899
- # - selectFreehandTool:
900
- # - selectLineTool:
901
- # - selectMeasureTool:
902
- # - selectMoveTool:
903
- # - selectOffsetTool:
904
- # - selectPaintTool:
905
- # - selectPolygonTool:
906
- # - selectProtractorTool:
907
- # - selectPushPullTool:
908
- # - selectRectangleTool:
909
- # - selectRectangle3PointTool:
910
- # - selectRotateTool:
911
- # - selectScaleTool:
912
- # - selectSectionPlaneTool:
913
- # - selectTextTool:
914
- # - selectDimensionTool:
915
- # - selectExtrudeTool:
916
- # - selectSelectionTool:
917
- # - editUndo:
918
- # - editRedo:
919
- # - editHide:
920
- # - editUnhide:
921
- # - fixNonPlanarFaces:
922
- #
923
- # Added in SketchUp 8.0+:
924
- # - addBuilding:
925
- # - getPhotoTexture:
926
- # - selectImageIglooTool:
927
- # - selectNorthTool:
928
- #
929
- # Added in SketchUp 2013+:
930
- # - showExtensionStore:
931
- #
932
- # Removed in SketchUp 2013+:
933
- # - addBuilding:
934
- #
935
- # On the PC only, you can also send these numeric values. (Note that these are
936
- # officially "unsupported" and are not guaranteed to work in current or
937
- # future versions of the API.)
938
- #
939
- # - 10501: set view to Top
940
- # - 10502: set view to Front
941
- # - 10503: set view to Rear
942
- # - 10504: set view to Left
943
- # - 10505: set view to Right
944
- # - 10506: set view to Bottom
945
- # - 10507: set view to Axonometric
946
- # - 10510: set render mode to Wire
947
- # - 10511: set render mode to Hidden lines removal
948
- # - 10512: set render mode to Surfaces Shading
949
- # - 10513: set render mode to Transparency
950
- # - 10519: set camera to ortho (removes perspective)
951
- # - 10520: walk tool
952
- # - 10521: display the System Preferences dialog box (Files tab)
953
- # - 10522: removes axes display
954
- # - 10523: pan tool
955
- # - 10525: set the interactive eye height feature
956
- # - 10526: zoom window
957
- # - 10527: zoom extents
958
- # - 10529: zoom out 2
959
- # - 10531: toggle the Standard toolbar
960
- # - 10532: toggle the Camera toolbar
961
- # - 10533: display the Shadows Settings dialog box
962
- # - 10537: toggle the Views toolbar
963
- # - 10538: display the System Preferences dialog box (Display tab)
964
- # - 10545: toggle Color ByLayer
965
- # - 10546: toggle Shadows toolbar
966
- # - 10551: toogle Large icons
967
- # - 10576: toggle Render Mode toolbar
968
- # - 10596: set Render Mode to No Transparency (Preferences)
969
- # - 10597: set Render Mode to Wire (Preferences)
970
- # - 10598: set Render Mode to Transparency (Preferences)
971
- # - 10599: set Render Mode to Surfaces Shading (Preferences)
972
- # - 10600: set Render Mode to Texture (Preferences)
973
- # - 10601: set Render Mode to No Texture (Preferences)
974
- # - 10602: toggle Shadows
975
- # - 10603: toggle Profiles
976
- # - 10604: toggle Extension Lines
977
- # - 10605: toggle Jitter edges
978
- # - 21019: hide Status bar and VCB
979
- # - 21020: show Status bar and VCB
980
- # - 21022: hide Status bar and VCB
981
- # - 21023: place 3d text box
982
- # - 21024: select the Measure tool
983
- # - 21031: select the Freehand Draw tool
984
- # - 21041: select the PushPull tool
985
- # - 21048: select the Move tool
986
- # - 21052: hide selected objects
987
- # - 21056: create face with selected edges closed loop
988
- # - 21057: select the Protractor tool
989
- # - 21060: display Components Window
990
- # - 21061: toggle Draw toolbar
991
- # - 21063: toggle Model Bounding Box display
992
- # - 21065: select the Arc tool
993
- # - 21067: creat a new Page
994
- # - 21069: select the Arc 3 Point tool
995
- # - 21070: select the Arc 3 Point Pie tool
996
- # - 21074: show the Materials Browser Window
997
- # - 21076: display the Preferences dialog box (Text activated)
998
- # - 21077: display the Tip of the day Window
999
- # - 21078: select the Paint Bucket tool
1000
- # - 21080: display the Page Manager Window
1001
- # - 21082: display the Macros Dialog Box
1002
- # - 21086: display the Components Browser Window
1003
- # - 21094: select the Rectangle tool
1004
- # - 21095: select the Polygon tool
1005
- # - 21096: select the Circle tool
1006
- # - 21098: open the Open Window
1007
- # - 21100: select the Offset tool
1008
- # - 21101: select all objects
1009
- # - 21107: invert selection
1010
- # - 21112: open the Import Window
1011
- # - 21124: launch the validity check tool
1012
- # - 21126: select the Axes tool
1013
- # - 21029: select the Rotate tool
1014
- # - 21032: toggle Layer toolbar
1015
- # - 21036: display the Save as Window
1016
- # - 21046: spin the model a full 360&deg; and display report
1017
- # - 21047: fast Pick Time report
1018
- # - 21049: open the Export model Window
1019
- # - 21169: select the Position Camera tool
1020
- # - 21170: display the Preferences, Tour Guide activated
1021
- # - 21180: create a new Page just right of selected page
1022
- # - 21200: display the Insert Image Window
1023
- # - 21233: display Area of selected face
1024
- # - 21234: display Area of all faces with selected material
1025
- # - 21236: select the Scale tool
1026
- # - 21237: display the Export 2D Graphics Window
1027
- # - 21245: display a Polygon Offset Factors dialog box
1028
- # - 21276: reverse selected face(s)
1029
- # - 21287: select the Divide feature
1030
- # - 21337: select the Section Plane Placement tool
1031
- # - 21354: open the Layer Window
1032
- # - 21386: open the Export Animation Window
1033
- # - 21405: select the Text tool
1034
- # - 21406: display Fog dialog box
1035
- # - 21410: select the Dim tool
1036
- # - 21433: toggle Edit toolbar
1037
- # - 21442: select the FollowMe tool
1038
- # - 21448: select the Axes tool
1039
- # - 21453: select all objects
1040
- # - 21460: display Licence
1041
- # - 21462: display Authorization dialog box
1042
- # - 21463: display un-authorizing message
1043
- # - 21464: display Open Licence files (Network) Window
1044
- # - 21466: display Quick reference Card in Adobe Reader
1045
- # - 21467: display Licences in use dialog box
1046
- # - 21469: zoom extents to selected objects
1047
- # - 21476: perform a non-planar check on selected objects
1048
- # - 21477: list accelerators in window
1049
- # - 21485: erase selected objects
1050
- # - 21487: display Edit current material dialog box
1051
- # - 21485: erase all new created pages
1052
- # - 21488: display Entity Info Window
1053
- # - 21490: display Soften Edges Window
1054
- # - 21491: display Profiles
1055
- # - 21492: display Extended Edges
1056
- # - 21493: display Jitter Lines
1057
- # - 21494: select Field of view tool
1058
- # - 21513: display the outliner
1059
- # - 21520: override Tile Rendering Size dialog box
1060
- # - 21525: select the FollowMe tool
1061
- # - 21542: display the Insert Image Window
1062
- # - 21560 and up: causes a runtime Error
1063
- #
1064
- # @example
1065
- # result = Sketchup.send_action("selectArcTool:")
1066
- #
1067
- # @param [String, Integer] action
1068
- # The action to be performed.
1069
- #
1070
- # @return [Boolean] +true+ if successful, +false+ if unsuccessful
1071
- #
1072
- # @version SketchUp 6.0
1073
- def self.send_action(action)
1074
- end
1075
-
1076
- # The {.send_to_layout} method is used to open a file in LayOut.
1077
- #
1078
- # @example
1079
- # result = Sketchup.send_to_layout("C:/models/hexaflexagon.layout")
1080
- #
1081
- # @param [String] file
1082
- # The path and filename to open, either .skp or .layout.
1083
- #
1084
- # @return [Boolean] true if opening the file succeeded,
1085
- # false otherwise. If LayOut is not installed or the file is not present
1086
- # this function will return false.
1087
- #
1088
- # @version SketchUp 2018
1089
- def self.send_to_layout(file)
1090
- end
1091
-
1092
- # The set_status_text method is used to
1093
- # set the text appearing on the status bar within the drawing window.
1094
- #
1095
- # If no arguments are passed, the status bar content is cleared. Valid
1096
- # positions are:
1097
- #
1098
- # - +SB_PROMPT+ - the text will appear at the left-side of the status bar
1099
- # - +SB_VCB_LABEL+ - the text will appear in place of the VCB label
1100
- # - +SB_VCB_VALUE+ - the text will appear in the VCB
1101
- #
1102
- # @example
1103
- # result = Sketchup.set_status_text("This is a Test", SB_VCB_VALUE)
1104
- # if result
1105
- # #code to do something if set_status_text is successful
1106
- # end
1107
- #
1108
- # @overload set_status_text
1109
- #
1110
- # Clears all status panes.
1111
- # @return [nil]
1112
- #
1113
- # @overload set_status_text(status_text = '', position = SB_PROMPT)
1114
- #
1115
- # @param [String] status text the status text that will appear.
1116
- # @param [Integer] position the position where the text will appear.
1117
- # @return [nil]
1118
- #
1119
- # @version SketchUp 6.0
1120
- def self.set_status_text(*args)
1121
- end
1122
-
1123
- # The status_text= method is used to set the text appearing on the status
1124
- # bar within the drawing window.
1125
- #
1126
- # This is the same as calling set_status_text with a 2nd parameter of
1127
- # SB_PROMPT.
1128
- #
1129
- # @example
1130
- # result = Sketchup.status_text = "This is a Test"
1131
- #
1132
- # @param [String] status_text
1133
- # The status text that will appear.
1134
- #
1135
- # @return [String]
1136
- #
1137
- # @version SketchUp 6.0
1138
- def self.status_text=(status_text)
1139
- end
1140
-
1141
- # The temp_dir method is used to retrieve the OS temporary directory for the
1142
- # current user. You can use this directory to write temporary files that are
1143
- # not required to persist between SketchUp sessions.
1144
- #
1145
- # @example
1146
- # temp_dir = Sketchup.temp_dir
1147
- #
1148
- # @return [String] a string containing the full temporary directory path
1149
- #
1150
- # @version SketchUp 2014
1151
- def self.temp_dir
1152
- end
1153
-
1154
- # The template method is used to get the file name of the current template.
1155
- # Templates are the .skp files that are loaded when the user select File > New.
1156
- #
1157
- # @example
1158
- # name = Sketchup.template
1159
- #
1160
- # @return [String] the current template
1161
- #
1162
- # @version SketchUp 6.0
1163
- def self.template
1164
- end
1165
-
1166
- # The template= method is used to set the file name of the current template.
1167
- # Templates are the .skp files that are loaded when the user select File > New.
1168
- #
1169
- # @example
1170
- # status = Sketchup.template = "filename"
1171
- #
1172
- # @param [String] filename
1173
- # The name of the template to set.
1174
- #
1175
- # @return [String] true if successful, false if unsuccessful.
1176
- #
1177
- # @version SketchUp 6.0
1178
- def self.template=(filename)
1179
- end
1180
-
1181
- # The template_dir is used to retrieve the directory where templates are
1182
- # stored by the SketchUp install. Templates are the .skp files that are loaded
1183
- # when the user select File > New.
1184
- #
1185
- # @example
1186
- # directory = Sketchup.template_dir
1187
- #
1188
- # @return [String] containing the full template directory path
1189
- #
1190
- # @version SketchUp 6.0
1191
- def self.template_dir
1192
- end
1193
-
1194
- # The undo method is used undo the last transaction on the undo stack.
1195
- #
1196
- # @example
1197
- # Sketchup.undo
1198
- #
1199
- # @return [nil]
1200
- #
1201
- # @version SketchUp 6.0
1202
- def self.undo
1203
- end
1204
-
1205
- # The vcb_label= method is used to set the label that appears on the vcb,
1206
- # or the "value control box", which is another word for the "measurements"
1207
- # text entry box that appears at the bottom on the SketchUp window.
1208
- #
1209
- # This is the same as calling set_status_text with a 2nd parameter of
1210
- # SB_VCB_LABEL.
1211
- #
1212
- # @example
1213
- # result = Sketchup.vcb_label = "This is a Test"
1214
- #
1215
- # @param [String] label_text
1216
- # The label text that will appear.
1217
- #
1218
- # @return [String]
1219
- #
1220
- # @version SketchUp 6.0
1221
- def self.vcb_label=(label_text)
1222
- end
1223
-
1224
- # The vcb_value= method is used to set the value that appears on the vcb,
1225
- # or the "value control box", which is another word for the "measurements"
1226
- # text entry box that appears at the bottom on the SketchUp window.
1227
- #
1228
- # This is the same as calling set_status_text with a 2nd parameter of
1229
- # SB_VCB_VALUE.
1230
- #
1231
- # @example
1232
- # result = Sketchup.vcb_value = "This is a Test"
1233
- #
1234
- # @param [String] value
1235
- # The text that will appear as the vcb's value.
1236
- #
1237
- # @return [String]
1238
- #
1239
- # @version SketchUp 6.0
1240
- def self.vcb_value=(value)
1241
- end
1242
-
1243
- # Gets the current version of sketchup in decimal form.
1244
- #
1245
- # @example
1246
- # version = Sketchup.version
1247
- # if (version)
1248
- # UI.messagebox version
1249
- # else
1250
- # return
1251
- # end
1252
- #
1253
- # @return [String] the decimal form of the version
1254
- #
1255
- # @version SketchUp 6.0
1256
- def self.version
1257
- end
1258
-
1259
- # Get the current version of sketchup as a whole number for comparisons. The
1260
- # number returned has the major, minor, and build values packed into an integer
1261
- # value as follows:
1262
- # - Major version = X
1263
- # - Minor version = Y
1264
- # - Build number = Z
1265
- #
1266
- # SketchUp 6.0 - SketchUp 2015
1267
- # - XXYYYZZZ
1268
- #
1269
- # SketchUp 2016+
1270
- # - XXYZZZZZZZ
1271
- #
1272
- # @example
1273
- # if (15003000...15004000) === Sketchup.version_number
1274
- # puts "SketchUp 15.3"
1275
- # end
1276
- # if Sketchup.version_number >= 1600000000
1277
- # puts "New format"
1278
- # end
1279
- #
1280
- # @return [Integer] the whole number form of the version
1281
- #
1282
- # @version SketchUp 6.0
1283
- def self.version_number(*args)
1284
- end
1285
-
1286
- # The write_default method is used to set the string associated with a
1287
- # variable within the specified sub-section of a .plist file on the Mac
1288
- # or the registry on Windows
1289
- # (within the Software > SketchUp > SketchUp [Version] section).
1290
- #
1291
- # @example
1292
- # result = Sketchup.write_default("section", "key", "my_value")
1293
- #
1294
- # @param [String] section
1295
- # A section in a .plist file (Mac) or the registry
1296
- # (Windows).
1297
- #
1298
- # @param [String] key
1299
- # A key within the section.
1300
- #
1301
- # @param [Object] value
1302
- # The value to store.
1303
- #
1304
- # @return [Boolean] True if successful, false if unsuccessful.
1305
- #
1306
- # @version SketchUp 6.0
1307
- def self.write_default(section, key, value)
1308
- end
1309
-
1310
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The Sketchup module contains a number of important utility methods for use in
5
+ # your Ruby scripts. Many of the classes in the API are implemented beneath
6
+ # this module. You can think of the Sketchup module as the "root" of the
7
+ # application tree. Most ruby calls start from the currently active model, and
8
+ # this is accessed via the Sketchup.active_model method.
9
+ #
10
+ # @example
11
+ # # Grab a handle to the currently active model (aka the one the user is
12
+ # # looking at in SketchUp.)
13
+ # model = Sketchup.active_model
14
+ #
15
+ # # Grab other handles to commonly used collections inside the model.
16
+ # entities = model.entities
17
+ # layers = model.layers
18
+ # materials = model.materials
19
+ # component_definitions = model.definitions
20
+ # selection = model.selection
21
+ #
22
+ # # Now that we have our handles, we can start pulling objects and making
23
+ # # method calls that are useful.
24
+ # first_entity = entities[0]
25
+ # UI.messagebox("First thing in your model is a " + first_entity.typename)
26
+ #
27
+ # number_materials = materials.length
28
+ # UI.messagebox("Your model has " + number_materials.to_s + " materials.")
29
+ #
30
+ # new_edge = entities.add_line( [0,0,0], [500,500,0])
31
+ #
32
+ # @version SketchUp 6.0
33
+ module Sketchup
34
+
35
+ # Class Methods
36
+
37
+ # The active_model method returns the currently active SketchUp model. On the
38
+ # PC, this is the only model that one can have access to via the API, but
39
+ # Macintosh versions of SketchUp can have multiple models open at once, in
40
+ # which case the method will return the model that the user currently has
41
+ # focused.
42
+ #
43
+ # @example
44
+ # model = Sketchup.active_model
45
+ # if !model
46
+ # UI.messagebox("Failure")
47
+ # else
48
+ # # code acting on the model
49
+ # end
50
+ #
51
+ # @return [Sketchup::Model] active model object if successful, false if
52
+ # unsuccessful
53
+ #
54
+ # @version SketchUp 6.0
55
+ def self.active_model
56
+ end
57
+
58
+ # The add_observer method is used to add an observer to the current object.
59
+ #
60
+ # @example
61
+ # status = Sketchup.add_observer(observer)
62
+ #
63
+ # @param [Object] observer
64
+ # An observer.
65
+ #
66
+ # @return [Boolean] true if successful, false if unsuccessful.
67
+ #
68
+ # @version SketchUp 6.0
69
+ def self.add_observer(observer)
70
+ end
71
+
72
+ # The app_name method is used to retrieve the current application name.
73
+ #
74
+ # @example
75
+ # name = Sketchup.app_name
76
+ #
77
+ # @return [String] the name of the application, either
78
+ # "SketchUp Pro" or "SketchUp".
79
+ # Note: For versions earlier than SketchUp8 M4
80
+ # (Mac 8.0.15157 and Windows 8.0.15158) this function will
81
+ # return "Google SketchUp Pro" or "Google SketchUp".
82
+ #
83
+ # @version SketchUp 6.0
84
+ def self.app_name
85
+ end
86
+
87
+ # The break_edges= method can be used to disable or enable the break edges
88
+ # feature. Break edges is the SketchUp 7 feature that automatically splits
89
+ # edges that the user draws which cross over one another.
90
+ #
91
+ # This feature is always on by default and cannot be disabled by the user
92
+ # via the user interface, but you can call this method to disable it. Be
93
+ # cautious in doing so, however, as the resulting model could then be altered
94
+ # when the user later draws lines into it with the break edges feature
95
+ # reactivated.
96
+ #
97
+ # @example
98
+ # Sketchup.break_edges = false
99
+ #
100
+ # @param [Boolean] enabled
101
+ # If true, break edges will be turned on. If false, it
102
+ # will be deactivated.
103
+ #
104
+ # @return [Boolean] true if break edges was turned on.
105
+ #
106
+ # @version SketchUp 7.0
107
+ def self.break_edges=(enabled)
108
+ end
109
+
110
+ # The break_edges? method indicates whether the break edges feature is
111
+ # currently turned on. Break edges is the SketchUp 7 feature that
112
+ # automatically splits edges that the user draws which cross over one another.
113
+ # This feature is always on by default and cannot be disabled by the user
114
+ # via the user interface.
115
+ #
116
+ # @example
117
+ # is_on = Sketchup.break_edges?
118
+ #
119
+ # @return [Boolean]
120
+ #
121
+ # @version SketchUp 7.0
122
+ def self.break_edges?
123
+ end
124
+
125
+ # The create_texture_writer method is used to create a TextureWriter object.
126
+ #
127
+ # @example
128
+ # texturewriter = Sketchup.create_texture_writer
129
+ #
130
+ # @return [Sketchup::TextureWriter] a texturewriter object if successful.
131
+ #
132
+ # @version SketchUp 6.0
133
+ def self.create_texture_writer
134
+ end
135
+
136
+ # The debug_mode= method lets you controls whether SketchUp will output
137
+ # warnings to the console when it detects incorrect usage of the API.
138
+ # The setting takes effect right away, no need to restart SketchUp.
139
+ #
140
+ # @example
141
+ # Sketchup.debug_mode = true
142
+ #
143
+ # @param [Boolean] enabled
144
+ # If true, SketchUp will produce debug warnings.
145
+ #
146
+ # @return [Boolean]
147
+ #
148
+ # @version SketchUp 2016
149
+ def self.debug_mode=(enabled)
150
+ end
151
+
152
+ # The debug_mode? controls whether SketchUp will output warnings to the console
153
+ # when it detects incorrect usage of the API.
154
+ #
155
+ # @example
156
+ # debug_mode = Sketchup.debug_mode?
157
+ #
158
+ # @return [Boolean]
159
+ #
160
+ # @version SketchUp 2016
161
+ def self.debug_mode?
162
+ end
163
+
164
+ # The display_name_from_action method is used to gets a user-friendly name
165
+ # from an action string. See Sketchup.send_action for a list of valid
166
+ # action strings.
167
+ #
168
+ # @example
169
+ # Sketchup.display_name_from_action("viewRight:")
170
+ #
171
+ # @note This method has been non-functional on Mac since SketchUp 8.
172
+ #
173
+ # @param [String] action_name
174
+ # An action string.
175
+ #
176
+ # @return [String] a friendly name.
177
+ #
178
+ # @version SketchUp 6.0
179
+ def self.display_name_from_action(action_name)
180
+ end
181
+
182
+ # Returns the ExtensionsManager where you can find all registered
183
+ # SketchupExtension objects.
184
+ #
185
+ # @example
186
+ # extensions = Sketchup.extensions
187
+ # extensions.each{ |extension|
188
+ # puts "The next extension is named: #{extension.name} and its loaded? state is: #{extension.loaded?}"
189
+ # }
190
+ #
191
+ # @return [Sketchup::ExtensionsManager] an ExtensionsManager object.
192
+ #
193
+ # @version SketchUp 8.0 M2
194
+ def self.extensions
195
+ end
196
+
197
+ # The file_new method is used to create a new file.
198
+ #
199
+ # @example
200
+ # new_sketchup = Sketchup.file_new
201
+ #
202
+ # @return [Module] The Sketchup module.
203
+ #
204
+ # @version SketchUp 6.0
205
+ def self.file_new
206
+ end
207
+
208
+ # The find_support_files method is used to retrieve the relative path and name
209
+ # of a file within the SketchUp installation directory.
210
+ #
211
+ # Forward slashes must be used to delimit between directory names.
212
+ #
213
+ # @example
214
+ # help_file = Sketchup.find_support_file("help.html", "Plugins/")
215
+ # if help_file
216
+ # # Print out the help_file full path
217
+ # UI.messagebox(help_file)
218
+ #
219
+ # # Open the help_file in a web browser
220
+ # UI.openURL("file://" + help_file)
221
+ # else
222
+ # UI.messagebox("Failure")
223
+ # end
224
+ #
225
+ # @param [String] filename
226
+ # Name of the filename you want to find.
227
+ #
228
+ # @param [String] directory
229
+ # directory relative to the SketchUp
230
+ # installation directory.
231
+ #
232
+ # @return [String] the entire path if successful. If unsuccessful,
233
+ # the method returns false.
234
+ #
235
+ # @version SketchUp 6.0
236
+ def self.find_support_file(filename, directory)
237
+ end
238
+
239
+ # The find_support_files method is used to retrieve the path and name of all
240
+ # matching files within the SketchUp installation directory.
241
+ #
242
+ # Forward slashes must be used to delimit between directory names.
243
+ #
244
+ # @example
245
+ # files = Sketchup.find_support_files('rb', 'Plugins')
246
+ #
247
+ # @param [String] filename
248
+ # Extension of the files to be found.
249
+ #
250
+ # @param [String] directory
251
+ # directory relative to the SketchUp installation
252
+ # directory. Without this the result will
253
+ # be empty.
254
+ #
255
+ # @return [Array<String>] an array of files. If unsuccessful, the method
256
+ # returns false.
257
+ #
258
+ # @version SketchUp 6.0
259
+ def self.find_support_files(filename, directory)
260
+ end
261
+
262
+ # The fix_shadow_strings= method lets you control whether shadow rendering
263
+ # attempts to fix an artifact commonly referred to as "strings". The fix
264
+ # is actually very model dependent and not controllable from the UI, so this
265
+ # method can be used to control it.
266
+ #
267
+ # @example
268
+ # Sketchup.fix_shadow_strings = true
269
+ #
270
+ # @param [Boolean] enabled
271
+ # If true, shadow strings fix will be turned on. If
272
+ # false, it will be deactivated.
273
+ #
274
+ # @return [Boolean] true if shadow strings fix was turned on.
275
+ #
276
+ # @version SketchUp 8.0 M1
277
+ def self.fix_shadow_strings=(enabled)
278
+ end
279
+
280
+ # The fix_shadow_strings? method indicates whether the a fix for a shadow
281
+ # rendering artifact commonly referred to as "strings" is enabled. The fix
282
+ # is actually very model dependent and not controllable from the UI, so this
283
+ # method can be used to test it.
284
+ #
285
+ # @example
286
+ # is_on = Sketchup.fix_shadow_strings?
287
+ #
288
+ # @return [Boolean]
289
+ #
290
+ # @version SketchUp 8.0 M1
291
+ def self.fix_shadow_strings?
292
+ end
293
+
294
+ # The format_angle method takes a number as an angle in radians and formats it
295
+ # into degrees. For example, format_angle(Math::PI) will return 180.0.
296
+ #
297
+ # @example
298
+ # degrees = Sketchup.format_angle(Math::PI)
299
+ #
300
+ # @param [Numeric] number
301
+ # A number to be formatted.
302
+ #
303
+ # @return [String] an angle in degrees if successful, false if unsuccessful
304
+ #
305
+ # @version SketchUp 6.0
306
+ def self.format_angle(number)
307
+ end
308
+
309
+ # The {.format_area} method formats a number as an area using the current units
310
+ # settings.
311
+ #
312
+ # The +number+ must be in square inches.
313
+ #
314
+ # @example
315
+ # number = 3.m * 4.m # This will result in 12m2 in inches.
316
+ # formatted_area = Sketchup.format_area(number)
317
+ #
318
+ # @param [Numeric] number
319
+ # A number to be formatted.
320
+ #
321
+ # @return [String]
322
+ #
323
+ # @version SketchUp 6.0
324
+ def self.format_area(number)
325
+ end
326
+
327
+ # The format_degrees method formats a number as an angle given in degrees. For
328
+ # example, 10 becomes 10.0. This is the equivalent to a to_f call.
329
+ #
330
+ # @example
331
+ # degrees = Sketchup.format_degrees(number)
332
+ #
333
+ # @param [Numeric] number
334
+ # A number to be formatted.
335
+ #
336
+ # @return [String] degrees if successful, false if unsuccessful.
337
+ #
338
+ # @version SketchUp 6.0
339
+ def self.format_degrees(number)
340
+ end
341
+
342
+ # The {.format_length} method formats a number as a length using the current
343
+ # units settings.
344
+ #
345
+ # The default unit setting is inches. For example, 10 becomes 10".
346
+ #
347
+ # @example
348
+ # length = Sketchup.format_length(10)
349
+ #
350
+ # @overload format_length(number)
351
+ #
352
+ # @param [Numeric] number A number to be formatted.
353
+ #
354
+ # @overload format_length(number, precision)
355
+ #
356
+ # @param [Numeric] number A number to be formatted.
357
+ # @param [Integer] number A custom precision. Negative number will strip
358
+ # trailing zeros.
359
+ #
360
+ # @return [String]
361
+ #
362
+ # @version SketchUp 6.0
363
+ def self.format_length(*args)
364
+ end
365
+
366
+ # The {.format_volume} method formats a number as a volume using the current
367
+ # units settings.
368
+ #
369
+ # The +number+ must be in cubic inches.
370
+ #
371
+ # @example
372
+ # number = 3.m * 4.m * 5.m # This will result in 60m3 in inches.
373
+ # formatted_volume = Sketchup.format_area(number)
374
+ #
375
+ # @param [Numeric] number
376
+ # A number to be formatted.
377
+ #
378
+ # @return [String]
379
+ #
380
+ # @version SketchUp 2019.2
381
+ def self.format_volume(number)
382
+ end
383
+
384
+ # The get_datfile_info method is used to retrieve the value for the given key
385
+ # from Sketchup.dat.
386
+ #
387
+ # If the key is not found, default_value is returned.
388
+ #
389
+ # @example
390
+ # value = Sketchup.get_datfile_info(key, default_value)
391
+ #
392
+ # @param [String] key
393
+ # The key whose value you want to retrieve.
394
+ #
395
+ # @param [String] default_value
396
+ # The default value you want returned if key is not
397
+ # available.
398
+ #
399
+ # @return [String] a string value if successful.
400
+ #
401
+ # @version SketchUp 6.0
402
+ def self.get_datfile_info(key, default_value)
403
+ end
404
+
405
+ # The {.get_i18n_datfile_info} method is used to retrieve the value for the
406
+ # given key from the internationalization file that SketchUp uses to work
407
+ # in multiple languages.
408
+ #
409
+ # If the +key+ is not found, +default_value+ is returned.
410
+ #
411
+ # @example
412
+ # value = Sketchup.get_i18n_datfile_info(key, default_value)
413
+ #
414
+ # @param [String] key
415
+ # The key whose value you want to retrieve.
416
+ #
417
+ # @param [String] default_value
418
+ # The default value you want returned if key is not
419
+ # available.
420
+ #
421
+ # @return [String]
422
+ #
423
+ # @version SketchUp 6.0
424
+ def self.get_i18n_datfile_info(key, default_value)
425
+ end
426
+
427
+ # The os_language method returns the language code for the language SketchUp
428
+ # is running in. This is an alias for the get_locale method.
429
+ #
430
+ # Examples of return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW,
431
+ # pt-BR, nl, ru and sv. For an up to date list os supported languages, see
432
+ # the SketchUp download page.
433
+ #
434
+ # @example
435
+ # language = Sketchup.os_language
436
+ #
437
+ # @return [String] a code representing the language SketchUp
438
+ # is displaying.
439
+ #
440
+ # @version SketchUp 6.0
441
+ def self.get_locale
442
+ end
443
+
444
+ # The get_resource_path is used to retrieve the directory where "resource"
445
+ # files are stored by SketchUp. Resource files include things like language
446
+ # localization files.
447
+ #
448
+ # @example
449
+ # directory = Sketchup.get_resource_path("Styles.strings")
450
+ #
451
+ # @param [String] filename
452
+ # The filename of a resource file in the resource directory hierarchy.
453
+ #
454
+ # @return [String] the directory path to the resources folder.
455
+ #
456
+ # @version SketchUp 6.0
457
+ def self.get_resource_path(filename)
458
+ end
459
+
460
+ # The get_shortcuts method retrieves an array of all keyboard shortcuts
461
+ # currently registered with SketchUp. Each shortcut is returned as a
462
+ # string with the shortcut and the command separated by a tab, similar
463
+ # to "Ctrl+A\\tEdit/Select All"
464
+ #
465
+ # @example
466
+ # shortcuts = Sketchup.get_shortcuts
467
+ #
468
+ # @return [Array<String>] an array of shortcut strings.
469
+ #
470
+ # @version SketchUp 6.0
471
+ def self.get_shortcuts
472
+ end
473
+
474
+ # Installs the contents of a ZIP archive file into SketchUp's Plugins folder.
475
+ # If the ZIP contains subfolders, these will be preserved. This allows for a
476
+ # Ruby API plugin or Extension developer to distribute their plugin as a single
477
+ # file regardless of how many asset files must be included.
478
+ #
479
+ # The user will be shown a warning message that they must agree to before the
480
+ # install proceeds. If they do not agree, an Interrupt error will be raised.
481
+ # If the user does agree but there is a problem with the unzip process, an
482
+ # Exception will be raised. You can capture these states via a begin/rescue.
483
+ # See the example below.
484
+ #
485
+ # If the install is successful, any Ruby files that have been added to
486
+ # the Plugins folder will immediately be executed, saving the user a restart.
487
+ #
488
+ # To create an archive file, use your favorite tool (7zip, Winzip, etc.) to zip
489
+ # up any files and folders in your plugins directory. If the archive contains a
490
+ # SketchupExtension that you would like users to be able to install from the
491
+ # Preferences > Extensions panel, rename your file to have a .rbz file
492
+ # extension.
493
+ #
494
+ # @example
495
+ # path = 'c:/temp/SomePluginPackage.zip'
496
+ # begin
497
+ # Sketchup.install_from_archive(path)
498
+ # rescue Interrupt => error
499
+ # UI.messagebox("User said 'no': " + error)
500
+ # rescue Exception => error
501
+ # UI.messagebox("Error during unzip: " + error)
502
+ # end
503
+ #
504
+ # @param [String] filepath
505
+ # The path to the RBZ or ZIP file to install.
506
+ #
507
+ # @param [Boolean] show_warning
508
+ # Whether to warn the user not to install untrusted extensions.
509
+ # In certain cases the warning can be confusing and redundant, e.g. when
510
+ # automatically updating a trusted extension. When the user has selected
511
+ # the archive themselves, it is best to warn about the possible risks.
512
+ #
513
+ # @raise [Exception] If the archive cannot be installed.
514
+ #
515
+ # @raise [Interrupt] If the user cancel the installation.
516
+ #
517
+ # @raise [Exception] If the archive cannot be found.
518
+ #
519
+ # @return [Boolean]
520
+ #
521
+ # @version SketchUp 8.0 M2
522
+ def self.install_from_archive(filepath, show_warning = true)
523
+ end
524
+
525
+ # This methods indicates whether the host SketchUp application is 64bit.
526
+ # Useful for extensions that ship with binaries and need to determine
527
+ # which versions to load.
528
+ #
529
+ # @example
530
+ # # For backward compatibility, check for the existence of the method
531
+ # # and load 32bit binaries for SketchUp versions that do not have this
532
+ # # method.
533
+ # if Sketchup.respond_to?(:is_64bit?) && Sketchup.is_64bit?
534
+ # # Load 64bit binaries.
535
+ # else
536
+ # # Load 32bit binaries.
537
+ # end
538
+ #
539
+ # @return [Boolean]
540
+ #
541
+ # @version SketchUp 2015
542
+ def self.is_64bit?
543
+ end
544
+
545
+ # The is_online method is used to verify a connection to the Internet. This
546
+ # method can take some time to execute, so be careful not to call it more often
547
+ # than you need.
548
+ #
549
+ # @example
550
+ # status = Sketchup.is_online
551
+ #
552
+ # @return [Boolean] true if successful, false if unsuccessful.
553
+ #
554
+ # @version SketchUp 6.0
555
+ def self.is_online
556
+ end
557
+
558
+ # Returns a boolean flag indicating whether the application is SketchUp Pro.
559
+ #
560
+ # @example
561
+ # if Sketchup.is_pro?
562
+ # UI.messagebox("You are running SU Pro.")
563
+ # end
564
+ #
565
+ # @note In SketchUp Make this method will return +true+ during the Pro trial
566
+ # period and revert to +false+ when the trial period is over.
567
+ #
568
+ # @return [Boolean]
569
+ #
570
+ # @version SketchUp 7.0
571
+ def self.is_pro?
572
+ end
573
+
574
+ # The is_valid_filename? method is used to determine whether a filename
575
+ # contains illegal characters.
576
+ #
577
+ # @example
578
+ # status = Sketchup.is_valid_filename?(filename)
579
+ #
580
+ # @param [String] filename
581
+ # A filename string.
582
+ #
583
+ # @return [Boolean]
584
+ #
585
+ # @version SketchUp 6.0
586
+ def self.is_valid_filename?(filename)
587
+ end
588
+
589
+ # The load method is used to include encrypted and nonencrypted ruby files.
590
+ #
591
+ # You do not need to include the file extension on the path. This method will
592
+ # look for .rb first (unencrypted) and then .rbe (encrypted) and finally .rbs
593
+ # (the deprecated scrambled format) files.
594
+ # See the "Distributing your Plugin" article for details.
595
+ #
596
+ # @example
597
+ # sfile = "application_loader" # file extension not required
598
+ # status = Sketchup.load(sfile)
599
+ #
600
+ # @param [String] path
601
+ # The path, including the filename, to the file you want
602
+ # to require.
603
+ #
604
+ # @return [Boolean] True if the file is included. False if the
605
+ # file is not included.
606
+ #
607
+ # @version SketchUp 6.0
608
+ def self.load(path)
609
+ end
610
+
611
+ # The {.open_file} method is used to open a SketchUp model.
612
+ #
613
+ # @example
614
+ # result = Sketchup.open_file("C:\\model.skp")
615
+ #
616
+ # @overload open_file(filename)
617
+ #
618
+ # @deprecated Prefer +with_status+ overload instead of this variant.
619
+ # @param [String] filename The model file to open.
620
+ # @return [Boolean] +true+ if opening the file succeeded,
621
+ # +false+ otherwise.
622
+ #
623
+ # @overload open_file(filename, with_status: true)
624
+ #
625
+ # Starting with SketchUp 2021.0 SketchUp attempts to load newer SketchUp
626
+ # models. If a newer model is loaded some information might have been skipped
627
+ # and extensions should be careful to not save over the file they loaded from
628
+ # as information might be lost.
629
+ #
630
+ # Success status codes:
631
+ # * {Sketchup::Model::LOAD_STATUS_SUCCESS}
632
+ # * {Sketchup::Model::LOAD_STATUS_SUCCESS_MORE_RECENT}
633
+ #
634
+ # @version SketchUp 2021.0
635
+ # @param [String] filename The model file to open.
636
+ # @return [Integer, false] status code if opening the file succeeded,
637
+ # +false+ otherwise.
638
+ #
639
+ # @version SketchUp 6.0
640
+ def self.open_file(*args)
641
+ end
642
+
643
+ # The os_language method returns the language code for the language SketchUp
644
+ # is running in. This is an alias for the get_locale method.
645
+ #
646
+ # Examples of return values are: en-US, fr, it, de, es, ja, ko, zh-CN, zh-TW,
647
+ # pt-BR, nl, ru and sv. For an up to date list os supported languages, see
648
+ # the SketchUp download page.
649
+ #
650
+ # @example
651
+ # language = Sketchup.os_language
652
+ #
653
+ # @return [String] a code representing the language SketchUp
654
+ # is displaying.
655
+ #
656
+ # @version SketchUp 6.0
657
+ def self.os_language
658
+ end
659
+
660
+ # The parse_length method parses a string as a length.
661
+ #
662
+ # For example, "200" becomes 200.0.
663
+ #
664
+ # @example
665
+ # float = Sketchup.parse_length("2'") # Returns 24 (representing inches)
666
+ # length = float.to_l # Convert to a Length type if needed.
667
+ #
668
+ # @param [String] string
669
+ # The string to be parsed as a number.
670
+ #
671
+ # @return [Float] the numerical representation of the string if
672
+ # successful, or nil if unsuccessful.
673
+ #
674
+ # @version SketchUp 6.0
675
+ def self.parse_length(string)
676
+ end
677
+
678
+ # This methods returns a symbol indicating the current platform.
679
+ #
680
+ # It should be used over RUBY_PLATFORM as this returns a different value for
681
+ # Windows since SketchUp 2014.
682
+ #
683
+ # Older SketchUp versions still need to check
684
+ # <code>RUBY_PLATFORM.include?('mswin')</code> or
685
+ # <code>RUBY_PLATFORM.include?('darwin')</code>.
686
+ #
687
+ # Possible return values:
688
+ # - :platform_win
689
+ # - :platform_osx
690
+ #
691
+ # @example
692
+ # module MyExtension
693
+ # IS_WIN = Sketchup.platform == :platform_win
694
+ # IS_OSX = Sketchup.platform == :platform_osx
695
+ # end
696
+ #
697
+ # @return [Symbol] Current OS platform.
698
+ #
699
+ # @version SketchUp 2014
700
+ def self.platform
701
+ end
702
+
703
+ # The plugins_disabled= method lets you control whether SketchUp will load
704
+ # Ruby scripts from the plugins directory at startup time. This is primarily
705
+ # a trouble-shooting method. If you are having strange behavior in SketchUp
706
+ # that you suspect is from a bad script, you can type
707
+ # Sketchup.plugins_disabled=true into the Ruby console and restart SketchUp
708
+ # to see if the problem is fixed.
709
+ #
710
+ # @example
711
+ # # Type this in the Ruby console then restart SketchUp.
712
+ # Sketchup.plugins_disabled = true
713
+ #
714
+ # # To reactivate plugins, type this into the Ruby console and restart.
715
+ # Sketchup.plugins_disabled = false
716
+ #
717
+ # @param [Boolean] enabled
718
+ # If true, the plugins directory will not load.
719
+ #
720
+ # @return [Boolean] true if plugins were disabled.
721
+ #
722
+ # @version SketchUp 8.0 M2
723
+ def self.plugins_disabled=(enabled)
724
+ end
725
+
726
+ # The plugins_disabled? method indicates whether Ruby scripts in the plugins
727
+ # directory will be loaded at startup time.
728
+ #
729
+ # @example
730
+ # is_disabled = Sketchup.plugins_disabled?
731
+ #
732
+ # @return [Boolean]
733
+ #
734
+ # @version SketchUp 8.0 M2
735
+ def self.plugins_disabled?
736
+ end
737
+
738
+ # The quit method is used to terminate the application. This will pop-up the
739
+ # usual model save prompts if there are unsaved models open. User can cancel
740
+ # the model save, in which case the application will not terminate.
741
+ #
742
+ # @example
743
+ # Sketchup.quit
744
+ # # Do not expect code to execute reliably after this point.
745
+ #
746
+ # @return self
747
+ #
748
+ # @version SketchUp 2014
749
+ def self.quit
750
+ end
751
+
752
+ # The read_default method is used to retrieve the string associated with a
753
+ # value within the specified sub-section section of a .INI file or registry
754
+ # (within the Software > SketchUp > SketchUp [Version] section).
755
+ #
756
+ # @example
757
+ # result = Sketchup.read_default("section", "variable", "default")
758
+ #
759
+ # @param [String] section
760
+ # A section in an .INI or registry.
761
+ #
762
+ # @param [String] variable
763
+ # A variable within the section.
764
+ #
765
+ # @param [Object] default
766
+ # A default value if the value is not found.
767
+ #
768
+ # @return [Object, nil] if unsuccessful, the value of the default
769
+ # if successful.
770
+ #
771
+ # @version SketchUp 6.0
772
+ def self.read_default(section, variable, default = nil)
773
+ end
774
+
775
+ # The redo method is used redo the last transaction on the redo stack.
776
+ #
777
+ # @example
778
+ # Sketchup.redo
779
+ #
780
+ # @return [nil]
781
+ #
782
+ # @version SketchUp 2021.0
783
+ def self.redo
784
+ end
785
+
786
+ # The register_extension method is used to register an extension with
787
+ # SketchUp's extension manager (in SketchUp preferences).
788
+ #
789
+ # @example
790
+ # utilities_extension = SketchupExtension.new("Utilities Tools",
791
+ # "Utilities/utilitiesTools.rb")
792
+ #
793
+ # utilities_extension.description = "Adds Tools->Utilities to the " +
794
+ # "SketchUp inteface. The Utilities submenu contains two tools: " +
795
+ # "Create Face and Query Tool."
796
+ #
797
+ # Sketchup.register_extension(utilities_extension, false)
798
+ #
799
+ # @note It is recommended to set +load_on_start+ to true unless you have a very
800
+ # good reason not to.
801
+ #
802
+ # @param [SketchupExtension] extension
803
+ # A SketchupExtension object.
804
+ #
805
+ # @param [Boolean] load_on_start
806
+ # Passing true into this will load the
807
+ # extension immediately and set it so
808
+ # that it will load automatically
809
+ # whenever SketchUp restarts.
810
+ #
811
+ # @return [Boolean] +true+ if extension registered properly
812
+ #
813
+ # @version SketchUp 6.0
814
+ def self.register_extension(extension, load_on_start = false)
815
+ end
816
+
817
+ # The register_importer method is used to register an importer with SketchUp.
818
+ #
819
+ # @example
820
+ # status = Sketchup.register_importer(importer)
821
+ #
822
+ # @param [Sketchup::Importer] importer
823
+ # An Importer object representing the importer.
824
+ #
825
+ # @return [Boolean] true if successful, false if unsuccessful.
826
+ #
827
+ # @version SketchUp 6.0
828
+ def self.register_importer(importer)
829
+ end
830
+
831
+ # The remove_observer method is used to remove an observer from the current
832
+ # object.
833
+ #
834
+ # @example
835
+ # status = Sketchup.remove_observer(observer)
836
+ #
837
+ # @param [Sketchup::AppObserver] observer
838
+ # An observer.
839
+ #
840
+ # @return [Boolean] true if successful, false if unsuccessful.
841
+ #
842
+ # @version SketchUp 6.0
843
+ def self.remove_observer(observer)
844
+ end
845
+
846
+ # The require method is used to include encrypted and nonencrypted ruby files.
847
+ # This is an alias of the Sketchup.load method.
848
+ #
849
+ # You do not need to include the file extension on the path. This method will
850
+ # look for .rbe first (encrypted) and then .rbs (the deprecated scrambled
851
+ # format) and finally .rb (unencrypted) files. The loading order was changed
852
+ # in SketchUp 2016 when the new .rbe encryption was introduced. Prior to
853
+ # SketchUp 2016 the loading order was first .rb then .rbs.
854
+ #
855
+ # @example
856
+ # sfile = "application_loader" # file extension not required
857
+ # status = Sketchup::require(sfile)
858
+ #
859
+ # @param [String] path
860
+ # The path, including the filename, to the file you want
861
+ # to require.
862
+ #
863
+ # @return [Boolean] True if the file is included. False if the
864
+ # file is not included.
865
+ #
866
+ # @version SketchUp 6.0
867
+ def self.require(path)
868
+ end
869
+
870
+ # The save_thumbnail method is used to generate a thumbnail for any SKP file -
871
+ # not necessarily the loaded model.
872
+ #
873
+ # @example
874
+ # status = Sketchup.save_thumbnail("skp_filename", "image_filename")
875
+ #
876
+ # @param [String] skp_filename
877
+ # The name of the SketchUp file whose model you want
878
+ # represented in the thumbnail.
879
+ #
880
+ # @param [String] img_filename
881
+ # The name of the file where the thumbnail will be saved.
882
+ #
883
+ # @return [Boolean] true if successful, false if unsuccessful.
884
+ #
885
+ # @version SketchUp 6.0
886
+ def self.save_thumbnail(skp_filename, img_filename)
887
+ end
888
+
889
+ # The send_action method sends a message to the message queue to perform some
890
+ # action asynchronously.
891
+ #
892
+ # Valid actions are:
893
+ # - showRubyPanel:
894
+ # - viewBack:
895
+ # - viewBottom:
896
+ # - viewFront:
897
+ # - viewIso:
898
+ # - viewLeft:
899
+ # - viewRight:
900
+ # - viewTop:
901
+ # - viewPerspective:
902
+ # - viewShowAxes:
903
+ # - viewShowHidden:
904
+ # - viewZoomExtents:
905
+ # - viewZoomToSelection:
906
+ # - viewUndo:
907
+ # - selectOrbitTool:
908
+ # - selectPositionCameraTool:
909
+ # - selectDollyTool:
910
+ # - selectTurnTool:
911
+ # - selectWalkTool:
912
+ # - selectZoomTool:
913
+ # - selectFieldOfViewTool:
914
+ # - selectZoomWindowTool:
915
+ # - pageAdd:
916
+ # - pageDelete:
917
+ # - pageUpdate:
918
+ # - pageNext:
919
+ # - pagePrevious:
920
+ # - renderWireframe:
921
+ # - renderHiddenLine:
922
+ # - renderMonochrome:
923
+ # - renderShaded:
924
+ # - renderTextures:
925
+ # - selectArcTool:
926
+ # - selectArc3PointTool:
927
+ # - selectArc3PointPieTool:
928
+ # - selectAxisTool:
929
+ # - selectCircleTool:
930
+ # - selectEraseTool:
931
+ # - selectFreehandTool:
932
+ # - selectLineTool:
933
+ # - selectMeasureTool:
934
+ # - selectMoveTool:
935
+ # - selectOffsetTool:
936
+ # - selectPaintTool:
937
+ # - selectPolygonTool:
938
+ # - selectProtractorTool:
939
+ # - selectPushPullTool:
940
+ # - selectRectangleTool:
941
+ # - selectRectangle3PointTool:
942
+ # - selectRotateTool:
943
+ # - selectScaleTool:
944
+ # - selectSectionPlaneTool:
945
+ # - selectTextTool:
946
+ # - selectDimensionTool:
947
+ # - selectExtrudeTool:
948
+ # - selectSelectionTool:
949
+ # - editUndo:
950
+ # - editRedo:
951
+ # - editHide:
952
+ # - editUnhide:
953
+ # - fixNonPlanarFaces:
954
+ #
955
+ # Added in SketchUp 8.0+:
956
+ # - addBuilding:
957
+ # - getPhotoTexture:
958
+ # - selectImageIglooTool:
959
+ # - selectNorthTool:
960
+ #
961
+ # Added in SketchUp 2013+:
962
+ # - showExtensionStore:
963
+ #
964
+ # Removed in SketchUp 2013+:
965
+ # - addBuilding:
966
+ #
967
+ # On the PC only, you can also send these numeric values. (Note that these are
968
+ # officially "unsupported" and are not guaranteed to work in current or
969
+ # future versions of the API.)
970
+ #
971
+ # - 10501: set view to Top
972
+ # - 10502: set view to Front
973
+ # - 10503: set view to Rear
974
+ # - 10504: set view to Left
975
+ # - 10505: set view to Right
976
+ # - 10506: set view to Bottom
977
+ # - 10507: set view to Axonometric
978
+ # - 10510: set render mode to Wire
979
+ # - 10511: set render mode to Hidden lines removal
980
+ # - 10512: set render mode to Surfaces Shading
981
+ # - 10513: set render mode to Transparency
982
+ # - 10519: set camera to ortho (removes perspective)
983
+ # - 10520: walk tool
984
+ # - 10521: display the System Preferences dialog box (Files tab)
985
+ # - 10522: removes axes display
986
+ # - 10523: pan tool
987
+ # - 10525: set the interactive eye height feature
988
+ # - 10526: zoom window
989
+ # - 10527: zoom extents
990
+ # - 10529: zoom out 2
991
+ # - 10531: toggle the Standard toolbar
992
+ # - 10532: toggle the Camera toolbar
993
+ # - 10533: display the Shadows Settings dialog box
994
+ # - 10537: toggle the Views toolbar
995
+ # - 10538: display the System Preferences dialog box (Display tab)
996
+ # - 10545: toggle Color ByLayer
997
+ # - 10546: toggle Shadows toolbar
998
+ # - 10551: toogle Large icons
999
+ # - 10576: toggle Render Mode toolbar
1000
+ # - 10596: set Render Mode to No Transparency (Preferences)
1001
+ # - 10597: set Render Mode to Wire (Preferences)
1002
+ # - 10598: set Render Mode to Transparency (Preferences)
1003
+ # - 10599: set Render Mode to Surfaces Shading (Preferences)
1004
+ # - 10600: set Render Mode to Texture (Preferences)
1005
+ # - 10601: set Render Mode to No Texture (Preferences)
1006
+ # - 10602: toggle Shadows
1007
+ # - 10603: toggle Profiles
1008
+ # - 10604: toggle Extension Lines
1009
+ # - 10605: toggle Jitter edges
1010
+ # - 21019: hide Status bar and VCB
1011
+ # - 21020: show Status bar and VCB
1012
+ # - 21022: hide Status bar and VCB
1013
+ # - 21023: place 3d text box
1014
+ # - 21024: select the Measure tool
1015
+ # - 21031: select the Freehand Draw tool
1016
+ # - 21041: select the PushPull tool
1017
+ # - 21048: select the Move tool
1018
+ # - 21052: hide selected objects
1019
+ # - 21056: create face with selected edges closed loop
1020
+ # - 21057: select the Protractor tool
1021
+ # - 21060: display Components Window
1022
+ # - 21061: toggle Draw toolbar
1023
+ # - 21063: toggle Model Bounding Box display
1024
+ # - 21065: select the Arc tool
1025
+ # - 21067: creat a new Page
1026
+ # - 21069: select the Arc 3 Point tool
1027
+ # - 21070: select the Arc 3 Point Pie tool
1028
+ # - 21074: show the Materials Browser Window
1029
+ # - 21076: display the Preferences dialog box (Text activated)
1030
+ # - 21077: display the Tip of the day Window
1031
+ # - 21078: select the Paint Bucket tool
1032
+ # - 21080: display the Page Manager Window
1033
+ # - 21082: display the Macros Dialog Box
1034
+ # - 21086: display the Components Browser Window
1035
+ # - 21094: select the Rectangle tool
1036
+ # - 21095: select the Polygon tool
1037
+ # - 21096: select the Circle tool
1038
+ # - 21098: open the Open Window
1039
+ # - 21100: select the Offset tool
1040
+ # - 21101: select all objects
1041
+ # - 21107: invert selection
1042
+ # - 21112: open the Import Window
1043
+ # - 21124: launch the validity check tool
1044
+ # - 21126: select the Axes tool
1045
+ # - 21029: select the Rotate tool
1046
+ # - 21032: toggle Layer toolbar
1047
+ # - 21036: display the Save as Window
1048
+ # - 21046: spin the model a full 360&deg; and display report
1049
+ # - 21047: fast Pick Time report
1050
+ # - 21049: open the Export model Window
1051
+ # - 21169: select the Position Camera tool
1052
+ # - 21170: display the Preferences, Tour Guide activated
1053
+ # - 21180: create a new Page just right of selected page
1054
+ # - 21200: display the Insert Image Window
1055
+ # - 21233: display Area of selected face
1056
+ # - 21234: display Area of all faces with selected material
1057
+ # - 21236: select the Scale tool
1058
+ # - 21237: display the Export 2D Graphics Window
1059
+ # - 21245: display a Polygon Offset Factors dialog box
1060
+ # - 21276: reverse selected face(s)
1061
+ # - 21287: select the Divide feature
1062
+ # - 21337: select the Section Plane Placement tool
1063
+ # - 21354: open the Layer Window
1064
+ # - 21386: open the Export Animation Window
1065
+ # - 21405: select the Text tool
1066
+ # - 21406: display Fog dialog box
1067
+ # - 21410: select the Dim tool
1068
+ # - 21433: toggle Edit toolbar
1069
+ # - 21442: select the FollowMe tool
1070
+ # - 21448: select the Axes tool
1071
+ # - 21453: select all objects
1072
+ # - 21460: display Licence
1073
+ # - 21462: display Authorization dialog box
1074
+ # - 21463: display un-authorizing message
1075
+ # - 21464: display Open Licence files (Network) Window
1076
+ # - 21466: display Quick reference Card in Adobe Reader
1077
+ # - 21467: display Licences in use dialog box
1078
+ # - 21469: zoom extents to selected objects
1079
+ # - 21476: perform a non-planar check on selected objects
1080
+ # - 21477: list accelerators in window
1081
+ # - 21485: erase selected objects
1082
+ # - 21487: display Edit current material dialog box
1083
+ # - 21485: erase all new created pages
1084
+ # - 21488: display Entity Info Window
1085
+ # - 21490: display Soften Edges Window
1086
+ # - 21491: display Profiles
1087
+ # - 21492: display Extended Edges
1088
+ # - 21493: display Jitter Lines
1089
+ # - 21494: select Field of view tool
1090
+ # - 21513: display the outliner
1091
+ # - 21520: override Tile Rendering Size dialog box
1092
+ # - 21525: select the FollowMe tool
1093
+ # - 21542: display the Insert Image Window
1094
+ # - 21560 and up: causes a runtime Error
1095
+ #
1096
+ # @example
1097
+ # result = Sketchup.send_action("selectArcTool:")
1098
+ #
1099
+ # @param [String, Integer] action
1100
+ # The action to be performed.
1101
+ #
1102
+ # @return [Boolean] +true+ if successful, +false+ if unsuccessful
1103
+ #
1104
+ # @version SketchUp 6.0
1105
+ def self.send_action(action)
1106
+ end
1107
+
1108
+ # The {.send_to_layout} method is used to open a file in LayOut.
1109
+ #
1110
+ # @example
1111
+ # result = Sketchup.send_to_layout("C:/models/hexaflexagon.layout")
1112
+ #
1113
+ # @param [String] file
1114
+ # The path and filename to open, either .skp or .layout.
1115
+ #
1116
+ # @return [Boolean] true if opening the file succeeded,
1117
+ # false otherwise. If LayOut is not installed or the file is not present
1118
+ # this function will return false.
1119
+ #
1120
+ # @version SketchUp 2018
1121
+ def self.send_to_layout(file)
1122
+ end
1123
+
1124
+ # The set_status_text method is used to
1125
+ # set the text appearing on the status bar within the drawing window.
1126
+ #
1127
+ # If no arguments are passed, the status bar content is cleared. Valid
1128
+ # positions are:
1129
+ #
1130
+ # - +SB_PROMPT+ - the text will appear at the left-side of the status bar
1131
+ # - +SB_VCB_LABEL+ - the text will appear in place of the VCB label
1132
+ # - +SB_VCB_VALUE+ - the text will appear in the VCB
1133
+ #
1134
+ # @example
1135
+ # result = Sketchup.set_status_text("This is a Test", SB_VCB_VALUE)
1136
+ # if result
1137
+ # #code to do something if set_status_text is successful
1138
+ # end
1139
+ #
1140
+ # @overload set_status_text
1141
+ #
1142
+ # Clears all status panes.
1143
+ # @return [nil]
1144
+ #
1145
+ # @overload set_status_text(status_text = '', position = SB_PROMPT)
1146
+ #
1147
+ # @param [String] status text the status text that will appear.
1148
+ # @param [Integer] position the position where the text will appear.
1149
+ # @return [nil]
1150
+ #
1151
+ # @version SketchUp 6.0
1152
+ def self.set_status_text(*args)
1153
+ end
1154
+
1155
+ # The status_text= method is used to set the text appearing on the status
1156
+ # bar within the drawing window.
1157
+ #
1158
+ # This is the same as calling set_status_text with a 2nd parameter of
1159
+ # SB_PROMPT.
1160
+ #
1161
+ # @example
1162
+ # result = Sketchup.status_text = "This is a Test"
1163
+ #
1164
+ # @param [String] status_text
1165
+ # The status text that will appear.
1166
+ #
1167
+ # @return [String]
1168
+ #
1169
+ # @version SketchUp 6.0
1170
+ def self.status_text=(status_text)
1171
+ end
1172
+
1173
+ # The temp_dir method is used to retrieve the OS temporary directory for the
1174
+ # current user. You can use this directory to write temporary files that are
1175
+ # not required to persist between SketchUp sessions.
1176
+ #
1177
+ # @example
1178
+ # temp_dir = Sketchup.temp_dir
1179
+ #
1180
+ # @return [String] a string containing the full temporary directory path
1181
+ #
1182
+ # @version SketchUp 2014
1183
+ def self.temp_dir
1184
+ end
1185
+
1186
+ # The template method is used to get the file name of the current template.
1187
+ # Templates are the .skp files that are loaded when the user select File > New.
1188
+ #
1189
+ # @example
1190
+ # name = Sketchup.template
1191
+ #
1192
+ # @return [String] the current template
1193
+ #
1194
+ # @version SketchUp 6.0
1195
+ def self.template
1196
+ end
1197
+
1198
+ # The template= method is used to set the file name of the current template.
1199
+ # Templates are the .skp files that are loaded when the user select File > New.
1200
+ #
1201
+ # @example
1202
+ # status = Sketchup.template = "filename"
1203
+ #
1204
+ # @param [String] filename
1205
+ # The name of the template to set.
1206
+ #
1207
+ # @return [String] true if successful, false if unsuccessful.
1208
+ #
1209
+ # @version SketchUp 6.0
1210
+ def self.template=(filename)
1211
+ end
1212
+
1213
+ # The template_dir is used to retrieve the directory where templates are
1214
+ # stored by the SketchUp install. Templates are the .skp files that are loaded
1215
+ # when the user select File > New.
1216
+ #
1217
+ # @example
1218
+ # directory = Sketchup.template_dir
1219
+ #
1220
+ # @return [String] containing the full template directory path
1221
+ #
1222
+ # @version SketchUp 6.0
1223
+ def self.template_dir
1224
+ end
1225
+
1226
+ # The undo method is used undo the last transaction on the undo stack.
1227
+ #
1228
+ # @example
1229
+ # Sketchup.undo
1230
+ #
1231
+ # @return [nil]
1232
+ #
1233
+ # @version SketchUp 6.0
1234
+ def self.undo
1235
+ end
1236
+
1237
+ # The vcb_label= method is used to set the label that appears on the vcb,
1238
+ # or the "value control box", which is another word for the "measurements"
1239
+ # text entry box that appears at the bottom on the SketchUp window.
1240
+ #
1241
+ # This is the same as calling set_status_text with a 2nd parameter of
1242
+ # SB_VCB_LABEL.
1243
+ #
1244
+ # @example
1245
+ # result = Sketchup.vcb_label = "This is a Test"
1246
+ #
1247
+ # @param [String] label_text
1248
+ # The label text that will appear.
1249
+ #
1250
+ # @return [String]
1251
+ #
1252
+ # @version SketchUp 6.0
1253
+ def self.vcb_label=(label_text)
1254
+ end
1255
+
1256
+ # The vcb_value= method is used to set the value that appears on the vcb,
1257
+ # or the "value control box", which is another word for the "measurements"
1258
+ # text entry box that appears at the bottom on the SketchUp window.
1259
+ #
1260
+ # This is the same as calling set_status_text with a 2nd parameter of
1261
+ # SB_VCB_VALUE.
1262
+ #
1263
+ # @example
1264
+ # result = Sketchup.vcb_value = "This is a Test"
1265
+ #
1266
+ # @param [String] value
1267
+ # The text that will appear as the vcb's value.
1268
+ #
1269
+ # @return [String]
1270
+ #
1271
+ # @version SketchUp 6.0
1272
+ def self.vcb_value=(value)
1273
+ end
1274
+
1275
+ # Gets the current version of sketchup in decimal form.
1276
+ #
1277
+ # @example
1278
+ # version = Sketchup.version
1279
+ # if (version)
1280
+ # UI.messagebox version
1281
+ # else
1282
+ # return
1283
+ # end
1284
+ #
1285
+ # @return [String] the decimal form of the version
1286
+ #
1287
+ # @version SketchUp 6.0
1288
+ def self.version
1289
+ end
1290
+
1291
+ # Get the current version of sketchup as a whole number for comparisons. The
1292
+ # number returned has the major, minor, and build values packed into an integer
1293
+ # value as follows:
1294
+ # - Major version = X
1295
+ # - Minor version = Y
1296
+ # - Build number = Z
1297
+ #
1298
+ # SketchUp 6.0 - SketchUp 2015
1299
+ # - XXYYYZZZ
1300
+ #
1301
+ # SketchUp 2016+
1302
+ # - XXYZZZZZZZ
1303
+ #
1304
+ # @example
1305
+ # if (15003000...15004000) === Sketchup.version_number
1306
+ # puts "SketchUp 15.3"
1307
+ # end
1308
+ # if Sketchup.version_number >= 1600000000
1309
+ # puts "New format"
1310
+ # end
1311
+ #
1312
+ # @return [Integer] the whole number form of the version
1313
+ #
1314
+ # @version SketchUp 6.0
1315
+ def self.version_number(*args)
1316
+ end
1317
+
1318
+ # The write_default method is used to set the string associated with a
1319
+ # variable within the specified sub-section of a .plist file on the Mac
1320
+ # or the registry on Windows
1321
+ # (within the Software > SketchUp > SketchUp [Version] section).
1322
+ #
1323
+ # @example
1324
+ # result = Sketchup.write_default("section", "key", "my_value")
1325
+ #
1326
+ # @param [String] section
1327
+ # A section in a .plist file (Mac) or the registry
1328
+ # (Windows).
1329
+ #
1330
+ # @param [String] key
1331
+ # A key within the section.
1332
+ #
1333
+ # @param [Object] value
1334
+ # The value to store.
1335
+ #
1336
+ # @return [Boolean] True if successful, false if unsuccessful.
1337
+ #
1338
+ # @version SketchUp 6.0
1339
+ def self.write_default(section, key, value)
1340
+ end
1341
+
1342
+ end