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.
- checksums.yaml +4 -4
- data/lib/sketchup-api-stubs.rb +1 -1
- data/lib/sketchup-api-stubs/sketchup.rb +147 -145
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +322 -318
- data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
- data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
- data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -400
- data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
- data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +498 -492
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
- data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
- data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
- data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -522
- data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +691 -691
- data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
- data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -573
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
- data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +179 -174
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +515 -514
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +148 -143
- data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
- data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
- data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -91
- data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +370 -371
- data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
- data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
- data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +225 -220
- data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -567
- data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
- data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
- data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
- data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
- data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +209 -204
- data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
- data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
- data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -694
- data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
- data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
- data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
- data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
- data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +144 -140
- data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
- data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
- data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +286 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +302 -328
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +478 -577
- data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
- data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
- data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +294 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +577 -562
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +604 -593
- data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
- data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +201 -194
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +362 -329
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +74 -72
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +104 -102
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +306 -312
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +42 -38
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +396 -390
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +502 -508
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1126 -1119
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +127 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +545 -544
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +60 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +126 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +751 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +699 -697
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
- data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +417 -409
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +266 -226
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +189 -190
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +405 -393
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +84 -82
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +306 -303
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +327 -285
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayerFolder.rb +422 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +427 -244
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +249 -136
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
- data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -112
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +414 -416
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +318 -311
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +142 -141
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +93 -95
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1651 -1638
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +357 -356
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +131 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -284
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
- data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +797 -770
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +363 -353
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +77 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +478 -456
- data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -364
- data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +45 -44
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +459 -454
- data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
- data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +257 -257
- data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +59 -57
- data/lib/sketchup-api-stubs/stubs/Sketchup/Skp.rb +40 -0
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +217 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +217 -225
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +835 -829
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +156 -154
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +71 -61
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1307 -1301
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +45 -43
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +317 -310
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +387 -356
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +255 -229
- data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
- data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
- data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
- data/lib/sketchup-api-stubs/stubs/geom.rb +351 -348
- data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
- data/lib/sketchup-api-stubs/stubs/length.rb +278 -278
- data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
- data/lib/sketchup-api-stubs/stubs/sketchup.rb +1342 -1310
- data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
- data/lib/sketchup-api-stubs/stubs/ui.rb +668 -667
- metadata +4 -2
@@ -1,190 +1,189 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The Importer interface lets you build your own importers for SketchUp. To
|
5
|
-
# use this, you create a subclass of Importer and implement all of the
|
6
|
-
# methods described below. This will make your importer appear in the list
|
7
|
-
# that users see under File > Import, and you can use Ruby to do all of the
|
8
|
-
# work of opening the file and creating whatever you need inside SketchUp.
|
9
|
-
#
|
10
|
-
# Here is an example of a complete script that imports a .txt file and
|
11
|
-
# displays its contents in a messagebox.
|
12
|
-
#
|
13
|
-
# @example
|
14
|
-
# class TextImporter < Sketchup::Importer
|
15
|
-
#
|
16
|
-
# # This method is called by SketchUp to determine the description that
|
17
|
-
# # appears in the File > Import dialog's pulldown list of valid
|
18
|
-
# # importers.
|
19
|
-
# def description
|
20
|
-
# return "Custom Text Importer (*.txt)"
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# # This method is called by SketchUp to determine what file extension
|
24
|
-
# # is associated with your importer.
|
25
|
-
# def file_extension
|
26
|
-
# return "txt"
|
27
|
-
# end
|
28
|
-
#
|
29
|
-
# # This method is called by SketchUp to get a unique importer id.
|
30
|
-
# def id
|
31
|
-
# return "com.sketchup.importers.custom_txt"
|
32
|
-
# end
|
33
|
-
#
|
34
|
-
# # This method is called by SketchUp to determine if the "Options"
|
35
|
-
# # button inside the File > Import dialog should be enabled while your
|
36
|
-
# # importer is selected.
|
37
|
-
# def supports_options?
|
38
|
-
# return true
|
39
|
-
# end
|
40
|
-
#
|
41
|
-
# # This method is called by SketchUp when the user clicks on the
|
42
|
-
# # "Options" button inside the File > Import dialog. You can use it to
|
43
|
-
# # gather and store settings for your importer.
|
44
|
-
# def do_options
|
45
|
-
# # In a real use you would probably store this information in an
|
46
|
-
# # instance variable.
|
47
|
-
# my_settings = UI.inputbox(['My Import Option:'], ['1'],
|
48
|
-
# "Import Options")
|
49
|
-
# end
|
50
|
-
#
|
51
|
-
# # This method is called by SketchUp after the user has selected a file
|
52
|
-
# # to import. This is where you do the real work of opening and
|
53
|
-
# # processing the file.
|
54
|
-
# def load_file(file_path, status)
|
55
|
-
# UI.messagebox(file_path)
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
# Instance Methods
|
74
|
-
|
75
|
-
# This method is called by SketchUp to determine the description that appears
|
76
|
-
# in the File > Import dialog's pulldown list of valid importers.
|
77
|
-
#
|
78
|
-
# Though it is common for the description to include the file extension
|
79
|
-
# supported by the importer (such as "Text Importer (.txt)"), the actual
|
80
|
-
# extension is defined in the file_extension method.
|
81
|
-
#
|
82
|
-
# @example
|
83
|
-
# def description
|
84
|
-
# return "Custom Text Importer (*.txt)"
|
85
|
-
# end
|
86
|
-
#
|
87
|
-
# @return description - a brief string description
|
88
|
-
#
|
89
|
-
# @version SketchUp 6.0
|
90
|
-
def description
|
91
|
-
end
|
92
|
-
|
93
|
-
# This method is called by SketchUp when the user clicks on the "Options"
|
94
|
-
# button inside the File > Import dialog. You can use it to gather and store
|
95
|
-
# settings for your importer.
|
96
|
-
#
|
97
|
-
# Only applicable if the importer supports options, meaning its
|
98
|
-
# supports_options method returns true.
|
99
|
-
#
|
100
|
-
# @example
|
101
|
-
# def id
|
102
|
-
# return "com.sketchup.importers.custom_txt"
|
103
|
-
# end
|
104
|
-
#
|
105
|
-
# @return id - an id string
|
106
|
-
#
|
107
|
-
# @version SketchUp 6.0
|
108
|
-
def do_options
|
109
|
-
end
|
110
|
-
|
111
|
-
# This method is called by SketchUp to determine a single file extension is
|
112
|
-
# associated with your importer. Only files that match this extension will be
|
113
|
-
# shown to the user as they browse their harddrive for things to import.
|
114
|
-
#
|
115
|
-
# Ruby importers are only allowed to support a single extension.
|
116
|
-
#
|
117
|
-
# @example
|
118
|
-
# def file_extension
|
119
|
-
# return "txt"
|
120
|
-
# end
|
121
|
-
#
|
122
|
-
# @return extension - typically a 3-letter string
|
123
|
-
#
|
124
|
-
# @version SketchUp 6.0
|
125
|
-
def file_extension
|
126
|
-
end
|
127
|
-
|
128
|
-
# This method is called by SketchUp to determine a unique identifier for
|
129
|
-
# your importer, typically something like "com.sketchup.importers.dxf".
|
130
|
-
#
|
131
|
-
# @example
|
132
|
-
# def id
|
133
|
-
# return "com.sketchup.importers.custom_txt"
|
134
|
-
# end
|
135
|
-
#
|
136
|
-
# @return id - an id string
|
137
|
-
#
|
138
|
-
# @version SketchUp 6.0
|
139
|
-
def id
|
140
|
-
end
|
141
|
-
|
142
|
-
# This method is called by SketchUp after the user has selected a file to
|
143
|
-
# import. This is where you do the real work by opening the file via Ruby's
|
144
|
-
# File object and processing it in whatever way you need.
|
145
|
-
#
|
146
|
-
# You must return an integer success code to SketchUp when you are done.
|
147
|
-
# These are the codes that SketchUp understands
|
148
|
-
#
|
149
|
-
#
|
150
|
-
# -
|
151
|
-
# -
|
152
|
-
# -
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
#
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
end
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The Importer interface lets you build your own importers for SketchUp. To
|
5
|
+
# use this, you create a subclass of Importer and implement all of the
|
6
|
+
# methods described below. This will make your importer appear in the list
|
7
|
+
# that users see under File > Import, and you can use Ruby to do all of the
|
8
|
+
# work of opening the file and creating whatever you need inside SketchUp.
|
9
|
+
#
|
10
|
+
# Here is an example of a complete script that imports a .txt file and
|
11
|
+
# displays its contents in a messagebox.
|
12
|
+
#
|
13
|
+
# @example
|
14
|
+
# class TextImporter < Sketchup::Importer
|
15
|
+
#
|
16
|
+
# # This method is called by SketchUp to determine the description that
|
17
|
+
# # appears in the File > Import dialog's pulldown list of valid
|
18
|
+
# # importers.
|
19
|
+
# def description
|
20
|
+
# return "Custom Text Importer (*.txt)"
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# # This method is called by SketchUp to determine what file extension
|
24
|
+
# # is associated with your importer.
|
25
|
+
# def file_extension
|
26
|
+
# return "txt"
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# # This method is called by SketchUp to get a unique importer id.
|
30
|
+
# def id
|
31
|
+
# return "com.sketchup.importers.custom_txt"
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# # This method is called by SketchUp to determine if the "Options"
|
35
|
+
# # button inside the File > Import dialog should be enabled while your
|
36
|
+
# # importer is selected.
|
37
|
+
# def supports_options?
|
38
|
+
# return true
|
39
|
+
# end
|
40
|
+
#
|
41
|
+
# # This method is called by SketchUp when the user clicks on the
|
42
|
+
# # "Options" button inside the File > Import dialog. You can use it to
|
43
|
+
# # gather and store settings for your importer.
|
44
|
+
# def do_options
|
45
|
+
# # In a real use you would probably store this information in an
|
46
|
+
# # instance variable.
|
47
|
+
# my_settings = UI.inputbox(['My Import Option:'], ['1'],
|
48
|
+
# "Import Options")
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# # This method is called by SketchUp after the user has selected a file
|
52
|
+
# # to import. This is where you do the real work of opening and
|
53
|
+
# # processing the file.
|
54
|
+
# def load_file(file_path, status)
|
55
|
+
# UI.messagebox(file_path)
|
56
|
+
#
|
57
|
+
# return Sketchup::Importer::ImportSuccess
|
58
|
+
# end
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# Sketchup.register_importer(TextImporter.new)
|
62
|
+
#
|
63
|
+
# @version SketchUp 6.0
|
64
|
+
class Sketchup::Importer
|
65
|
+
|
66
|
+
# Constants
|
67
|
+
|
68
|
+
ImportCanceled = nil # Stub value.
|
69
|
+
ImportFail = nil # Stub value.
|
70
|
+
ImportFileNotFound = nil # Stub value.
|
71
|
+
ImportSuccess = nil # Stub value.
|
72
|
+
|
73
|
+
# Instance Methods
|
74
|
+
|
75
|
+
# This method is called by SketchUp to determine the description that appears
|
76
|
+
# in the File > Import dialog's pulldown list of valid importers.
|
77
|
+
#
|
78
|
+
# Though it is common for the description to include the file extension
|
79
|
+
# supported by the importer (such as "Text Importer (.txt)"), the actual
|
80
|
+
# extension is defined in the file_extension method.
|
81
|
+
#
|
82
|
+
# @example
|
83
|
+
# def description
|
84
|
+
# return "Custom Text Importer (*.txt)"
|
85
|
+
# end
|
86
|
+
#
|
87
|
+
# @return description - a brief string description
|
88
|
+
#
|
89
|
+
# @version SketchUp 6.0
|
90
|
+
def description
|
91
|
+
end
|
92
|
+
|
93
|
+
# This method is called by SketchUp when the user clicks on the "Options"
|
94
|
+
# button inside the File > Import dialog. You can use it to gather and store
|
95
|
+
# settings for your importer.
|
96
|
+
#
|
97
|
+
# Only applicable if the importer supports options, meaning its
|
98
|
+
# supports_options method returns true.
|
99
|
+
#
|
100
|
+
# @example
|
101
|
+
# def id
|
102
|
+
# return "com.sketchup.importers.custom_txt"
|
103
|
+
# end
|
104
|
+
#
|
105
|
+
# @return id - an id string
|
106
|
+
#
|
107
|
+
# @version SketchUp 6.0
|
108
|
+
def do_options
|
109
|
+
end
|
110
|
+
|
111
|
+
# This method is called by SketchUp to determine a single file extension is
|
112
|
+
# associated with your importer. Only files that match this extension will be
|
113
|
+
# shown to the user as they browse their harddrive for things to import.
|
114
|
+
#
|
115
|
+
# Ruby importers are only allowed to support a single extension.
|
116
|
+
#
|
117
|
+
# @example
|
118
|
+
# def file_extension
|
119
|
+
# return "txt"
|
120
|
+
# end
|
121
|
+
#
|
122
|
+
# @return extension - typically a 3-letter string
|
123
|
+
#
|
124
|
+
# @version SketchUp 6.0
|
125
|
+
def file_extension
|
126
|
+
end
|
127
|
+
|
128
|
+
# This method is called by SketchUp to determine a unique identifier for
|
129
|
+
# your importer, typically something like "com.sketchup.importers.dxf".
|
130
|
+
#
|
131
|
+
# @example
|
132
|
+
# def id
|
133
|
+
# return "com.sketchup.importers.custom_txt"
|
134
|
+
# end
|
135
|
+
#
|
136
|
+
# @return id - an id string
|
137
|
+
#
|
138
|
+
# @version SketchUp 6.0
|
139
|
+
def id
|
140
|
+
end
|
141
|
+
|
142
|
+
# This method is called by SketchUp after the user has selected a file to
|
143
|
+
# import. This is where you do the real work by opening the file via Ruby's
|
144
|
+
# File object and processing it in whatever way you need.
|
145
|
+
#
|
146
|
+
# You must return an integer success code to SketchUp when you are done.
|
147
|
+
# These are the codes that SketchUp understands:
|
148
|
+
#
|
149
|
+
# - Sketchup::Importer::ImportSuccess
|
150
|
+
# - Sketchup::Importer::ImportFail
|
151
|
+
# - Sketchup::Importer::ImportCanceled - SketchUp will show a "cancelled" dialog
|
152
|
+
# - Sketchup::Importer::ImportFileNotFound - SketchUp will show a "not found" dialog
|
153
|
+
#
|
154
|
+
# @example
|
155
|
+
# def load_file(file_path, status)
|
156
|
+
# # Here is where you would open the file and process it.
|
157
|
+
# puts file_path
|
158
|
+
#
|
159
|
+
# return Sketchup::Importer::ImportSuccess
|
160
|
+
# end
|
161
|
+
#
|
162
|
+
# @param file_path
|
163
|
+
# Absolute path to the file the user selected
|
164
|
+
#
|
165
|
+
# @param status
|
166
|
+
# The status of the import so far. Contains true.
|
167
|
+
#
|
168
|
+
# @return success - an integer status code. See above.
|
169
|
+
#
|
170
|
+
# @version SketchUp 6.0
|
171
|
+
def load_file(file_path, status)
|
172
|
+
end
|
173
|
+
|
174
|
+
# This method is called by SketchUp to determine if the "Options"
|
175
|
+
# button inside the File > Import dialog should be enabled while your
|
176
|
+
# importer is selected.
|
177
|
+
#
|
178
|
+
# @example
|
179
|
+
# def supports_options?
|
180
|
+
# return true
|
181
|
+
# end
|
182
|
+
#
|
183
|
+
# @return [Boolean] supports_options - a boolean
|
184
|
+
#
|
185
|
+
# @version SketchUp 6.0
|
186
|
+
def supports_options?
|
187
|
+
end
|
188
|
+
|
189
|
+
end
|
@@ -1,393 +1,405 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The InputPoint used to pick
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
#
|
26
|
-
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
# @
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
# @
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
# @
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
# @
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
# @
|
178
|
-
#
|
179
|
-
#
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
195
|
-
#
|
196
|
-
# @
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
203
|
-
# @
|
204
|
-
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
# The
|
211
|
-
#
|
212
|
-
#
|
213
|
-
#
|
214
|
-
#
|
215
|
-
#
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
#
|
220
|
-
#
|
221
|
-
#
|
222
|
-
#
|
223
|
-
#
|
224
|
-
#
|
225
|
-
#
|
226
|
-
#
|
227
|
-
#
|
228
|
-
#
|
229
|
-
#
|
230
|
-
#
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
#
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
240
|
-
#
|
241
|
-
#
|
242
|
-
# @
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
#
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
#
|
251
|
-
#
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
#
|
256
|
-
#
|
257
|
-
#
|
258
|
-
#
|
259
|
-
#
|
260
|
-
#
|
261
|
-
#
|
262
|
-
#
|
263
|
-
#
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
#
|
268
|
-
#
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
276
|
-
#
|
277
|
-
#
|
278
|
-
# @
|
279
|
-
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
#
|
283
|
-
#
|
284
|
-
#
|
285
|
-
#
|
286
|
-
#
|
287
|
-
#
|
288
|
-
#
|
289
|
-
#
|
290
|
-
#
|
291
|
-
#
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
#
|
296
|
-
#
|
297
|
-
#
|
298
|
-
#
|
299
|
-
#
|
300
|
-
#
|
301
|
-
#
|
302
|
-
#
|
303
|
-
#
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
#
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
#
|
312
|
-
#
|
313
|
-
#
|
314
|
-
#
|
315
|
-
#
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
#
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
#
|
324
|
-
#
|
325
|
-
#
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
#
|
330
|
-
#
|
331
|
-
#
|
332
|
-
#
|
333
|
-
#
|
334
|
-
#
|
335
|
-
#
|
336
|
-
#
|
337
|
-
#
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
#
|
342
|
-
#
|
343
|
-
#
|
344
|
-
#
|
345
|
-
#
|
346
|
-
#
|
347
|
-
#
|
348
|
-
#
|
349
|
-
#
|
350
|
-
#
|
351
|
-
#
|
352
|
-
#
|
353
|
-
#
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
#
|
358
|
-
#
|
359
|
-
#
|
360
|
-
#
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
365
|
-
#
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
#
|
370
|
-
#
|
371
|
-
#
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
#
|
376
|
-
#
|
377
|
-
#
|
378
|
-
#
|
379
|
-
#
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
#
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The {Sketchup::InputPoint} class is used to pick 3d points and/or entities
|
5
|
+
# that reside under the current cursor location, similar to native Line tool
|
6
|
+
# and other drawing tools. Unlike {Sketchup::PickHelper},
|
7
|
+
# {Sketchup::InputPoint} uses inference, i.e. "snaps" to vertices and other
|
8
|
+
# entities when the cursor is close to them.
|
9
|
+
#
|
10
|
+
# Only {Sketchup::Tool}s react to cursor location and most of these methods are
|
11
|
+
# only useful in the context of a tool. For example, if you want to determine
|
12
|
+
# the 3d point you just moved the cursor over, you would use
|
13
|
+
# {#pick} from within your {Sketchup::Tool#onMouseMove} method.
|
14
|
+
# {Sketchup::InputPoints} are best picked from mouse move, as you want them to
|
15
|
+
# draw them to the view.
|
16
|
+
#
|
17
|
+
# For an example, see https://github.com/SketchUp/sketchup-ruby-api-tutorials/tree/master/examples/02_custom_tool.
|
18
|
+
#
|
19
|
+
# To lock inference similar to native SketchUp tools, see
|
20
|
+
# {View#lock_inference}.
|
21
|
+
#
|
22
|
+
# @version SketchUp 6.0
|
23
|
+
class Sketchup::InputPoint
|
24
|
+
|
25
|
+
# Instance Methods
|
26
|
+
|
27
|
+
# The == method is used to determine if two input points are the same.
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
# view = Sketchup.active_model.active_view
|
31
|
+
# x = 100
|
32
|
+
# y = 100
|
33
|
+
# ip1 = Sketchup::InputPoint.new
|
34
|
+
# ip2 = view.inputpoint x,y
|
35
|
+
# # Copy the contents of inputpoint2 into inputpoint1
|
36
|
+
# ip1.copy! ip2
|
37
|
+
# # Returns true
|
38
|
+
# status = ip1 == ip2
|
39
|
+
#
|
40
|
+
# @param inputpoint2
|
41
|
+
# The second input point in the comparison.
|
42
|
+
#
|
43
|
+
# @return status - true if the InputPoint objects are the same
|
44
|
+
# object. False if the objects are not the same.
|
45
|
+
#
|
46
|
+
# @version SketchUp 6.0
|
47
|
+
def ==(inputpoint2)
|
48
|
+
end
|
49
|
+
|
50
|
+
# The clear method is used to clear the input point.
|
51
|
+
#
|
52
|
+
# This sets it to an empty state. After calling this, valid? will return
|
53
|
+
# false.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
# view = Sketchup.active_model.active_view
|
57
|
+
# x = 100
|
58
|
+
# y = 100
|
59
|
+
# ip1 = view.inputpoint x,y
|
60
|
+
# # Returns true
|
61
|
+
# ip = ip1.clear
|
62
|
+
#
|
63
|
+
# @return inputpoint - the cleared (empty) input point if this
|
64
|
+
# successful
|
65
|
+
#
|
66
|
+
# @version SketchUp 6.0
|
67
|
+
def clear
|
68
|
+
end
|
69
|
+
|
70
|
+
# The copy! method is used to copy the data from a second input point into
|
71
|
+
# this input point.
|
72
|
+
#
|
73
|
+
# @example
|
74
|
+
# view = Sketchup.active_model.active_view
|
75
|
+
# x = 100
|
76
|
+
# y = 100
|
77
|
+
# ip1 = Sketchup::InputPoint.new
|
78
|
+
# ip2 = view.inputpoint x,y
|
79
|
+
# # Copy the contents of inputpoint2 into inputpoint1
|
80
|
+
# ip = ip1.copy! ip2
|
81
|
+
#
|
82
|
+
# @param inputpoint
|
83
|
+
# The second input point.
|
84
|
+
#
|
85
|
+
# @return inputpoint - the new input point that received the copy
|
86
|
+
# if successful
|
87
|
+
#
|
88
|
+
# @version SketchUp 6.0
|
89
|
+
def copy!(inputpoint)
|
90
|
+
end
|
91
|
+
|
92
|
+
# The degrees_of_freedom method retrieves the number of degrees of freedom
|
93
|
+
# there are for an input point.
|
94
|
+
#
|
95
|
+
# If you are just getting a point in space, then the degrees_of_freedom will
|
96
|
+
# be 3 - meaning that there is nothing about the point that would constrain
|
97
|
+
# its position.
|
98
|
+
#
|
99
|
+
# If you are on a face, then the degrees_of_freedom will be 2
|
100
|
+
# meaning that you can only move on the plane of the face.
|
101
|
+
#
|
102
|
+
# If you are on an Edge or an axis, then the degrees_of_freedom will be 1
|
103
|
+
# meaning that you can only move in the direction of the edge or axis.
|
104
|
+
#
|
105
|
+
# If you get an end point of an Edge, or an intersection point, then the
|
106
|
+
# degrees_of_freedom will be 0.
|
107
|
+
#
|
108
|
+
# @example
|
109
|
+
# view = Sketchup.active_model.active_view
|
110
|
+
# x = 100
|
111
|
+
# y = 100
|
112
|
+
# ip1 = view.inputpoint x,y
|
113
|
+
# dof = ip1.degrees_of_freedom
|
114
|
+
#
|
115
|
+
# @return degrees_of_freedom - see comments.
|
116
|
+
#
|
117
|
+
# @version SketchUp 6.0
|
118
|
+
def degrees_of_freedom
|
119
|
+
end
|
120
|
+
|
121
|
+
# The depth method retrieves the depth of an inference if it is coming from a
|
122
|
+
# component.
|
123
|
+
#
|
124
|
+
# If the InputPoint is not getting a position from inside a component, this
|
125
|
+
# method will return 0. Otherwise it returns the depth of the entity in a
|
126
|
+
# nested component that is providing the position.
|
127
|
+
#
|
128
|
+
# @example
|
129
|
+
# view = Sketchup.active_model.active_view
|
130
|
+
# x = 100
|
131
|
+
# y = 100
|
132
|
+
# ip1 = view.inputpoint x,y
|
133
|
+
# d = ip1.depth
|
134
|
+
#
|
135
|
+
# @return depth - a number representing the depth of the
|
136
|
+
# inputpoint (inside groups and components) if successful
|
137
|
+
#
|
138
|
+
# @version SketchUp 6.0
|
139
|
+
def depth
|
140
|
+
end
|
141
|
+
|
142
|
+
# The display? method is used to determine if the input point has anything to
|
143
|
+
# draw.
|
144
|
+
#
|
145
|
+
# If the method returns true, then the draw method will draw something.
|
146
|
+
#
|
147
|
+
# @example
|
148
|
+
# view = Sketchup.active_model.active_view
|
149
|
+
# x = 100
|
150
|
+
# y = 100
|
151
|
+
# ip1 = view.inputpoint x,y
|
152
|
+
# status = ip1.display
|
153
|
+
#
|
154
|
+
# @return [Boolean] status - true if the draw method will draw something,
|
155
|
+
# false if the draw method has nothing to draw
|
156
|
+
#
|
157
|
+
# @version SketchUp 6.0
|
158
|
+
def display?
|
159
|
+
end
|
160
|
+
|
161
|
+
# The draw method is used to draw the input point.
|
162
|
+
#
|
163
|
+
# This is useful for showing an InputPoint from within the draw method of a
|
164
|
+
# tool that you have implemented in Ruby. Additional examples are available in
|
165
|
+
# the Plugins/examples directory.
|
166
|
+
#
|
167
|
+
# @example
|
168
|
+
# view = Sketchup.active_model.active_view
|
169
|
+
# x = 100
|
170
|
+
# y = 100
|
171
|
+
# ip1 = view.inputpoint x,y
|
172
|
+
# ip = ip1.draw view
|
173
|
+
#
|
174
|
+
# @param view
|
175
|
+
# The current view.
|
176
|
+
#
|
177
|
+
# @return view
|
178
|
+
#
|
179
|
+
# @version SketchUp 6.0
|
180
|
+
def draw(view)
|
181
|
+
end
|
182
|
+
|
183
|
+
# The edge method is used to retrieve the edge if the input point is getting
|
184
|
+
# its position from a point on an Edge.
|
185
|
+
#
|
186
|
+
# @example
|
187
|
+
# view = Sketchup.active_model.active_view
|
188
|
+
# x = 100
|
189
|
+
# y = 100
|
190
|
+
# ip1 = view.inputpoint x,y
|
191
|
+
# e = ip1.edge
|
192
|
+
#
|
193
|
+
# @return edge - an Edge object if successful, or nil if
|
194
|
+
# unsuccessful
|
195
|
+
#
|
196
|
+
# @version SketchUp 6.0
|
197
|
+
def edge
|
198
|
+
end
|
199
|
+
|
200
|
+
# The face method retrieves the face at or behind the input point. This can be
|
201
|
+
# used to determine a plane, similar to what native Rotate tool does.
|
202
|
+
#
|
203
|
+
# @example
|
204
|
+
# view = Sketchup.active_model.active_view
|
205
|
+
# x = 100
|
206
|
+
# y = 100
|
207
|
+
# ip1 = view.inputpoint x,y
|
208
|
+
# f = ip1.face
|
209
|
+
#
|
210
|
+
# @note The InputPoint doesn't necessarily lie on the face, but can be e.g. on
|
211
|
+
# an edge in front of the face.
|
212
|
+
#
|
213
|
+
# @return [Sketchup::Face, nil]
|
214
|
+
#
|
215
|
+
# @version SketchUp 6.0
|
216
|
+
def face
|
217
|
+
end
|
218
|
+
|
219
|
+
# The new method is used to create a new InputPoint object.
|
220
|
+
#
|
221
|
+
# @example
|
222
|
+
# ip1 = Sketchup::InputPoint.new
|
223
|
+
#
|
224
|
+
# # Or you can construct it at an arbitrary location.
|
225
|
+
# starting_point = Geom::Point3d.new(100, 200, 300)
|
226
|
+
# ip2 = Sketchup::InputPoint.new(starting_point)
|
227
|
+
#
|
228
|
+
# @note Prior to SketchUp 2019 it was not possible to
|
229
|
+
# sub-class {Sketchup::InputPoint} due to a bug in how SketchUp initialized
|
230
|
+
# the class.
|
231
|
+
#
|
232
|
+
# @overload initialize()
|
233
|
+
#
|
234
|
+
# @return [Sketchup::InputPoint]
|
235
|
+
#
|
236
|
+
# @overload initialize(pt_or_vertex)
|
237
|
+
#
|
238
|
+
# @param pt_or_vertex [Geom::Point3d, Sketchup::Vertex] An optional Point3d
|
239
|
+
# or Vertex where the new InputPoint should be created.
|
240
|
+
# @return [Sketchup::InputPoint]
|
241
|
+
#
|
242
|
+
# @version SketchUp 6.0
|
243
|
+
def initialize(*args)
|
244
|
+
end
|
245
|
+
|
246
|
+
# The {#instance_path} method retrieves the instance path for the picked point.
|
247
|
+
#
|
248
|
+
# The returned instance_path is a copy of what the input point is holding on to
|
249
|
+
# at the moment you access it. Your copy will not update if you make new picks
|
250
|
+
# with the input point.
|
251
|
+
#
|
252
|
+
# If there has been no valid pick it will return `nil`.
|
253
|
+
#
|
254
|
+
# @example
|
255
|
+
# view = Sketchup.active_model.active_view
|
256
|
+
# x = 100
|
257
|
+
# y = 100
|
258
|
+
# ip = view.inputpoint(x, y)
|
259
|
+
# instance_path = ip.instance_path
|
260
|
+
#
|
261
|
+
# @return [Sketchup::InstancePath, nil]
|
262
|
+
#
|
263
|
+
# @version SketchUp 2017
|
264
|
+
def instance_path
|
265
|
+
end
|
266
|
+
|
267
|
+
# The pick method is used to get the input point at a specific screen
|
268
|
+
# position.
|
269
|
+
#
|
270
|
+
# The first form just uses the screen position to compute the InputPoint. It
|
271
|
+
# is used when you don't want the InputPoint to be dependent on another
|
272
|
+
# InputPoint.
|
273
|
+
#
|
274
|
+
# The second form uses the screen position and another InputPoint. It will
|
275
|
+
# find additional inferences such as along one of the axis directions from the
|
276
|
+
# first point.
|
277
|
+
#
|
278
|
+
# @example
|
279
|
+
# view = Sketchup.active_model.active_view
|
280
|
+
# x = 100
|
281
|
+
# y = 100
|
282
|
+
# inputpoint = view.inputpoint x, y
|
283
|
+
# inputpoint2 = Sketchup::InputPoint.new
|
284
|
+
# inputpoint.pick view, x, y
|
285
|
+
# inputpoint.pick view, x, y, inputpoint2
|
286
|
+
#
|
287
|
+
# @param view
|
288
|
+
# The current view.
|
289
|
+
#
|
290
|
+
# @param x
|
291
|
+
# A x value.
|
292
|
+
#
|
293
|
+
# @param y
|
294
|
+
# A y value.
|
295
|
+
#
|
296
|
+
# @param [optional] inputpoint
|
297
|
+
# A second input point used as a reference
|
298
|
+
# for the pick.
|
299
|
+
#
|
300
|
+
# @return status - true if a valid InputPoint was picked and it
|
301
|
+
# is different than it was before.
|
302
|
+
#
|
303
|
+
# @version SketchUp 6.0
|
304
|
+
def pick(view, x, y, inputpoint)
|
305
|
+
end
|
306
|
+
|
307
|
+
# The position method is used to get the 3D point from the input point.
|
308
|
+
#
|
309
|
+
# @example
|
310
|
+
# view = Sketchup.active_model.active_view
|
311
|
+
# x = 100
|
312
|
+
# y = 100
|
313
|
+
# ip1 = view.inputpoint x,y
|
314
|
+
# point = ip1.position
|
315
|
+
#
|
316
|
+
# @return point - a Point3d object position for the input point
|
317
|
+
# if successful
|
318
|
+
#
|
319
|
+
# @version SketchUp 6.0
|
320
|
+
def position
|
321
|
+
end
|
322
|
+
|
323
|
+
# The tooltip method is used to retrieve the string that is the tool tip to
|
324
|
+
# display for the input point.
|
325
|
+
#
|
326
|
+
# @example
|
327
|
+
# view = Sketchup.active_model.active_view
|
328
|
+
# x = 100
|
329
|
+
# y = 100
|
330
|
+
# ip1 = view.inputpoint x,y
|
331
|
+
# # Click on a face and you get "On Face"
|
332
|
+
# tip = ip1.tooltip
|
333
|
+
#
|
334
|
+
# @return tip - a string tooltip or an empty string (if the input
|
335
|
+
# point doesn't provide a tooltip).
|
336
|
+
#
|
337
|
+
# @version SketchUp 6.0
|
338
|
+
def tooltip
|
339
|
+
end
|
340
|
+
|
341
|
+
# The transformation method retrieves the Transformation object for the input
|
342
|
+
# point.
|
343
|
+
#
|
344
|
+
# If the InputPoint object is getting its position from something inside of a
|
345
|
+
# component instance, this method returns the Transformation of the component
|
346
|
+
# instance. Otherwise it returns the identity Transformation.
|
347
|
+
#
|
348
|
+
# Note that the position method on a input point always returns a point that is
|
349
|
+
# transformed into model space. If you are using the edge, face or vertex
|
350
|
+
# method on the InputPoint though, you will probably need to use the
|
351
|
+
# transformation method to transform the data that you get back from the
|
352
|
+
# selected entity.
|
353
|
+
#
|
354
|
+
# @example
|
355
|
+
# view = Sketchup.active_model.active_view
|
356
|
+
# x = 100
|
357
|
+
# y = 100
|
358
|
+
# ip1 = view.inputpoint x,y
|
359
|
+
# # In this case, returning the identity transformation
|
360
|
+
# tform = ip1.transformation
|
361
|
+
#
|
362
|
+
# @return transformation - the Transformation for the input point
|
363
|
+
# if successful
|
364
|
+
#
|
365
|
+
# @version SketchUp 6.0
|
366
|
+
def transformation
|
367
|
+
end
|
368
|
+
|
369
|
+
# The valid? method is used to determine if an input point has valid data.
|
370
|
+
#
|
371
|
+
# You must have called the pick method to set the data before it is valid.
|
372
|
+
#
|
373
|
+
# @example
|
374
|
+
# view = Sketchup.active_model.active_view
|
375
|
+
# x = 100
|
376
|
+
# y = 100
|
377
|
+
# ip1 = view.inputpoint x,y
|
378
|
+
# status = ip1.valid?
|
379
|
+
#
|
380
|
+
# @return [Boolean] status - true if the input point has valid data, false
|
381
|
+
# if it does not have valid data.
|
382
|
+
#
|
383
|
+
# @version SketchUp 6.0
|
384
|
+
def valid?
|
385
|
+
end
|
386
|
+
|
387
|
+
# The vertex method returns a Vertex associated with the InputPoint. If the
|
388
|
+
# InputPoint is on the end of a line, then it will return the Vertex. If the
|
389
|
+
# InputPoint does not select any vertices this method returns nil.
|
390
|
+
#
|
391
|
+
# @example
|
392
|
+
# view = Sketchup.active_model.active_view
|
393
|
+
# x = 100
|
394
|
+
# y = 100
|
395
|
+
# ip1 = view.inputpoint x,y
|
396
|
+
# # Click on a face and you get "On Face"
|
397
|
+
# tip = ip1.vertex
|
398
|
+
#
|
399
|
+
# @return vertex - The associated vertex
|
400
|
+
#
|
401
|
+
# @version SketchUp 6.0
|
402
|
+
def vertex
|
403
|
+
end
|
404
|
+
|
405
|
+
end
|