sketchup-api-stubs 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.yardopts +9 -9
- data/lib/sketchup-api-stubs.rb +1 -1
- data/lib/sketchup-api-stubs/sketchup.rb +145 -145
- data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +318 -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 +492 -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 +174 -186
- data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
- data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +514 -514
- data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
- data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +143 -155
- 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 +371 -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 +220 -232
- 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 +204 -216
- 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 +140 -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 +281 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
- data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +328 -328
- data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +577 -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 +281 -281
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +562 -562
- data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -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 +194 -194
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +329 -329
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +72 -72
- data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +102 -102
- data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +312 -312
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +38 -38
- data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
- data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +390 -390
- data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +508 -508
- data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1119 -1119
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +125 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +544 -544
- data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +59 -59
- data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -125
- data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +750 -750
- data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
- data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +697 -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 +409 -409
- data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +226 -226
- data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +190 -190
- data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +393 -393
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +82 -82
- data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +303 -303
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +285 -280
- data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +244 -231
- data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +136 -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 -123
- data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
- data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +416 -416
- data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +311 -311
- data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +141 -141
- data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +95 -95
- data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1638 -1601
- data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +356 -356
- data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +132 -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 +770 -770
- data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +353 -353
- data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +76 -76
- data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +456 -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 +44 -44
- data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
- data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +454 -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 +57 -57
- data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
- data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +211 -211
- data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
- data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +225 -225
- data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +829 -829
- data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
- data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +154 -154
- data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +61 -61
- data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
- data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1301 -1301
- data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +43 -43
- data/lib/sketchup-api-stubs/stubs/UI/Command.rb +310 -310
- data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +356 -356
- data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +229 -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 +348 -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 +1310 -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 +667 -667
- metadata +3 -4
@@ -1,136 +1,136 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# This observer interface is implemented to react to layers events. To
|
5
|
-
# implement this observer, create a Ruby class of this type, override the
|
6
|
-
# desired methods, and add an instance of the observer to the objects of
|
7
|
-
# interests.
|
8
|
-
#
|
9
|
-
# @example
|
10
|
-
# class MyLayersObserver < Sketchup::LayersObserver
|
11
|
-
# def onLayerAdded(layers, layer)
|
12
|
-
# puts "onLayerAdded: #{layer.name}"
|
13
|
-
# end
|
14
|
-
# end
|
15
|
-
#
|
16
|
-
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
17
|
-
# Sketchup.active_model.layers.add("Hello World")
|
18
|
-
#
|
19
|
-
# @version SketchUp 6.0
|
20
|
-
class Sketchup::LayersObserver
|
21
|
-
|
22
|
-
# Instance Methods
|
23
|
-
|
24
|
-
# The {#onCurrentLayerChanged} method is called when the user selects a
|
25
|
-
# different active layer.
|
26
|
-
#
|
27
|
-
# @example
|
28
|
-
# class MyLayersObserver < Sketchup::LayersObserver
|
29
|
-
# def onCurrentLayerChanged(layers, layer)
|
30
|
-
# puts "onCurrentLayerChanged: #{layer.name}"
|
31
|
-
# end
|
32
|
-
# end
|
33
|
-
#
|
34
|
-
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
35
|
-
# layer = Sketchup.active_model.layers.add("Hello World")
|
36
|
-
# Sketchup.active_model.active_layer = layer
|
37
|
-
#
|
38
|
-
# @param [Sketchup::Layers] layers
|
39
|
-
#
|
40
|
-
# @param [Sketchup::Layer] layer
|
41
|
-
#
|
42
|
-
# @return [nil]
|
43
|
-
#
|
44
|
-
# @version SketchUp 6.0
|
45
|
-
def onCurrentLayerChanged(layers, layer)
|
46
|
-
end
|
47
|
-
|
48
|
-
# The {#onLayerAdded} method is called when a new layer is added to a model.
|
49
|
-
#
|
50
|
-
# @example
|
51
|
-
# class MyLayersObserver < Sketchup::LayersObserver
|
52
|
-
# def onLayerAdded(layers, layer)
|
53
|
-
# puts "onLayerAdded: #{layer.name}"
|
54
|
-
# end
|
55
|
-
# end
|
56
|
-
#
|
57
|
-
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
58
|
-
# Sketchup.active_model.layers.add("Hello World")
|
59
|
-
#
|
60
|
-
# @param [Sketchup::Layers] layers
|
61
|
-
#
|
62
|
-
# @param [Sketchup::Layer] layer
|
63
|
-
#
|
64
|
-
# @return [nil]
|
65
|
-
#
|
66
|
-
# @version SketchUp 6.0
|
67
|
-
def onLayerAdded(layers, layer)
|
68
|
-
end
|
69
|
-
|
70
|
-
# The {#onLayerChanged} method is called when a layer is changed.
|
71
|
-
#
|
72
|
-
# @example
|
73
|
-
# def onLayerChanged(layers, layer)
|
74
|
-
# puts "onLayerChanged: #{layer.name}"
|
75
|
-
# end
|
76
|
-
#
|
77
|
-
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
78
|
-
# layer = Sketchup.active_model.layers.add("Hello World")
|
79
|
-
# layer.name = "Hello Universe"
|
80
|
-
#
|
81
|
-
# @param [Sketchup::Layers] layers
|
82
|
-
#
|
83
|
-
# @param [Sketchup::Layer] layer
|
84
|
-
#
|
85
|
-
# @return [nil]
|
86
|
-
#
|
87
|
-
# @version SketchUp 2014
|
88
|
-
def onLayerChanged(layers, layer)
|
89
|
-
end
|
90
|
-
|
91
|
-
# The {#onLayerRemoved} method is called when a layer is removed from a model.
|
92
|
-
#
|
93
|
-
# @example
|
94
|
-
# class MyLayersObserver < Sketchup::LayersObserver
|
95
|
-
# def onLayerRemoved(layers, layer)
|
96
|
-
# puts "onLayerRemoved: #{layer.name}"
|
97
|
-
# end
|
98
|
-
# end
|
99
|
-
#
|
100
|
-
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
101
|
-
# layer = Sketchup.active_model.layers.add("Hello World")
|
102
|
-
# Sketchup.active_model.layers.remove(layer)
|
103
|
-
#
|
104
|
-
# @param [Sketchup::Layers] layers
|
105
|
-
#
|
106
|
-
# @param [Sketchup::Layer] layer
|
107
|
-
#
|
108
|
-
# @return [nil]
|
109
|
-
#
|
110
|
-
# @version SketchUp 6.0
|
111
|
-
def onLayerRemoved(layers, layer)
|
112
|
-
end
|
113
|
-
|
114
|
-
# The {#onRemoveAllLayers} method is called when all layer are removed from a
|
115
|
-
# model.
|
116
|
-
#
|
117
|
-
# @example
|
118
|
-
# class MyLayersObserver < Sketchup::LayersObserver
|
119
|
-
# def onRemoveAllLayers(layers)
|
120
|
-
# puts "onRemoveAllLayers: #{layers}"
|
121
|
-
# end
|
122
|
-
# end
|
123
|
-
#
|
124
|
-
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
125
|
-
# layer = Sketchup.active_model.layers.add("Hello World")
|
126
|
-
# Sketchup.active_model.layers.remove(layer)
|
127
|
-
#
|
128
|
-
# @param [Sketchup::Layers] layers
|
129
|
-
#
|
130
|
-
# @return [nil]
|
131
|
-
#
|
132
|
-
# @version SketchUp 6.0
|
133
|
-
def onRemoveAllLayers(layers)
|
134
|
-
end
|
135
|
-
|
136
|
-
end
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# This observer interface is implemented to react to layers events. To
|
5
|
+
# implement this observer, create a Ruby class of this type, override the
|
6
|
+
# desired methods, and add an instance of the observer to the objects of
|
7
|
+
# interests.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
11
|
+
# def onLayerAdded(layers, layer)
|
12
|
+
# puts "onLayerAdded: #{layer.name}"
|
13
|
+
# end
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
17
|
+
# Sketchup.active_model.layers.add("Hello World")
|
18
|
+
#
|
19
|
+
# @version SketchUp 6.0
|
20
|
+
class Sketchup::LayersObserver
|
21
|
+
|
22
|
+
# Instance Methods
|
23
|
+
|
24
|
+
# The {#onCurrentLayerChanged} method is called when the user selects a
|
25
|
+
# different active layer.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
29
|
+
# def onCurrentLayerChanged(layers, layer)
|
30
|
+
# puts "onCurrentLayerChanged: #{layer.name}"
|
31
|
+
# end
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
35
|
+
# layer = Sketchup.active_model.layers.add("Hello World")
|
36
|
+
# Sketchup.active_model.active_layer = layer
|
37
|
+
#
|
38
|
+
# @param [Sketchup::Layers] layers
|
39
|
+
#
|
40
|
+
# @param [Sketchup::Layer] layer
|
41
|
+
#
|
42
|
+
# @return [nil]
|
43
|
+
#
|
44
|
+
# @version SketchUp 6.0
|
45
|
+
def onCurrentLayerChanged(layers, layer)
|
46
|
+
end
|
47
|
+
|
48
|
+
# The {#onLayerAdded} method is called when a new layer is added to a model.
|
49
|
+
#
|
50
|
+
# @example
|
51
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
52
|
+
# def onLayerAdded(layers, layer)
|
53
|
+
# puts "onLayerAdded: #{layer.name}"
|
54
|
+
# end
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
58
|
+
# Sketchup.active_model.layers.add("Hello World")
|
59
|
+
#
|
60
|
+
# @param [Sketchup::Layers] layers
|
61
|
+
#
|
62
|
+
# @param [Sketchup::Layer] layer
|
63
|
+
#
|
64
|
+
# @return [nil]
|
65
|
+
#
|
66
|
+
# @version SketchUp 6.0
|
67
|
+
def onLayerAdded(layers, layer)
|
68
|
+
end
|
69
|
+
|
70
|
+
# The {#onLayerChanged} method is called when a layer is changed.
|
71
|
+
#
|
72
|
+
# @example
|
73
|
+
# def onLayerChanged(layers, layer)
|
74
|
+
# puts "onLayerChanged: #{layer.name}"
|
75
|
+
# end
|
76
|
+
#
|
77
|
+
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
78
|
+
# layer = Sketchup.active_model.layers.add("Hello World")
|
79
|
+
# layer.name = "Hello Universe"
|
80
|
+
#
|
81
|
+
# @param [Sketchup::Layers] layers
|
82
|
+
#
|
83
|
+
# @param [Sketchup::Layer] layer
|
84
|
+
#
|
85
|
+
# @return [nil]
|
86
|
+
#
|
87
|
+
# @version SketchUp 2014
|
88
|
+
def onLayerChanged(layers, layer)
|
89
|
+
end
|
90
|
+
|
91
|
+
# The {#onLayerRemoved} method is called when a layer is removed from a model.
|
92
|
+
#
|
93
|
+
# @example
|
94
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
95
|
+
# def onLayerRemoved(layers, layer)
|
96
|
+
# puts "onLayerRemoved: #{layer.name}"
|
97
|
+
# end
|
98
|
+
# end
|
99
|
+
#
|
100
|
+
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
101
|
+
# layer = Sketchup.active_model.layers.add("Hello World")
|
102
|
+
# Sketchup.active_model.layers.remove(layer)
|
103
|
+
#
|
104
|
+
# @param [Sketchup::Layers] layers
|
105
|
+
#
|
106
|
+
# @param [Sketchup::Layer] layer
|
107
|
+
#
|
108
|
+
# @return [nil]
|
109
|
+
#
|
110
|
+
# @version SketchUp 6.0
|
111
|
+
def onLayerRemoved(layers, layer)
|
112
|
+
end
|
113
|
+
|
114
|
+
# The {#onRemoveAllLayers} method is called when all layer are removed from a
|
115
|
+
# model.
|
116
|
+
#
|
117
|
+
# @example
|
118
|
+
# class MyLayersObserver < Sketchup::LayersObserver
|
119
|
+
# def onRemoveAllLayers(layers)
|
120
|
+
# puts "onRemoveAllLayers: #{layers}"
|
121
|
+
# end
|
122
|
+
# end
|
123
|
+
#
|
124
|
+
# Sketchup.active_model.layers.add_observer(MyLayersObserver.new)
|
125
|
+
# layer = Sketchup.active_model.layers.add("Hello World")
|
126
|
+
# Sketchup.active_model.layers.remove(layer)
|
127
|
+
#
|
128
|
+
# @param [Sketchup::Layers] layers
|
129
|
+
#
|
130
|
+
# @return [nil]
|
131
|
+
#
|
132
|
+
# @version SketchUp 6.0
|
133
|
+
def onRemoveAllLayers(layers)
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
@@ -1,48 +1,48 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The +Sketchup::Licensing+ module contains methods for
|
5
|
-
# extensions purchased from Extension Warehouse to check their licensing status.
|
6
|
-
#
|
7
|
-
# It is advised to place these calls inside encrypted Ruby (.rbe) files. This
|
8
|
-
# API is also exposed via the SketchUp C API. Extensions that already use
|
9
|
-
# native code should prefer using the native API, which should be more secure
|
10
|
-
# than their Ruby API counterparts.
|
11
|
-
#
|
12
|
-
# For more details, see:
|
13
|
-
# {Developer Center Licensing Tutorial}[https://extensions.sketchup.com/en/developer_center/tutorial_licensing]
|
14
|
-
#
|
15
|
-
# @version SketchUp 2015
|
16
|
-
module Sketchup::Licensing
|
17
|
-
|
18
|
-
# Constants
|
19
|
-
|
20
|
-
EXPIRED = nil # Stub value.
|
21
|
-
LICENSED = nil # Stub value.
|
22
|
-
NOT_LICENSED = nil # Stub value.
|
23
|
-
TRIAL = nil # Stub value.
|
24
|
-
TRIAL_EXPIRED = nil # Stub value.
|
25
|
-
|
26
|
-
# Class Methods
|
27
|
-
|
28
|
-
# Acquires a license for a given extension.
|
29
|
-
#
|
30
|
-
# @example
|
31
|
-
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
32
|
-
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
33
|
-
# if ext_lic.licensed?
|
34
|
-
# puts "Extension is licensed."
|
35
|
-
# end
|
36
|
-
#
|
37
|
-
# @param [String] extension_id
|
38
|
-
# The Extension Warehouse UUID for the desired extension.
|
39
|
-
#
|
40
|
-
# @return [ExtensionLicense] An object representing
|
41
|
-
# licensing state for the extension. Do not store this object, retrieve
|
42
|
-
# it again when needed since licensing state may have changed.
|
43
|
-
#
|
44
|
-
# @version SketchUp 2015
|
45
|
-
def self.get_extension_license(extension_id)
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The +Sketchup::Licensing+ module contains methods for
|
5
|
+
# extensions purchased from Extension Warehouse to check their licensing status.
|
6
|
+
#
|
7
|
+
# It is advised to place these calls inside encrypted Ruby (.rbe) files. This
|
8
|
+
# API is also exposed via the SketchUp C API. Extensions that already use
|
9
|
+
# native code should prefer using the native API, which should be more secure
|
10
|
+
# than their Ruby API counterparts.
|
11
|
+
#
|
12
|
+
# For more details, see:
|
13
|
+
# {Developer Center Licensing Tutorial}[https://extensions.sketchup.com/en/developer_center/tutorial_licensing]
|
14
|
+
#
|
15
|
+
# @version SketchUp 2015
|
16
|
+
module Sketchup::Licensing
|
17
|
+
|
18
|
+
# Constants
|
19
|
+
|
20
|
+
EXPIRED = nil # Stub value.
|
21
|
+
LICENSED = nil # Stub value.
|
22
|
+
NOT_LICENSED = nil # Stub value.
|
23
|
+
TRIAL = nil # Stub value.
|
24
|
+
TRIAL_EXPIRED = nil # Stub value.
|
25
|
+
|
26
|
+
# Class Methods
|
27
|
+
|
28
|
+
# Acquires a license for a given extension.
|
29
|
+
#
|
30
|
+
# @example
|
31
|
+
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
32
|
+
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
33
|
+
# if ext_lic.licensed?
|
34
|
+
# puts "Extension is licensed."
|
35
|
+
# end
|
36
|
+
#
|
37
|
+
# @param [String] extension_id
|
38
|
+
# The Extension Warehouse UUID for the desired extension.
|
39
|
+
#
|
40
|
+
# @return [ExtensionLicense] An object representing
|
41
|
+
# licensing state for the extension. Do not store this object, retrieve
|
42
|
+
# it again when needed since licensing state may have changed.
|
43
|
+
#
|
44
|
+
# @version SketchUp 2015
|
45
|
+
def self.get_extension_license(extension_id)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -1,86 +1,86 @@
|
|
1
|
-
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
-
# License:: The MIT License (MIT)
|
3
|
-
|
4
|
-
# The Sketchup::Licensing::ExtensionLicense class is used to store extension
|
5
|
-
# license information. An instance of this class is returned by
|
6
|
-
# Sketchup::Licensing.get_extension_license. Note that this is a temporary
|
7
|
-
# object representing the extension licensing state for the moment it was
|
8
|
-
# returned. It will not reflect any licensing state changes that may occur.
|
9
|
-
#
|
10
|
-
# @version SketchUp 2015
|
11
|
-
class Sketchup::Licensing::ExtensionLicense
|
12
|
-
|
13
|
-
# Instance Methods
|
14
|
-
|
15
|
-
# The days_remaining method is used to get the number of days remaining until
|
16
|
-
# license expiration.
|
17
|
-
#
|
18
|
-
# @example
|
19
|
-
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
20
|
-
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
21
|
-
# if ext_lic.days_remaining != 0
|
22
|
-
# puts "The license will expire in #{ext_lic.days_remaining} days."
|
23
|
-
# end
|
24
|
-
#
|
25
|
-
# @return Integer - Number of days until license expiration. Zero
|
26
|
-
# if a permanent license or not licensed.
|
27
|
-
#
|
28
|
-
# @version SketchUp 2015
|
29
|
-
def days_remaining
|
30
|
-
end
|
31
|
-
|
32
|
-
# The error_description method is used to obtain error information in case of
|
33
|
-
# failure to acquire a license. This is meant to aid in debugging only.
|
34
|
-
# Extensions should not rely on any exact error description.
|
35
|
-
#
|
36
|
-
# @example
|
37
|
-
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
38
|
-
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
39
|
-
# if !ext_lic.licensed?
|
40
|
-
# puts ext_lic.error_description
|
41
|
-
# end
|
42
|
-
#
|
43
|
-
# @return String - error description.
|
44
|
-
#
|
45
|
-
# @version SketchUp 2015
|
46
|
-
def error_description
|
47
|
-
end
|
48
|
-
|
49
|
-
# The licensed? method is used to decide whether the extension is licensed to
|
50
|
-
# run or not.
|
51
|
-
#
|
52
|
-
# @example
|
53
|
-
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
54
|
-
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
55
|
-
# if ext_lic.licensed?
|
56
|
-
# puts "Extension is licensed."
|
57
|
-
# end
|
58
|
-
#
|
59
|
-
# @return [Boolean] Boolean - true if the extension is allowed to run, false
|
60
|
-
# if it is not licensed and should quit.
|
61
|
-
#
|
62
|
-
# @version SketchUp 2015
|
63
|
-
def licensed?
|
64
|
-
end
|
65
|
-
|
66
|
-
# The state method returns a constant indicating the specific licensing state.
|
67
|
-
# These should be used for informational purposes only and not to decide if
|
68
|
-
# the extension is licensed to run. For that, please use the licensed? method.
|
69
|
-
#
|
70
|
-
# @example
|
71
|
-
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
72
|
-
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
73
|
-
# if ext_lic.state == Sketchup::Licensing::TRIAL_EXPIRED
|
74
|
-
# puts "Trial period has expired."
|
75
|
-
# end
|
76
|
-
#
|
77
|
-
# @return Integer - One of Sketchup::Licensing::LICENSED,
|
78
|
-
# Sketchup::Licensing::EXPIRED, Sketchup::Licensing::TRIAL,
|
79
|
-
# Sketchup::Licensing::TRIAL_EXPIRED,
|
80
|
-
# Sketchup::Licensing::NOT_LICENSED
|
81
|
-
#
|
82
|
-
# @version SketchUp 2015
|
83
|
-
def state
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
1
|
+
# Copyright:: Copyright 2020 Trimble Inc.
|
2
|
+
# License:: The MIT License (MIT)
|
3
|
+
|
4
|
+
# The Sketchup::Licensing::ExtensionLicense class is used to store extension
|
5
|
+
# license information. An instance of this class is returned by
|
6
|
+
# Sketchup::Licensing.get_extension_license. Note that this is a temporary
|
7
|
+
# object representing the extension licensing state for the moment it was
|
8
|
+
# returned. It will not reflect any licensing state changes that may occur.
|
9
|
+
#
|
10
|
+
# @version SketchUp 2015
|
11
|
+
class Sketchup::Licensing::ExtensionLicense
|
12
|
+
|
13
|
+
# Instance Methods
|
14
|
+
|
15
|
+
# The days_remaining method is used to get the number of days remaining until
|
16
|
+
# license expiration.
|
17
|
+
#
|
18
|
+
# @example
|
19
|
+
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
20
|
+
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
21
|
+
# if ext_lic.days_remaining != 0
|
22
|
+
# puts "The license will expire in #{ext_lic.days_remaining} days."
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# @return Integer - Number of days until license expiration. Zero
|
26
|
+
# if a permanent license or not licensed.
|
27
|
+
#
|
28
|
+
# @version SketchUp 2015
|
29
|
+
def days_remaining
|
30
|
+
end
|
31
|
+
|
32
|
+
# The error_description method is used to obtain error information in case of
|
33
|
+
# failure to acquire a license. This is meant to aid in debugging only.
|
34
|
+
# Extensions should not rely on any exact error description.
|
35
|
+
#
|
36
|
+
# @example
|
37
|
+
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
38
|
+
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
39
|
+
# if !ext_lic.licensed?
|
40
|
+
# puts ext_lic.error_description
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
# @return String - error description.
|
44
|
+
#
|
45
|
+
# @version SketchUp 2015
|
46
|
+
def error_description
|
47
|
+
end
|
48
|
+
|
49
|
+
# The licensed? method is used to decide whether the extension is licensed to
|
50
|
+
# run or not.
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
54
|
+
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
55
|
+
# if ext_lic.licensed?
|
56
|
+
# puts "Extension is licensed."
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# @return [Boolean] Boolean - true if the extension is allowed to run, false
|
60
|
+
# if it is not licensed and should quit.
|
61
|
+
#
|
62
|
+
# @version SketchUp 2015
|
63
|
+
def licensed?
|
64
|
+
end
|
65
|
+
|
66
|
+
# The state method returns a constant indicating the specific licensing state.
|
67
|
+
# These should be used for informational purposes only and not to decide if
|
68
|
+
# the extension is licensed to run. For that, please use the licensed? method.
|
69
|
+
#
|
70
|
+
# @example
|
71
|
+
# ext_id = "4e215280-dd23-40c4-babb-b8a8dd29d5ee"
|
72
|
+
# ext_lic = Sketchup::Licensing.get_extension_license(ext_id)
|
73
|
+
# if ext_lic.state == Sketchup::Licensing::TRIAL_EXPIRED
|
74
|
+
# puts "Trial period has expired."
|
75
|
+
# end
|
76
|
+
#
|
77
|
+
# @return Integer - One of Sketchup::Licensing::LICENSED,
|
78
|
+
# Sketchup::Licensing::EXPIRED, Sketchup::Licensing::TRIAL,
|
79
|
+
# Sketchup::Licensing::TRIAL_EXPIRED,
|
80
|
+
# Sketchup::Licensing::NOT_LICENSED
|
81
|
+
#
|
82
|
+
# @version SketchUp 2015
|
83
|
+
def state
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|