sketchup-api-stubs 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/SketchUp/Geom/BoundingBox.rb +17 -20
- data/SketchUp/Geom/Bounds2d.rb +172 -0
- data/SketchUp/Geom/LatLong.rb +31 -16
- data/SketchUp/Geom/OrientedBounds2d.rb +102 -0
- data/SketchUp/Geom/Point2d.rb +365 -0
- data/SketchUp/Geom/Point3d.rb +121 -110
- data/SketchUp/Geom/PolygonMesh.rb +30 -21
- data/SketchUp/Geom/Transformation.rb +8 -4
- data/SketchUp/Geom/Transformation2d.rb +125 -0
- data/SketchUp/Geom/UTM.rb +43 -37
- data/SketchUp/Geom/Vector2d.rb +497 -0
- data/SketchUp/Geom/Vector3d.rb +143 -131
- data/SketchUp/Layout.rb +25 -0
- data/SketchUp/Layout/AngularDimension.rb +569 -0
- data/SketchUp/Layout/AutoTextDefinition.rb +417 -0
- data/SketchUp/Layout/AutoTextDefinitions.rb +186 -0
- data/SketchUp/Layout/ConnectionPoint.rb +70 -0
- data/SketchUp/Layout/Document.rb +458 -0
- data/SketchUp/Layout/Ellipse.rb +29 -0
- data/SketchUp/Layout/Entities.rb +155 -0
- data/SketchUp/Layout/Entity.rb +363 -0
- data/SketchUp/Layout/FormattedText.rb +349 -0
- data/SketchUp/Layout/Grid.rb +131 -0
- data/SketchUp/Layout/Group.rb +261 -0
- data/SketchUp/Layout/Image.rb +86 -0
- data/SketchUp/Layout/Label.rb +371 -0
- data/SketchUp/Layout/Layer.rb +222 -0
- data/SketchUp/Layout/LayerInstance.rb +128 -0
- data/SketchUp/Layout/Layers.rb +232 -0
- data/SketchUp/Layout/LinearDimension.rb +563 -0
- data/SketchUp/Layout/LockedEntityError.rb +10 -0
- data/SketchUp/Layout/LockedLayerError.rb +11 -0
- data/SketchUp/Layout/Page.rb +187 -0
- data/SketchUp/Layout/PageInfo.rb +393 -0
- data/SketchUp/Layout/Pages.rb +216 -0
- data/SketchUp/Layout/Path.rb +326 -0
- data/SketchUp/Layout/Rectangle.rb +174 -0
- data/SketchUp/Layout/SketchUpModel.rb +522 -0
- data/SketchUp/Layout/Style.rb +1520 -0
- data/SketchUp/Layout/Table.rb +290 -0
- data/SketchUp/Layout/TableCell.rb +149 -0
- data/SketchUp/Layout/TableColumn.rb +139 -0
- data/SketchUp/Layout/TableRow.rb +135 -0
- data/SketchUp/Sketchup/Animation.rb +7 -4
- data/SketchUp/Sketchup/ArcCurve.rb +10 -10
- data/SketchUp/Sketchup/AttributeDictionaries.rb +13 -4
- data/SketchUp/Sketchup/AttributeDictionary.rb +12 -12
- data/SketchUp/Sketchup/Color.rb +68 -78
- data/SketchUp/Sketchup/ComponentDefinition.rb +60 -60
- data/SketchUp/Sketchup/ComponentInstance.rb +57 -55
- data/SketchUp/Sketchup/DefinitionList.rb +34 -17
- data/SketchUp/Sketchup/Drawingelement.rb +19 -21
- data/SketchUp/Sketchup/Edge.rb +22 -24
- data/SketchUp/Sketchup/Entities.rb +173 -162
- data/SketchUp/Sketchup/Entity.rb +71 -55
- data/SketchUp/Sketchup/Face.rb +45 -44
- data/SketchUp/Sketchup/Group.rb +47 -49
- data/SketchUp/Sketchup/Image.rb +16 -0
- data/SketchUp/Sketchup/ImageRep.rb +226 -0
- data/SketchUp/Sketchup/InstancePath.rb +13 -13
- data/SketchUp/Sketchup/Layer.rb +15 -17
- data/SketchUp/Sketchup/Material.rb +40 -30
- data/SketchUp/Sketchup/Materials.rb +40 -22
- data/SketchUp/Sketchup/Menu.rb +5 -5
- data/SketchUp/Sketchup/Model.rb +230 -228
- data/SketchUp/Sketchup/Page.rb +32 -0
- data/SketchUp/Sketchup/Pages.rb +3 -4
- data/SketchUp/Sketchup/RenderingOptions.rb +21 -16
- data/SketchUp/Sketchup/SectionPlane.rb +64 -0
- data/SketchUp/Sketchup/Selection.rb +20 -28
- data/SketchUp/Sketchup/ShadowInfo.rb +14 -14
- data/SketchUp/Sketchup/Text.rb +24 -26
- data/SketchUp/Sketchup/Texture.rb +28 -12
- data/SketchUp/Sketchup/Vertex.rb +14 -11
- data/SketchUp/Sketchup/View.rb +126 -116
- data/SketchUp/UI/Command.rb +17 -17
- data/SketchUp/UI/HtmlDialog.rb +8 -5
- data/SketchUp/UI/Notification.rb +1 -1
- data/SketchUp/UI/Toolbar.rb +13 -14
- data/SketchUp/UI/WebDialog.rb +55 -59
- data/SketchUp/_top_level.rb +139 -27
- data/SketchUp/{Array.rb → array.rb} +167 -30
- data/SketchUp/{Geom.rb → geom.rb} +9 -7
- data/SketchUp/{LanguageHandler.rb → languagehandler.rb} +15 -15
- data/SketchUp/{Length.rb → length.rb} +15 -15
- data/SketchUp/{Numeric.rb → numeric.rb} +19 -19
- data/SketchUp/sketchup.rb +167 -156
- data/SketchUp/{SketchupExtension.rb → sketchupextension.rb} +27 -27
- data/SketchUp/{String.rb → string.rb} +1 -1
- data/SketchUp/ui.rb +113 -87
- metadata +46 -9
@@ -32,6 +32,8 @@ module Geom
|
|
32
32
|
# The {.closest_points} method is used to compute the closest points on two
|
33
33
|
# lines.
|
34
34
|
#
|
35
|
+
# line.
|
36
|
+
#
|
35
37
|
# @example
|
36
38
|
# line1 = [Geom::Point3d.new(0, 2, 0), Geom::Vector3d.new(1, 0, 0)]
|
37
39
|
# line2 = [Geom::Point3d.new(3, 0, 0), Geom::Vector3d.new(0, 1, 0)]
|
@@ -47,7 +49,7 @@ module Geom
|
|
47
49
|
# intersect
|
48
50
|
#
|
49
51
|
# @return [Array(Geom::Point3d, Geom::Point3d)] An array of two points. The
|
50
|
-
# first point is on the first line and the second point is on the second
|
52
|
+
# first point is on the first line and the second point is on the second
|
51
53
|
#
|
52
54
|
# @version SketchUp 6.0
|
53
55
|
def self.closest_points(line1, line2)
|
@@ -136,8 +138,8 @@ module Geom
|
|
136
138
|
def self.intersect_line_plane(line, plane)
|
137
139
|
end
|
138
140
|
|
139
|
-
# The {.intersect_plane_plane} method is used to compute the intersection of
|
140
|
-
# planes.
|
141
|
+
# The {.intersect_plane_plane} method is used to compute the intersection of
|
142
|
+
# two planes.
|
141
143
|
#
|
142
144
|
# @example
|
143
145
|
# # Defines a plane with it's normal parallel to the x axis.
|
@@ -174,17 +176,17 @@ module Geom
|
|
174
176
|
#
|
175
177
|
# @overload linear_combination(weight1, point1, weight2, point2)
|
176
178
|
#
|
177
|
-
# @param [Float] weight1
|
179
|
+
# @param [Float] weight1
|
178
180
|
# @param [Geom::Point3d] point1
|
179
|
-
# @param [Float] weight2
|
181
|
+
# @param [Float] weight2
|
180
182
|
# @param [Geom::Point3d] point2
|
181
183
|
# @return [Geom::Point3d]
|
182
184
|
#
|
183
185
|
# @overload linear_combination(weight1, vector1, weight2, vector2)
|
184
186
|
#
|
185
|
-
# @param [Float] weight1
|
187
|
+
# @param [Float] weight1
|
186
188
|
# @param [Geom::Vector3d] vector1
|
187
|
-
# @param [Float] weight2
|
189
|
+
# @param [Float] weight2
|
188
190
|
# @param [Geom::Vector3d] vector2
|
189
191
|
# @return [Geom::Vector3d]
|
190
192
|
#
|
@@ -10,10 +10,10 @@
|
|
10
10
|
#
|
11
11
|
# @example Example code that uses LanguageHandler:
|
12
12
|
# # Create a global language handler object
|
13
|
-
#
|
13
|
+
# swiveldriver_lang_handler = LanguageHandler.new('swiveldriver.strings')
|
14
14
|
#
|
15
15
|
# # Get localized string
|
16
|
-
# localizedStr =
|
16
|
+
# localizedStr = swiveldriver_lang_handler.GetString('String 1')
|
17
17
|
#
|
18
18
|
# @example
|
19
19
|
# "String 1"="Localized String 1";
|
@@ -37,13 +37,13 @@ class LanguageHandler
|
|
37
37
|
# in the Resources folder.
|
38
38
|
#
|
39
39
|
# @example
|
40
|
-
#
|
41
|
-
# localized_string =
|
40
|
+
# swiveldriver_lang_handler = LanguageHandler.new('swiveldriver.strings')
|
41
|
+
# localized_string = swiveldriver_lang_handler['String 1']
|
42
42
|
#
|
43
|
-
# @param key
|
43
|
+
# @param [String] key
|
44
44
|
# The key for the string to be retrieved.
|
45
45
|
#
|
46
|
-
# @return the localized string.
|
46
|
+
# @return [String] the localized string.
|
47
47
|
#
|
48
48
|
# @version SketchUp 2014
|
49
49
|
def [](key)
|
@@ -52,13 +52,13 @@ class LanguageHandler
|
|
52
52
|
# The new method is used to create a new LanguageHandler object.
|
53
53
|
#
|
54
54
|
# @example
|
55
|
-
#
|
55
|
+
# swiveldriver_lang_handler = LanguageHandler.new('swiveldriver.strings')
|
56
56
|
#
|
57
|
-
# @param filename
|
57
|
+
# @param [String] filename
|
58
58
|
# The name of the file that contains the localized strings
|
59
59
|
# with their keys in UTF-8 encoding.
|
60
60
|
#
|
61
|
-
# @return the new LanguageHandler object
|
61
|
+
# @return [LanguageHandler] the new LanguageHandler object
|
62
62
|
#
|
63
63
|
# @version SketchUp 2014
|
64
64
|
def initialize(filename)
|
@@ -68,10 +68,10 @@ class LanguageHandler
|
|
68
68
|
# in the Resources folder.
|
69
69
|
#
|
70
70
|
# @example
|
71
|
-
#
|
72
|
-
# image =
|
71
|
+
# swiveldriver_lang_handler = LanguageHandler.new('swiveldriver.strings')
|
72
|
+
# image = swiveldriver_lang_handler.resource_path('fancy_image.png')
|
73
73
|
#
|
74
|
-
# @return
|
74
|
+
# @return [String] the location of the file in the Resources folder.
|
75
75
|
#
|
76
76
|
# @version SketchUp 2014
|
77
77
|
def resource_path
|
@@ -80,10 +80,10 @@ class LanguageHandler
|
|
80
80
|
# Returns a Hash object containing the localization dictionary.
|
81
81
|
#
|
82
82
|
# @example
|
83
|
-
#
|
84
|
-
# hash =
|
83
|
+
# swiveldriver_lang_handler = LanguageHandler.new('swiveldriver.strings')
|
84
|
+
# hash = swiveldriver_lang_handler.strings
|
85
85
|
#
|
86
|
-
# @return
|
86
|
+
# @return [Hash] the localization dictionary.
|
87
87
|
#
|
88
88
|
# @version SketchUp 2014
|
89
89
|
def strings
|
@@ -47,10 +47,10 @@ class Length < Float
|
|
47
47
|
# puts "length1 is not less than length2"
|
48
48
|
# end
|
49
49
|
#
|
50
|
-
# @param length2
|
50
|
+
# @param [Length] length2
|
51
51
|
# A length value.
|
52
52
|
#
|
53
|
-
# @return
|
53
|
+
# @return [Boolean] true if length1 is < length2; false if
|
54
54
|
# length1 is not < length2
|
55
55
|
#
|
56
56
|
# @version SketchUp 6.0
|
@@ -69,10 +69,10 @@ class Length < Float
|
|
69
69
|
# puts "length1 is greater than length2"
|
70
70
|
# end
|
71
71
|
#
|
72
|
-
# @param length2
|
72
|
+
# @param [Length] length2
|
73
73
|
# A length value.
|
74
74
|
#
|
75
|
-
# @return
|
75
|
+
# @return [Boolean] true if length1 is <= length2; false if
|
76
76
|
# length1 is not <= length2
|
77
77
|
#
|
78
78
|
# @version SketchUp 6.0
|
@@ -88,10 +88,10 @@ class Length < Float
|
|
88
88
|
# length2 = 30.to_l
|
89
89
|
# result = length1 <=> length2
|
90
90
|
#
|
91
|
-
# @param length2
|
91
|
+
# @param [Length] length2
|
92
92
|
# A length value.
|
93
93
|
#
|
94
|
-
# @return
|
94
|
+
# @return [Integer] the result of the comparison
|
95
95
|
#
|
96
96
|
# @version SketchUp 6.0
|
97
97
|
def <=>(length2)
|
@@ -107,10 +107,10 @@ class Length < Float
|
|
107
107
|
# length2 = 30.to_l
|
108
108
|
# is_equal = length1 == length2
|
109
109
|
#
|
110
|
-
# @param length2
|
110
|
+
# @param [Length] length2
|
111
111
|
# A length value.
|
112
112
|
#
|
113
|
-
# @return
|
113
|
+
# @return [Boolean] true if length1 is == length2; false if
|
114
114
|
# length1 is not == length2
|
115
115
|
#
|
116
116
|
# @version SketchUp 6.0
|
@@ -131,10 +131,10 @@ class Length < Float
|
|
131
131
|
# puts "length1 is not greater than length2"
|
132
132
|
# end
|
133
133
|
#
|
134
|
-
# @param length2
|
134
|
+
# @param [Length] length2
|
135
135
|
# A length value.
|
136
136
|
#
|
137
|
-
# @return
|
137
|
+
# @return [Boolean] true if length1 is > length2; false if length1
|
138
138
|
# is not > length2
|
139
139
|
#
|
140
140
|
# @version SketchUp 6.0
|
@@ -156,10 +156,10 @@ class Length < Float
|
|
156
156
|
# puts "length1 is less than length2"
|
157
157
|
# end
|
158
158
|
#
|
159
|
-
# @param length2
|
159
|
+
# @param [Length] length2
|
160
160
|
# A length value.
|
161
161
|
#
|
162
|
-
# @return
|
162
|
+
# @return [Boolean] true if length1 is >= length2; false if
|
163
163
|
# length1 is not >= length2
|
164
164
|
#
|
165
165
|
# @version SketchUp 6.0
|
@@ -175,7 +175,7 @@ class Length < Float
|
|
175
175
|
# length = 55.to_l
|
176
176
|
# str = length.inspect
|
177
177
|
#
|
178
|
-
# @return
|
178
|
+
# @return [String] an unformatted length string
|
179
179
|
#
|
180
180
|
# @version SketchUp 6.0
|
181
181
|
def inspect
|
@@ -187,7 +187,7 @@ class Length < Float
|
|
187
187
|
# length = 45.to_l
|
188
188
|
# f = length.to_f
|
189
189
|
#
|
190
|
-
# @return
|
190
|
+
# @return [Float] the float length value
|
191
191
|
#
|
192
192
|
# @version SketchUp 6.0
|
193
193
|
def to_f
|
@@ -201,7 +201,7 @@ class Length < Float
|
|
201
201
|
# length = 55.to_l
|
202
202
|
# str = length.to_s
|
203
203
|
#
|
204
|
-
# @return
|
204
|
+
# @return [String] the float length value
|
205
205
|
#
|
206
206
|
# @version SketchUp 6.0
|
207
207
|
def to_s
|
@@ -15,7 +15,7 @@ class Numeric
|
|
15
15
|
# cm = 10
|
16
16
|
# inches = cm.cm
|
17
17
|
#
|
18
|
-
# @return
|
18
|
+
# @return [Length] a value in inches if successful
|
19
19
|
#
|
20
20
|
# @version SketchUp 6.0
|
21
21
|
def cm
|
@@ -29,7 +29,7 @@ class Numeric
|
|
29
29
|
# degrees = 90
|
30
30
|
# radians = degrees.degrees
|
31
31
|
#
|
32
|
-
# @return
|
32
|
+
# @return [Float] a value in radians if successful
|
33
33
|
#
|
34
34
|
# @version SketchUp 6.0
|
35
35
|
def degrees
|
@@ -41,7 +41,7 @@ class Numeric
|
|
41
41
|
# feet = 1
|
42
42
|
# inches = feet.feet
|
43
43
|
#
|
44
|
-
# @return
|
44
|
+
# @return [Length] a value in inches if successful
|
45
45
|
#
|
46
46
|
# @version SketchUp 6.0
|
47
47
|
def feet
|
@@ -53,7 +53,7 @@ class Numeric
|
|
53
53
|
# number = 12
|
54
54
|
# length = number.to_l
|
55
55
|
#
|
56
|
-
# @return
|
56
|
+
# @return [Length] a Length object if successful
|
57
57
|
#
|
58
58
|
# @version SketchUp 6.0
|
59
59
|
def inch
|
@@ -65,7 +65,7 @@ class Numeric
|
|
65
65
|
# value = 1
|
66
66
|
# inches = value.km
|
67
67
|
#
|
68
|
-
# @return
|
68
|
+
# @return [Length] a value in inches if successful
|
69
69
|
#
|
70
70
|
# @version SketchUp 6.0
|
71
71
|
def km
|
@@ -77,7 +77,7 @@ class Numeric
|
|
77
77
|
# meters = 1
|
78
78
|
# inches = meters.m
|
79
79
|
#
|
80
|
-
# @return
|
80
|
+
# @return [Length] a value in inches if successful
|
81
81
|
#
|
82
82
|
# @version SketchUp 6.0
|
83
83
|
def m
|
@@ -89,7 +89,7 @@ class Numeric
|
|
89
89
|
# miles = 1
|
90
90
|
# inches = miles.mile
|
91
91
|
#
|
92
|
-
# @return
|
92
|
+
# @return [Length] a value in inches if successful
|
93
93
|
#
|
94
94
|
# @version SketchUp 6.0
|
95
95
|
def mile
|
@@ -104,7 +104,7 @@ class Numeric
|
|
104
104
|
# value = 10
|
105
105
|
# mm = value.mm
|
106
106
|
#
|
107
|
-
# @return
|
107
|
+
# @return [Length] a value in millimeters if successful
|
108
108
|
#
|
109
109
|
# @version SketchUp 6.0
|
110
110
|
def mm
|
@@ -118,7 +118,7 @@ class Numeric
|
|
118
118
|
# radians = 1.5707963267949
|
119
119
|
# degrees = radians.radians
|
120
120
|
#
|
121
|
-
# @return
|
121
|
+
# @return [Float] a value in degrees if successful
|
122
122
|
#
|
123
123
|
# @version SketchUp 6.0
|
124
124
|
def radians
|
@@ -130,7 +130,7 @@ class Numeric
|
|
130
130
|
# inches = 1
|
131
131
|
# cm = inches.to_cm
|
132
132
|
#
|
133
|
-
# @return
|
133
|
+
# @return [Float] a value in centimeters if successful
|
134
134
|
#
|
135
135
|
# @version SketchUp 6.0
|
136
136
|
def to_cm
|
@@ -142,7 +142,7 @@ class Numeric
|
|
142
142
|
# inches = 12
|
143
143
|
# feet = inches.to_feet
|
144
144
|
#
|
145
|
-
# @return
|
145
|
+
# @return [Float] a value in feet if successful
|
146
146
|
#
|
147
147
|
# @version SketchUp 6.0
|
148
148
|
def to_feet
|
@@ -156,7 +156,7 @@ class Numeric
|
|
156
156
|
# inches = 12
|
157
157
|
# inches = inches.to_inch
|
158
158
|
#
|
159
|
-
# @return
|
159
|
+
# @return [Float] a value in inches if successful
|
160
160
|
#
|
161
161
|
# @version SketchUp 6.0
|
162
162
|
def to_inch
|
@@ -168,7 +168,7 @@ class Numeric
|
|
168
168
|
# inches = 1
|
169
169
|
# km = inches.to_km
|
170
170
|
#
|
171
|
-
# @return
|
171
|
+
# @return [Float] a value in kilometers if successful
|
172
172
|
#
|
173
173
|
# @version SketchUp 6.0
|
174
174
|
def to_km
|
@@ -180,7 +180,7 @@ class Numeric
|
|
180
180
|
# number = 12
|
181
181
|
# length = number.to_l
|
182
182
|
#
|
183
|
-
# @return
|
183
|
+
# @return [Length] a Length object if successful
|
184
184
|
#
|
185
185
|
# @version SketchUp 6.0
|
186
186
|
def to_l
|
@@ -192,7 +192,7 @@ class Numeric
|
|
192
192
|
# inches = 12
|
193
193
|
# meters = inches.to_m
|
194
194
|
#
|
195
|
-
# @return
|
195
|
+
# @return [Float] a value in meters if successful
|
196
196
|
#
|
197
197
|
# @version SketchUp 6.0
|
198
198
|
def to_m
|
@@ -204,7 +204,7 @@ class Numeric
|
|
204
204
|
# inches = 10000
|
205
205
|
# miles = inches.to_mile
|
206
206
|
#
|
207
|
-
# @return
|
207
|
+
# @return [Float] a value in miles if successful
|
208
208
|
#
|
209
209
|
# @version SketchUp 6.0
|
210
210
|
def to_mile
|
@@ -216,7 +216,7 @@ class Numeric
|
|
216
216
|
# inches = 1
|
217
217
|
# mm = inches.to_mm
|
218
218
|
#
|
219
|
-
# @return
|
219
|
+
# @return [Float] a value in millimeters if successful
|
220
220
|
#
|
221
221
|
# @version SketchUp 6.0
|
222
222
|
def to_mm
|
@@ -228,7 +228,7 @@ class Numeric
|
|
228
228
|
# inches = 10000
|
229
229
|
# yards = inches.to_yard
|
230
230
|
#
|
231
|
-
# @return
|
231
|
+
# @return [Float] a value in yards if successful
|
232
232
|
#
|
233
233
|
# @version SketchUp 6.0
|
234
234
|
def to_yard
|
@@ -240,7 +240,7 @@ class Numeric
|
|
240
240
|
# yards = 1.to_l
|
241
241
|
# inches = yards.yard
|
242
242
|
#
|
243
|
-
# @return
|
243
|
+
# @return [Length] a value in inches if successful
|
244
244
|
#
|
245
245
|
# @version SketchUp 6.0
|
246
246
|
def yard
|
data/SketchUp/sketchup.rb
CHANGED
@@ -42,13 +42,13 @@ module Sketchup
|
|
42
42
|
#
|
43
43
|
# @example
|
44
44
|
# model = Sketchup.active_model
|
45
|
-
# if
|
46
|
-
# UI.messagebox
|
45
|
+
# if !model
|
46
|
+
# UI.messagebox("Failure")
|
47
47
|
# else
|
48
48
|
# # code acting on the model
|
49
49
|
# end
|
50
50
|
#
|
51
|
-
# @return [Sketchup::Model]
|
51
|
+
# @return [Sketchup::Model] active model object if successful, false if
|
52
52
|
# unsuccessful
|
53
53
|
#
|
54
54
|
# @version SketchUp 6.0
|
@@ -58,12 +58,12 @@ module Sketchup
|
|
58
58
|
# The add_observer method is used to add an observer to the current object.
|
59
59
|
#
|
60
60
|
# @example
|
61
|
-
# status = Sketchup.add_observer
|
61
|
+
# status = Sketchup.add_observer(observer)
|
62
62
|
#
|
63
|
-
# @param observer
|
63
|
+
# @param [Object] observer
|
64
64
|
# An observer.
|
65
65
|
#
|
66
|
-
# @return
|
66
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
67
67
|
#
|
68
68
|
# @version SketchUp 6.0
|
69
69
|
def self.add_observer(observer)
|
@@ -74,7 +74,7 @@ module Sketchup
|
|
74
74
|
# @example
|
75
75
|
# name = Sketchup.app_name
|
76
76
|
#
|
77
|
-
# @return
|
77
|
+
# @return [String] the name of the application, either
|
78
78
|
# "SketchUp Pro" or "SketchUp".
|
79
79
|
# Note: For versions earlier than SketchUp8 M4
|
80
80
|
# (Mac 8.0.15157 and Windows 8.0.15158) this function will
|
@@ -95,13 +95,13 @@ module Sketchup
|
|
95
95
|
# reactivated.
|
96
96
|
#
|
97
97
|
# @example
|
98
|
-
#
|
98
|
+
# Sketchup.break_edges = false
|
99
99
|
#
|
100
|
-
# @param enabled
|
100
|
+
# @param [Boolean] enabled
|
101
101
|
# If true, break edges will be turned on. If false, it
|
102
102
|
# will be deactivated.
|
103
103
|
#
|
104
|
-
# @return
|
104
|
+
# @return [Boolean] true if break edges was turned on.
|
105
105
|
#
|
106
106
|
# @version SketchUp 7.0
|
107
107
|
def self.break_edges=(enabled)
|
@@ -116,7 +116,7 @@ module Sketchup
|
|
116
116
|
# @example
|
117
117
|
# is_on = Sketchup.break_edges?
|
118
118
|
#
|
119
|
-
# @return
|
119
|
+
# @return [Boolean]
|
120
120
|
#
|
121
121
|
# @return [Boolean]
|
122
122
|
#
|
@@ -129,7 +129,7 @@ module Sketchup
|
|
129
129
|
# @example
|
130
130
|
# texturewriter = Sketchup.create_texture_writer
|
131
131
|
#
|
132
|
-
# @return
|
132
|
+
# @return [Sketchup::TextureWriter] a texturewriter object if successful.
|
133
133
|
#
|
134
134
|
# @version SketchUp 6.0
|
135
135
|
def self.create_texture_writer
|
@@ -142,10 +142,10 @@ module Sketchup
|
|
142
142
|
# @example
|
143
143
|
# Sketchup.debug_mode = true
|
144
144
|
#
|
145
|
-
# @param enabled
|
145
|
+
# @param [Boolean] enabled
|
146
146
|
# If true, SketchUp will produce debug warnings.
|
147
147
|
#
|
148
|
-
# @return
|
148
|
+
# @return [Boolean]
|
149
149
|
#
|
150
150
|
# @version SketchUp 2016
|
151
151
|
def self.debug_mode=(enabled)
|
@@ -157,7 +157,7 @@ module Sketchup
|
|
157
157
|
# @example
|
158
158
|
# debug_mode = Sketchup.debug_mode?
|
159
159
|
#
|
160
|
-
# @return
|
160
|
+
# @return [Boolean]
|
161
161
|
#
|
162
162
|
# @return [Boolean]
|
163
163
|
#
|
@@ -174,10 +174,10 @@ module Sketchup
|
|
174
174
|
#
|
175
175
|
# @note This method has been non-functional on Mac since SketchUp 8.
|
176
176
|
#
|
177
|
-
# @param action_name
|
177
|
+
# @param [String] action_name
|
178
178
|
# An action string.
|
179
179
|
#
|
180
|
-
# @return
|
180
|
+
# @return [String] a friendly name.
|
181
181
|
#
|
182
182
|
# @version SketchUp 6.0
|
183
183
|
def self.display_name_from_action(action_name)
|
@@ -188,12 +188,11 @@ module Sketchup
|
|
188
188
|
#
|
189
189
|
# @example
|
190
190
|
# extensions = Sketchup.extensions
|
191
|
-
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
# end
|
191
|
+
# extensions.each{ |extension|
|
192
|
+
# puts "The next extension is named: #{extension.name} and its loaded? state is: #{extension.loaded?}"
|
193
|
+
# }
|
195
194
|
#
|
196
|
-
# @return
|
195
|
+
# @return [Sketchup::ExtensionsManager] an ExtensionsManager object.
|
197
196
|
#
|
198
197
|
# @version SketchUp 8.0 M2
|
199
198
|
def self.extensions
|
@@ -204,7 +203,7 @@ module Sketchup
|
|
204
203
|
# @example
|
205
204
|
# new_sketchup = Sketchup.file_new
|
206
205
|
#
|
207
|
-
# @return
|
206
|
+
# @return [Module] The Sketchup module.
|
208
207
|
#
|
209
208
|
# @version SketchUp 6.0
|
210
209
|
def self.file_new
|
@@ -216,29 +215,29 @@ module Sketchup
|
|
216
215
|
# Forward slashes must be used to delimit between directory names.
|
217
216
|
#
|
218
217
|
# @example
|
219
|
-
# help_file = Sketchup.find_support_file
|
220
|
-
# if
|
218
|
+
# help_file = Sketchup.find_support_file("help.html", "Plugins/")
|
219
|
+
# if help_file
|
221
220
|
# # Print out the help_file full path
|
222
|
-
# UI.messagebox
|
221
|
+
# UI.messagebox(help_file)
|
223
222
|
#
|
224
223
|
# # Open the help_file in a web browser
|
225
|
-
# UI.openURL
|
224
|
+
# UI.openURL("file://" + help_file)
|
226
225
|
# else
|
227
|
-
# UI.messagebox
|
226
|
+
# UI.messagebox("Failure")
|
228
227
|
# end
|
229
228
|
#
|
230
|
-
# @param filename
|
229
|
+
# @param [String] filename
|
231
230
|
# Name of the filename you want to find.
|
232
231
|
#
|
233
|
-
# @param directory
|
232
|
+
# @param [String] directory
|
234
233
|
# directory relative to the SketchUp
|
235
234
|
# installation directory.
|
236
235
|
#
|
237
|
-
# @return
|
236
|
+
# @return [String] the entire path if successful. If unsuccessful,
|
238
237
|
# the method returns false.
|
239
238
|
#
|
240
239
|
# @version SketchUp 6.0
|
241
|
-
def self.find_support_file(filename, directory
|
240
|
+
def self.find_support_file(filename, directory)
|
242
241
|
end
|
243
242
|
|
244
243
|
# The find_support_files method is used to retrieve the path and name of all
|
@@ -249,15 +248,15 @@ module Sketchup
|
|
249
248
|
# @example
|
250
249
|
# files = Sketchup.find_support_files('rb', 'Plugins')
|
251
250
|
#
|
252
|
-
# @param filename
|
251
|
+
# @param [String] filename
|
253
252
|
# Extension of the files to be found.
|
254
253
|
#
|
255
|
-
# @param directory
|
254
|
+
# @param [String] directory
|
256
255
|
# directory relative to the SketchUp installation
|
257
256
|
# directory. Without this the result will
|
258
257
|
# be empty.
|
259
258
|
#
|
260
|
-
# @return
|
259
|
+
# @return [Array<String>] an array of files. If unsuccessful, the method
|
261
260
|
# returns false.
|
262
261
|
#
|
263
262
|
# @version SketchUp 6.0
|
@@ -270,13 +269,13 @@ module Sketchup
|
|
270
269
|
# method can be used to control it.
|
271
270
|
#
|
272
271
|
# @example
|
273
|
-
# Sketchup.fix_shadow_strings=true
|
272
|
+
# Sketchup.fix_shadow_strings = true
|
274
273
|
#
|
275
|
-
# @param enabled
|
274
|
+
# @param [Boolean] enabled
|
276
275
|
# If true, shadow strings fix will be turned on. If
|
277
276
|
# false, it will be deactivated.
|
278
277
|
#
|
279
|
-
# @return
|
278
|
+
# @return [Boolean] true if shadow strings fix was turned on.
|
280
279
|
#
|
281
280
|
# @version SketchUp 8.0 M1
|
282
281
|
def self.fix_shadow_strings=(enabled)
|
@@ -290,7 +289,7 @@ module Sketchup
|
|
290
289
|
# @example
|
291
290
|
# is_on = Sketchup.fix_shadow_strings?
|
292
291
|
#
|
293
|
-
# @return
|
292
|
+
# @return [Boolean]
|
294
293
|
#
|
295
294
|
# @return [Boolean]
|
296
295
|
#
|
@@ -302,13 +301,12 @@ module Sketchup
|
|
302
301
|
# into degrees. For example, format_angle(Math::PI) will return 180.0.
|
303
302
|
#
|
304
303
|
# @example
|
305
|
-
# degrees = Sketchup.format_angle
|
304
|
+
# degrees = Sketchup.format_angle(Math::PI)
|
306
305
|
#
|
307
|
-
# @param number
|
306
|
+
# @param [Numeric] number
|
308
307
|
# A number to be formatted.
|
309
308
|
#
|
310
|
-
# @return
|
311
|
-
# unsuccessful
|
309
|
+
# @return [String] an angle in degrees if successful, false if unsuccessful
|
312
310
|
#
|
313
311
|
# @version SketchUp 6.0
|
314
312
|
def self.format_angle(number)
|
@@ -321,12 +319,12 @@ module Sketchup
|
|
321
319
|
# squared.
|
322
320
|
#
|
323
321
|
# @example
|
324
|
-
# area = Sketchup.format_area
|
322
|
+
# area = Sketchup.format_area(number)
|
325
323
|
#
|
326
|
-
# @param number
|
324
|
+
# @param [Numeric] number
|
327
325
|
# A number to be formatted.
|
328
326
|
#
|
329
|
-
# @return
|
327
|
+
# @return [String] an area if successful, false if unsuccessful.
|
330
328
|
#
|
331
329
|
# @version SketchUp 6.0
|
332
330
|
def self.format_area(number)
|
@@ -336,12 +334,12 @@ module Sketchup
|
|
336
334
|
# example, 10 becomes 10.0. This is the equivalent to a to_f call.
|
337
335
|
#
|
338
336
|
# @example
|
339
|
-
# degrees = Sketchup.format_degrees
|
337
|
+
# degrees = Sketchup.format_degrees(number)
|
340
338
|
#
|
341
|
-
# @param number
|
339
|
+
# @param [Numeric] number
|
342
340
|
# A number to be formatted.
|
343
341
|
#
|
344
|
-
# @return
|
342
|
+
# @return [String] degrees if successful, false if unsuccessful.
|
345
343
|
#
|
346
344
|
# @version SketchUp 6.0
|
347
345
|
def self.format_degrees(number)
|
@@ -353,15 +351,15 @@ module Sketchup
|
|
353
351
|
# The default unit setting is inches. For example, 10 becomes 10".
|
354
352
|
#
|
355
353
|
# @example
|
356
|
-
# length = Sketchup.format_length
|
357
|
-
# if
|
358
|
-
# UI.messagebox
|
354
|
+
# length = Sketchup.format_length(10)
|
355
|
+
# if length
|
356
|
+
# UI.messagebox(length)
|
359
357
|
# end
|
360
358
|
#
|
361
|
-
# @param number
|
359
|
+
# @param [Numeric] number
|
362
360
|
# A number to be formatted.
|
363
361
|
#
|
364
|
-
# @return
|
362
|
+
# @return [String] length if successful, false if unsuccessful
|
365
363
|
#
|
366
364
|
# @version SketchUp 6.0
|
367
365
|
def self.format_length(number)
|
@@ -375,14 +373,14 @@ module Sketchup
|
|
375
373
|
# @example
|
376
374
|
# value = Sketchup.get_datfile_info(key, default_value)
|
377
375
|
#
|
378
|
-
# @param key
|
376
|
+
# @param [String] key
|
379
377
|
# The key whose value you want to retrieve.
|
380
378
|
#
|
381
|
-
# @param default_value
|
379
|
+
# @param [String] default_value
|
382
380
|
# The default value you want returned if key is not
|
383
381
|
# available.
|
384
382
|
#
|
385
|
-
# @return
|
383
|
+
# @return [String] a string value if successful.
|
386
384
|
#
|
387
385
|
# @version SketchUp 6.0
|
388
386
|
def self.get_datfile_info(key, default_value)
|
@@ -397,14 +395,14 @@ module Sketchup
|
|
397
395
|
# @example
|
398
396
|
# value = Sketchup.get_i18ndatfile_info(key, default_value)
|
399
397
|
#
|
400
|
-
# @param key
|
398
|
+
# @param [String] key
|
401
399
|
# The key whose value you want to retrieve.
|
402
400
|
#
|
403
|
-
# @param default_value
|
401
|
+
# @param [String] default_value
|
404
402
|
# The default value you want returned if key is not
|
405
403
|
# available.
|
406
404
|
#
|
407
|
-
# @return
|
405
|
+
# @return [String] a string value if successful.
|
408
406
|
#
|
409
407
|
# @version SketchUp 6.0
|
410
408
|
def self.get_i18n_datfile_info(key, default_value)
|
@@ -421,7 +419,7 @@ module Sketchup
|
|
421
419
|
# @example
|
422
420
|
# language = Sketchup.os_language
|
423
421
|
#
|
424
|
-
# @return
|
422
|
+
# @return [String] a code representing the language SketchUp
|
425
423
|
# is displaying.
|
426
424
|
#
|
427
425
|
# @version SketchUp 6.0
|
@@ -433,13 +431,12 @@ module Sketchup
|
|
433
431
|
# localization files.
|
434
432
|
#
|
435
433
|
# @example
|
436
|
-
# directory = Sketchup.get_resource_path
|
434
|
+
# directory = Sketchup.get_resource_path("Styles.strings")
|
437
435
|
#
|
438
|
-
# @param filename
|
439
|
-
# The filename of a resource file in the resource
|
440
|
-
# directory hierarchy.
|
436
|
+
# @param [String] filename
|
437
|
+
# The filename of a resource file in the resource directory hierarchy.
|
441
438
|
#
|
442
|
-
# @return
|
439
|
+
# @return [String] the directory path to the resources folder.
|
443
440
|
#
|
444
441
|
# @version SketchUp 6.0
|
445
442
|
def self.get_resource_path(filename)
|
@@ -453,7 +450,7 @@ module Sketchup
|
|
453
450
|
# @example
|
454
451
|
# shortcuts = Sketchup.get_shortcuts
|
455
452
|
#
|
456
|
-
# @return
|
453
|
+
# @return [Array<String>] an array of shortcut strings.
|
457
454
|
#
|
458
455
|
# @version SketchUp 6.0
|
459
456
|
def self.get_shortcuts
|
@@ -484,21 +481,21 @@ module Sketchup
|
|
484
481
|
# begin
|
485
482
|
# Sketchup.install_from_archive(path)
|
486
483
|
# rescue Interrupt => error
|
487
|
-
# UI.messagebox
|
484
|
+
# UI.messagebox("User said 'no': " + error)
|
488
485
|
# rescue Exception => error
|
489
|
-
# UI.messagebox
|
486
|
+
# UI.messagebox("Error during unzip: " + error)
|
490
487
|
# end
|
491
488
|
#
|
492
489
|
# @param [String] filename
|
493
490
|
# The path to the RBZ or ZIP file to install.
|
494
491
|
#
|
495
|
-
# @raise [Exception] If the archive cannot be
|
492
|
+
# @raise [Exception] If the archive cannot be installed.
|
496
493
|
#
|
497
494
|
# @raise [Interrupt] If the user cancel the installation.
|
498
495
|
#
|
499
|
-
# @raise [Exception] If the archive cannot be
|
496
|
+
# @raise [Exception] If the archive cannot be found.
|
500
497
|
#
|
501
|
-
# @return [Boolean]
|
498
|
+
# @return [Boolean]
|
502
499
|
#
|
503
500
|
# @version SketchUp 8.0 M2
|
504
501
|
def self.install_from_archive(filename)
|
@@ -518,7 +515,7 @@ module Sketchup
|
|
518
515
|
# # Load 32bit binaries.
|
519
516
|
# end
|
520
517
|
#
|
521
|
-
# @return Boolean
|
518
|
+
# @return [Boolean]
|
522
519
|
#
|
523
520
|
# @return [Boolean]
|
524
521
|
#
|
@@ -533,7 +530,7 @@ module Sketchup
|
|
533
530
|
# @example
|
534
531
|
# status = Sketchup.is_online
|
535
532
|
#
|
536
|
-
# @return
|
533
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
537
534
|
#
|
538
535
|
# @version SketchUp 6.0
|
539
536
|
def self.is_online
|
@@ -545,11 +542,11 @@ module Sketchup
|
|
545
542
|
# the product.
|
546
543
|
#
|
547
544
|
# @example
|
548
|
-
# if
|
549
|
-
# UI.messagebox
|
545
|
+
# if Sketchup.is_pro?
|
546
|
+
# UI.messagebox("You are running SU Pro.")
|
550
547
|
# end
|
551
548
|
#
|
552
|
-
# @return
|
549
|
+
# @return [Boolean]
|
553
550
|
#
|
554
551
|
# @return [Boolean]
|
555
552
|
#
|
@@ -561,13 +558,12 @@ module Sketchup
|
|
561
558
|
# contains illegal characters.
|
562
559
|
#
|
563
560
|
# @example
|
564
|
-
# status = Sketchup.is_valid_filename?
|
561
|
+
# status = Sketchup.is_valid_filename?(filename)
|
565
562
|
#
|
566
|
-
# @param filename
|
563
|
+
# @param [String] filename
|
567
564
|
# A filename string.
|
568
565
|
#
|
569
|
-
# @return
|
570
|
-
# is invalid (contains illegal characters).
|
566
|
+
# @return [Boolean]
|
571
567
|
#
|
572
568
|
# @return [Boolean]
|
573
569
|
#
|
@@ -586,11 +582,11 @@ module Sketchup
|
|
586
582
|
# sfile = "application_loader" # file extension not required
|
587
583
|
# status = Sketchup.load(sfile)
|
588
584
|
#
|
589
|
-
# @param path
|
585
|
+
# @param [String] path
|
590
586
|
# The path, including the filename, to the file you want
|
591
587
|
# to require.
|
592
588
|
#
|
593
|
-
# @return
|
589
|
+
# @return [Boolean] True if the file is included. False if the
|
594
590
|
# file is not included.
|
595
591
|
#
|
596
592
|
# @version SketchUp 6.0
|
@@ -600,12 +596,12 @@ module Sketchup
|
|
600
596
|
# The open_file method is used to open a file.
|
601
597
|
#
|
602
598
|
# @example
|
603
|
-
# result = Sketchup.open_file
|
599
|
+
# result = Sketchup.open_file("C:\\model.skp")
|
604
600
|
#
|
605
|
-
# @param filename
|
601
|
+
# @param [String] filename
|
606
602
|
# The path and filename to open.
|
607
603
|
#
|
608
|
-
# @return
|
604
|
+
# @return [Boolean] true if opening the file succeeded,
|
609
605
|
# false otherwise.
|
610
606
|
#
|
611
607
|
# @version SketchUp 6.0
|
@@ -623,7 +619,7 @@ module Sketchup
|
|
623
619
|
# @example
|
624
620
|
# language = Sketchup.os_language
|
625
621
|
#
|
626
|
-
# @return
|
622
|
+
# @return [String] a code representing the language SketchUp
|
627
623
|
# is displaying.
|
628
624
|
#
|
629
625
|
# @version SketchUp 6.0
|
@@ -638,10 +634,10 @@ module Sketchup
|
|
638
634
|
# float = Sketchup.parse_length("2'") # Returns 24 (representing inches)
|
639
635
|
# length = float.to_l # Convert to a Length type if needed.
|
640
636
|
#
|
641
|
-
# @param string
|
637
|
+
# @param [String] string
|
642
638
|
# The string to be parsed as a number.
|
643
639
|
#
|
644
|
-
# @return
|
640
|
+
# @return [Float] the numerical representation of the string if
|
645
641
|
# successful, or nil if unsuccessful.
|
646
642
|
#
|
647
643
|
# @version SketchUp 6.0
|
@@ -667,7 +663,7 @@ module Sketchup
|
|
667
663
|
# IS_OSX = Sketchup.platform == :platform_osx
|
668
664
|
# end
|
669
665
|
#
|
670
|
-
# @return
|
666
|
+
# @return [Symbol] Current OS platform.
|
671
667
|
#
|
672
668
|
# @version SketchUp 2014
|
673
669
|
def self.platform
|
@@ -682,15 +678,15 @@ module Sketchup
|
|
682
678
|
#
|
683
679
|
# @example
|
684
680
|
# # Type this in the Ruby console then restart SketchUp.
|
685
|
-
# Sketchup.plugins_disabled=true
|
681
|
+
# Sketchup.plugins_disabled = true
|
686
682
|
#
|
687
683
|
# # To reactivate plugins, type this into the Ruby console and restart.
|
688
|
-
# Sketchup.plugins_disabled=false
|
684
|
+
# Sketchup.plugins_disabled = false
|
689
685
|
#
|
690
|
-
# @param enabled
|
686
|
+
# @param [Boolean] enabled
|
691
687
|
# If true, the plugins directory will not load.
|
692
688
|
#
|
693
|
-
# @return
|
689
|
+
# @return [Boolean] true if plugins were disabled.
|
694
690
|
#
|
695
691
|
# @version SketchUp 8.0 M2
|
696
692
|
def self.plugins_disabled=(enabled)
|
@@ -702,7 +698,7 @@ module Sketchup
|
|
702
698
|
# @example
|
703
699
|
# is_disabled = Sketchup.plugins_disabled?
|
704
700
|
#
|
705
|
-
# @return
|
701
|
+
# @return [Boolean]
|
706
702
|
#
|
707
703
|
# @return [Boolean]
|
708
704
|
#
|
@@ -725,23 +721,22 @@ module Sketchup
|
|
725
721
|
end
|
726
722
|
|
727
723
|
# The read_default method is used to retrieve the string associated with a
|
728
|
-
# value within the specified sub-section section of a .INI file or registry
|
729
|
-
# (within the Software > SketchUp > SketchUp [Version] section).
|
724
|
+
# value within the specified sub-section section of a .INI file or registry
|
725
|
+
# (within the Software > SketchUp > SketchUp [Version] section).
|
730
726
|
#
|
731
727
|
# @example
|
732
|
-
# result = Sketchup.read_default
|
733
|
-
# "variable", "default"
|
734
|
-
#
|
735
|
-
# @param section
|
736
|
-
# A section in an .INI or registry.
|
728
|
+
# result = Sketchup.read_default("section", "variable", "default")
|
737
729
|
#
|
738
|
-
# @param
|
739
|
-
# A
|
730
|
+
# @param [String] section
|
731
|
+
# A section in an .INI or registry.
|
740
732
|
#
|
741
|
-
# @param default
|
733
|
+
# @param [Object] default
|
742
734
|
# A default value if the value is not found.
|
743
735
|
#
|
744
|
-
# @
|
736
|
+
# @param [String] variable
|
737
|
+
# A variable within the section.
|
738
|
+
#
|
739
|
+
# @return [Object, nil] if unsuccessful, the value of the default
|
745
740
|
# if successful.
|
746
741
|
#
|
747
742
|
# @version SketchUp 6.0
|
@@ -752,27 +747,27 @@ module Sketchup
|
|
752
747
|
# SketchUp's extension manager (in SketchUp preferences).
|
753
748
|
#
|
754
749
|
# @example
|
755
|
-
#
|
756
|
-
# "Utilities/utilitiesTools.rb"
|
750
|
+
# utilities_extension = SketchupExtension.new("Utilities Tools",
|
751
|
+
# "Utilities/utilitiesTools.rb")
|
757
752
|
#
|
758
|
-
#
|
753
|
+
# utilities_extension.description = "Adds Tools->Utilities to the " +
|
759
754
|
# "SketchUp inteface. The Utilities submenu contains two tools: " +
|
760
755
|
# "Create Face and Query Tool."
|
761
756
|
#
|
762
|
-
# Sketchup.register_extension
|
757
|
+
# Sketchup.register_extension(utilities_extension, false)
|
763
758
|
#
|
764
759
|
# @note It is recommended to set +load_on_start+ to true unless you have a very
|
765
760
|
# good reason not to.
|
766
761
|
#
|
762
|
+
# @param [SketchupExtension] extension
|
763
|
+
# A SketchupExtension object.
|
764
|
+
#
|
767
765
|
# @param [Boolean] load_on_start
|
768
766
|
# Passing true into this will load the
|
769
767
|
# extension immediately and set it so
|
770
768
|
# that it will load automatically
|
771
769
|
# whenever SketchUp restarts.
|
772
770
|
#
|
773
|
-
# @param [SketchupExtension] extension
|
774
|
-
# A SketchupExtension object.
|
775
|
-
#
|
776
771
|
# @return [Boolean] +true+ if extension registered properly
|
777
772
|
#
|
778
773
|
# @version SketchUp 6.0
|
@@ -782,12 +777,12 @@ module Sketchup
|
|
782
777
|
# The register_importer method is used to register an importer with SketchUp.
|
783
778
|
#
|
784
779
|
# @example
|
785
|
-
# status = Sketchup.register_importer
|
780
|
+
# status = Sketchup.register_importer(importer)
|
786
781
|
#
|
787
|
-
# @param importer
|
782
|
+
# @param [Sketchup::Importer] importer
|
788
783
|
# An Importer object representing the importer.
|
789
784
|
#
|
790
|
-
# @return
|
785
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
791
786
|
#
|
792
787
|
# @version SketchUp 6.0
|
793
788
|
def self.register_importer(importer)
|
@@ -797,12 +792,12 @@ module Sketchup
|
|
797
792
|
# object.
|
798
793
|
#
|
799
794
|
# @example
|
800
|
-
# status = Sketchup.remove_observer
|
795
|
+
# status = Sketchup.remove_observer(observer)
|
801
796
|
#
|
802
|
-
# @param observer
|
797
|
+
# @param [Sketchup::AppObserver] observer
|
803
798
|
# An observer.
|
804
799
|
#
|
805
|
-
# @return true if successful, false if unsuccessful.
|
800
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
806
801
|
#
|
807
802
|
# @version SketchUp 6.0
|
808
803
|
def self.remove_observer(observer)
|
@@ -821,11 +816,11 @@ module Sketchup
|
|
821
816
|
# sfile = "application_loader" # file extension not required
|
822
817
|
# status = Sketchup::require(sfile)
|
823
818
|
#
|
824
|
-
# @param path
|
819
|
+
# @param [String] path
|
825
820
|
# The path, including the filename, to the file you want
|
826
821
|
# to require.
|
827
822
|
#
|
828
|
-
# @return
|
823
|
+
# @return [Boolean] True if the file is included. False if the
|
829
824
|
# file is not included.
|
830
825
|
#
|
831
826
|
# @version SketchUp 6.0
|
@@ -836,16 +831,16 @@ module Sketchup
|
|
836
831
|
# not necessarily the loaded model.
|
837
832
|
#
|
838
833
|
# @example
|
839
|
-
# status = Sketchup.save_thumbnail
|
834
|
+
# status = Sketchup.save_thumbnail("skp_filename", "image_filename")
|
840
835
|
#
|
841
|
-
# @param skp_filename
|
836
|
+
# @param [String] skp_filename
|
842
837
|
# The name of the SketchUp file whose model you want
|
843
838
|
# represented in the thumbnail.
|
844
839
|
#
|
845
|
-
# @param img_filename
|
840
|
+
# @param [String] img_filename
|
846
841
|
# The name of the file where the thumbnail will be saved.
|
847
842
|
#
|
848
|
-
# @return
|
843
|
+
# @return [Boolean] true if successful, false if unsuccessful.
|
849
844
|
#
|
850
845
|
# @version SketchUp 6.0
|
851
846
|
def self.save_thumbnail(skp_filename, img_filename)
|
@@ -1058,17 +1053,33 @@ module Sketchup
|
|
1058
1053
|
# - 21560 and up: causes a runtime Error
|
1059
1054
|
#
|
1060
1055
|
# @example
|
1061
|
-
# result = Sketchup.send_action
|
1056
|
+
# result = Sketchup.send_action("selectArcTool:")
|
1062
1057
|
#
|
1063
1058
|
# @param [String, Integer] action
|
1064
1059
|
# The action to be performed.
|
1065
1060
|
#
|
1066
|
-
# @return [
|
1061
|
+
# @return [Boolean] +true+ if successful, +false+ if unsuccessful
|
1067
1062
|
#
|
1068
1063
|
# @version SketchUp 6.0
|
1069
1064
|
def self.send_action(action)
|
1070
1065
|
end
|
1071
1066
|
|
1067
|
+
# The {#send_to_layout} method is used to open a file in LayOut.
|
1068
|
+
#
|
1069
|
+
# @example
|
1070
|
+
# result = Sketchup.send_to_layout("C:/models/hexaflexagon.layout")
|
1071
|
+
#
|
1072
|
+
# @param [String] file
|
1073
|
+
# The path and filename to open, either .skp or .layout.
|
1074
|
+
#
|
1075
|
+
# @return [Boolean] true if opening the file succeeded,
|
1076
|
+
# false otherwise. If LayOut is not installed or the file is not present
|
1077
|
+
# this function will return false.
|
1078
|
+
#
|
1079
|
+
# @version SketchUp 2018
|
1080
|
+
def self.send_to_layout(file)
|
1081
|
+
end
|
1082
|
+
|
1072
1083
|
# The set_status_text method is used to
|
1073
1084
|
# set the text appearing on the status bar within the drawing window.
|
1074
1085
|
#
|
@@ -1080,8 +1091,8 @@ module Sketchup
|
|
1080
1091
|
# - +SB_VCB_VALUE+ - the text will appear in the VCB
|
1081
1092
|
#
|
1082
1093
|
# @example
|
1083
|
-
# result = Sketchup.set_status_text
|
1084
|
-
# if
|
1094
|
+
# result = Sketchup.set_status_text("This is a Test", SB_VCB_VALUE)
|
1095
|
+
# if result
|
1085
1096
|
# #code to do something if set_status_text is successful
|
1086
1097
|
# end
|
1087
1098
|
#
|
@@ -1092,8 +1103,8 @@ module Sketchup
|
|
1092
1103
|
#
|
1093
1104
|
# @overload set_status_text(status_text = '', position = SB_PROMPT)
|
1094
1105
|
#
|
1095
|
-
# @param status text
|
1096
|
-
# @param position
|
1106
|
+
# @param [String] status text the status text that will appear.
|
1107
|
+
# @param [Integer] position the position where the text will appear.
|
1097
1108
|
# @return [nil]
|
1098
1109
|
#
|
1099
1110
|
# @version SketchUp 6.0
|
@@ -1109,10 +1120,10 @@ module Sketchup
|
|
1109
1120
|
# @example
|
1110
1121
|
# result = Sketchup.status_text = "This is a Test"
|
1111
1122
|
#
|
1112
|
-
# @param status_text
|
1123
|
+
# @param [String] status_text
|
1113
1124
|
# The status text that will appear.
|
1114
1125
|
#
|
1115
|
-
# @return
|
1126
|
+
# @return [String]
|
1116
1127
|
#
|
1117
1128
|
# @version SketchUp 6.0
|
1118
1129
|
def self.status_text=(status_text)
|
@@ -1125,7 +1136,7 @@ module Sketchup
|
|
1125
1136
|
# @example
|
1126
1137
|
# temp_dir = Sketchup.temp_dir
|
1127
1138
|
#
|
1128
|
-
# @return String containing the full temporary directory path
|
1139
|
+
# @return [String] a string containing the full temporary directory path
|
1129
1140
|
#
|
1130
1141
|
# @version SketchUp 2014
|
1131
1142
|
def self.temp_dir
|
@@ -1137,7 +1148,7 @@ module Sketchup
|
|
1137
1148
|
# @example
|
1138
1149
|
# name = Sketchup.template
|
1139
1150
|
#
|
1140
|
-
# @return
|
1151
|
+
# @return [String] the current template
|
1141
1152
|
#
|
1142
1153
|
# @version SketchUp 6.0
|
1143
1154
|
def self.template
|
@@ -1147,12 +1158,12 @@ module Sketchup
|
|
1147
1158
|
# Templates are the .skp files that are loaded when the user select File > New.
|
1148
1159
|
#
|
1149
1160
|
# @example
|
1150
|
-
# status = Sketchup.template= "filename"
|
1161
|
+
# status = Sketchup.template = "filename"
|
1151
1162
|
#
|
1152
|
-
# @param filename
|
1163
|
+
# @param [String] filename
|
1153
1164
|
# The name of the template to set.
|
1154
1165
|
#
|
1155
|
-
# @return
|
1166
|
+
# @return [String] true if successful, false if unsuccessful.
|
1156
1167
|
#
|
1157
1168
|
# @version SketchUp 6.0
|
1158
1169
|
def self.template=(filename)
|
@@ -1165,7 +1176,7 @@ module Sketchup
|
|
1165
1176
|
# @example
|
1166
1177
|
# directory = Sketchup.template_dir
|
1167
1178
|
#
|
1168
|
-
# @return String containing the full template directory path
|
1179
|
+
# @return [String] containing the full template directory path
|
1169
1180
|
#
|
1170
1181
|
# @version SketchUp 6.0
|
1171
1182
|
def self.template_dir
|
@@ -1176,7 +1187,7 @@ module Sketchup
|
|
1176
1187
|
# @example
|
1177
1188
|
# Sketchup.undo
|
1178
1189
|
#
|
1179
|
-
# @return nil
|
1190
|
+
# @return [nil]
|
1180
1191
|
#
|
1181
1192
|
# @version SketchUp 6.0
|
1182
1193
|
def self.undo
|
@@ -1192,10 +1203,10 @@ module Sketchup
|
|
1192
1203
|
# @example
|
1193
1204
|
# result = Sketchup.vcb_label = "This is a Test"
|
1194
1205
|
#
|
1195
|
-
# @param label_text
|
1206
|
+
# @param [String] label_text
|
1196
1207
|
# The label text that will appear.
|
1197
1208
|
#
|
1198
|
-
# @return
|
1209
|
+
# @return [String]
|
1199
1210
|
#
|
1200
1211
|
# @version SketchUp 6.0
|
1201
1212
|
def self.vcb_label=(label_text)
|
@@ -1211,10 +1222,10 @@ module Sketchup
|
|
1211
1222
|
# @example
|
1212
1223
|
# result = Sketchup.vcb_value = "This is a Test"
|
1213
1224
|
#
|
1214
|
-
# @param value
|
1225
|
+
# @param [String] value
|
1215
1226
|
# The text that will appear as the vcb's value.
|
1216
1227
|
#
|
1217
|
-
# @return
|
1228
|
+
# @return [String]
|
1218
1229
|
#
|
1219
1230
|
# @version SketchUp 6.0
|
1220
1231
|
def self.vcb_value=(value)
|
@@ -1230,7 +1241,7 @@ module Sketchup
|
|
1230
1241
|
# return
|
1231
1242
|
# end
|
1232
1243
|
#
|
1233
|
-
# @return
|
1244
|
+
# @return [String] the decimal form of the version
|
1234
1245
|
#
|
1235
1246
|
# @version SketchUp 6.0
|
1236
1247
|
def self.version
|
@@ -1257,31 +1268,31 @@ module Sketchup
|
|
1257
1268
|
# puts "New format"
|
1258
1269
|
# end
|
1259
1270
|
#
|
1260
|
-
# @return
|
1271
|
+
# @return [Integer] the whole number form of the version
|
1261
1272
|
#
|
1262
1273
|
# @version SketchUp 6.0
|
1263
|
-
def self.version_number
|
1274
|
+
def self.version_number(*args)
|
1264
1275
|
end
|
1265
1276
|
|
1266
1277
|
# The write_default method is used to set the string associated with a
|
1267
|
-
# variable within the specified sub-section of a .plist file on the Mac
|
1268
|
-
# or the registry on Windows
|
1269
|
-
# (within the Software > SketchUp > SketchUp [Version] section).
|
1278
|
+
# variable within the specified sub-section of a .plist file on the Mac
|
1279
|
+
# or the registry on Windows
|
1280
|
+
# (within the Software > SketchUp > SketchUp [Version] section).
|
1270
1281
|
#
|
1271
1282
|
# @example
|
1272
1283
|
# result = Sketchup.write_default("section", "key", "my_value")
|
1273
1284
|
#
|
1274
1285
|
# @param [String] section
|
1275
|
-
# A section in a .plist file (Mac) or the registry
|
1276
|
-
# (Windows).
|
1277
|
-
#
|
1278
|
-
# @param [String] key
|
1279
|
-
# A key within the section.
|
1286
|
+
# A section in a .plist file (Mac) or the registry
|
1287
|
+
# (Windows).
|
1280
1288
|
#
|
1281
1289
|
# @param [Object] value
|
1282
1290
|
# The value to store.
|
1283
1291
|
#
|
1284
|
-
# @
|
1292
|
+
# @param [String] key
|
1293
|
+
# A key within the section.
|
1294
|
+
#
|
1295
|
+
# @return [Boolean] True if successful, false if unsuccessful.
|
1285
1296
|
#
|
1286
1297
|
# @version SketchUp 6.0
|
1287
1298
|
def self.write_default(section, key, value)
|